Tuesday, March 12, 2019

Citrix XenDesktop 7.15 reboot issues

Citrix XenDesktop 7.15 reboot issues


During our migration from XenApp 6.5 to 7.15 we encountered some issues with reboots.

Several reboot schedules were created using the New-BrokerRebootScheduleV2 cmdlet as follow: 

PS> New-BrokerRebootScheduleV2 @props -Name Reboot_XYZ_0630_30 -DesktopGroupName DG_XYZ -RestrictToTag Tag_Reboot_XYZ -StartTime 06:30 -RebootDuration 30

Yet, out of 14 Delivery Groups only one would actually create reboot cycles.
Also, the VMToolsState was inconsistently being reported in XenDesktop.
It woud change from NotStarted to Running after a machine reboot and then would switch back to NotStarted when changing the reboot cycle day....

PS> Get-BrokerMachine | select hostedmachinename, vmtoolsstate, powerstate, registrationstate

HostedMachineName VMToolsState PowerState RegistrationState
----------------- ------------ ---------- -----------------
xxxxxxxxx               NotStarted         On        Registered
xxxxxxxxx               Running            On        Registered
xxxxxxxxx               Running            On        Registered
xxxxxxxxx               NotStarted         On        Registered
xxxxxxxxx               NotStarted         On        Registered

Given that the issue affected all Delivery Groups but one, a quick comparison of the properties of the working vs non-working ones with the Get-BrokerDesktopGroup cmdle highlighted that the non-working Delivery Groups did not have any TimeZone property setup. 

As per https://citrix.github.io/delivery-controller-sdk/Broker/Set-BrokerDesktopGroup/
"The time zone must be specified for any of the group's automatic power management settings to take effect. "

The discrepancy was caused by the scripted creation of Delivery Groups as part of the application import script. The Delivery Group for which the reboots worked well was the one that had been created manually... sight...
So if you decide to script Delivery group creation bare in mind that you will also need to set the TimeZone property appropriately. 

Set-BrokerDesktopGroup -Name DG_XYZ -TimeZone "W. Europe Standard Time"

To find your time zone, you can use the command below:
tzutil.exe /l 

I hope this will help a few....