vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
743 stars 601 forks source link

deleteOrRefreshMachineAfterLogoff can only be set for floating user assignment #606

Open BHB3805 opened 1 year ago

BHB3805 commented 1 year ago

Describe the bug

Exception calling "Desktop_Create" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidArgument ErrorMessage : deleteOrRefreshMachineAfterLogoff can only be set for floating user assignment ParameterName : desktopSettings.logoffSettings.deleteOrRefreshMachineAfterLogoff" At C:\Program Files\WindowsPowerShell\Modules\TEMP\PowerCLI-Example-Scripts-master\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:4986 char:7

Reproduction steps

I am trying to utilize the New-HVPool command to create a new Instant Clone desktop pool. I'm using the following script


$Cred = Get-Credential $HVServer = "a02pvw01.bhbank.net" $Vcenter = "a02pvc02.bhbank.net" $datacenter = "A02-PDC" $datastores = "/A02-PDC/host/VDI/VDI_DS051" $DomainAdmin = "svc-icops01" $HostOrCluster = "/A02-PDC/host/VDI" $ResourcePool = "/A02-PDC/host/VDI/Resources" $NetBiosName = "BHBANK" $ParentVM = "W10IMG06-IC" $SnapshotVM = "W10IMG06-IC-V23.02" $NewPoolName = "B90-VDP-IC" $PoolDisplayName = "B90-Mongolia (IC)" $ProvTime = "UP_FRONT" $VmFolder = "/A02-PDC/vm/Virtual Desktops" $MinimumCount = 1 $MaximumCount = 4 $SpareCount = 1 $NumUnassignedMachinesKeptPoweredOn = 1 $AdContainer = "OU=Instant Clones,OU=BHHorizonDesktops" $NamingPattern = "B90VDIC{n:fixed=2}" # for example $UserAssignment = "DEDICATED" # or DEDICATED $AutomaticAssignment = $false # or $false $allowUsersToResetMachines = $false # or $true $AllowMultipleSessionsPerUser = $false # or $true $deleteOrRefreshMachineAfterLogoff = "NEVER" # DELETE or NEVER -lof $RefreshOsDiskAfterLogoff = "NEVER" $supportedDisplayProtocols = "BLAST","PCOIP" $renderer3D = "DISABLED" $enableGRIDvGPUs = $false $maxNumberOfMonitors = 2 $maxResolutionOfAnyOneMonitor = "WUXGA" $quality = "NO_CONTROL" #or HIGH LOW MEDIUM $throttling = "DISABLED" #or AGGRESIVE CONSERVATIVE DISABLED MODERATE $overrideGlobalSetting = $false # or $true $UseSeparateDatastoresReplicaAndOSDisks = $false # or $true $UseViewStorageAccelerator = $false # or $true $EnableProvisioning = $true # or $false $NamingMethod = "PATTERN" $ReclaimVmDiskSpace = $false # or $true $RedirectWindowsProfile = $false # or $true $StopOnProvisioningError = $true # or $true $StorageOvercommit = "UNBOUNDED" $UseNativeSnapshots = $false # or $true $UseSeparateDatastoresPersistentAndOSDisks = $false # or $true $UseVSAN = $false # or $false $enableHTMLAccess = $true # or $false $defaultDisplayProtocol = "PCOIP" $AutomaticLogoffMinutes = 480 $allowUsersToChooseProtocol = $false $AutomaticLogoffPolicy = "AFTER" #IMMEDIATELY or NEVER $postsyncscript = "" $postsyncpara = "" Connect-HVServer -Server $HVServer -Credential $Cred New-HVPool -instantclone -Datastores $Datastores -HostOrCluster $HostOrCluster -NamingMethod $NamingMethod -NetBiosName $NetBiosName -ParentVM $ParentVM -PoolName $NewPoolName -ResourcePool $ResourcePool -SnapshotVM $SnapshotVM -UserAssignment $UserAssignment -VmFolder $VmFolder -AdContainer $AdContainer -AutomaticAssignment $AutomaticAssignment -datacenter $datacenter -DomainAdmin $DomainAdmin -Enable $true -EnableProvisioning $EnableProvisioning -MaximumCount $MaximumCount -MinimumCount $MinimumCount -NamingPattern $NamingPattern -NumUnassignedMachinesKeptPoweredOn $NumUnassignedMachinesKeptPoweredOn -PoolDisplayName $PoolDisplayName -ProvisioningTime $ProvTime -ReclaimVmDiskSpace $ReclaimVmDiskSpace -RedirectWindowsProfile $RedirectWindowsProfile -SpareCount $SpareCount -StopProvisioningOnError $true -StorageOvercommit $StorageOvercommit -UseNativeSnapshots $UseNativeSnapshots -UseSeparateDatastoresReplicaAndOSDisks $UseSeparateDatastoresReplicaAndOSDisks -UseVSAN $UseVSAN -Vcenter $Vcenter -enableHTMLAccess $enableHTMLAccess -defaultDisplayProtocol $defaultDisplayProtocol -AutomaticLogoffMinutes $AutomaticLogoffMinutes -allowUsersToChooseProtocol $allowUsersToChooseProtocol -AutomaticLogoffPolicy $AutomaticLogoffPolicy -PostSynchronizationScriptParameters $postsyncpara -PostSynchronizationScriptName $postsyncscript

The command fails - deleteOrRefreshMachineAfterLogoff can only be set for floating user assignment

There is no issue creating the pool is the Horizon Administrator GUI.

Expected behavior

Creation of new pool.

Additional context

No response

gerguk commented 1 year ago

This looks like a duplicate of #377 where you are creating a dedicated pool. There are no issues when creating a floating pool. Can we get the these merged and addressed?