When attempting to start a desktop, users receive the following error, even though there are desktops listed as ‘Ready’ in the target desktop group:
The XML broker logs the following events:
No available resource found for user domain\user when accessing desktop group Desktop Group. This message was reported from the Citrix XML Service at address http://localhost/scripts/wpnbr.dll [com.citrix.xml.NFuseProtocol.RequestAddress].
The Citrix Broker Service failed to broker a connection for user Domain\User to resource Desktop Group. The Citrix Broker Service cannot find any available virtual machines.
To prevent this issue from occurring, ensure that the Desktop Delivery Controller (Controller) is able to power manage virtual machines on the target hosting infrastructure by right-clicking on any desktop and clicking Shut Down or Restart. Check your hypervisor console to ensure the power action takes place. If this does not take place, additional troubleshooting will be required to address this.
Citrix recommends creating a schedule to restart Virtual Machines during an off-peak time of possible, which will clear the WillShutdownAfterUse flag.
The following PowerShell script can also be used to clean up any desktops in a ‘tainted’ state, and can be run weekly to ensure that no desktops remain in this state:
$dirtyvms = Get-BrokerDesktop -PowerActionPending $false -PowerState On -SummaryState Available -WillShutdownAfterUse $true foreach ($vm in $dirtyvms) { New-BrokerHostingPowerAction -Action 'Restart' -MachineName $vm.HostedMachineName }
Note: If you are using XenDesktop 5.6, use the following command:
New-BrokerHostingPowerAction -Action 'Restart' -MachineName $vm.MachineName
This problem occurs when a Desktop Group is configured with the ‘ShutdownAfterUse’ parameter, but is not properly shutdown by the XenDesktop DDC after use. When a session is started to a desktop group with the ‘ShutdownAfterUse’ setting enabled, the desktop is flagged with a parameter called ‘WillShutdownAfterUse’. This flag is cleared when the desktop is shut down by the Controller, so if/when a ‘ShutdownAfterUse’ power action fails, the worker remains in this state until the desktop is successfully power managed by the Controller. Desktops will also reach this state when placed into maintenance mode while a session is active, and logged off while still in maintenance mode.
Idle pool buffers facilitate cleaning of ‘tainted’ desktops when transitioning from peak to off-peak schedules. However, if both peak and off-peak idle pool buffers are set to 100%, desktops will remain in this state until restarted by XenDesktop.
The following PowerShell command list all desktops in this state:
Get-BrokerDesktop -PowerActionPending $false -PowerState On -SummaryState Available -WillShutdownAfterUse $true | fl MachineName