We have seen an issue in xenapp 7.6 where some of the vms are shutdown automatically after weekend reboot. After lot of research on the delivery controller, we have identified that Delivery controller is sending the shutdown command to some of the vms(random vms every week) and esx is shutting down the vms. So we have decided to turn off power management completely in our xenapp 7.6 environment.
Here are the steps to disable power management in xenapp or xendesktop 7.6
Set-BrokerDesktopGroup -Name * -AutomaticPowerOnForAssigned $True
Set-BrokerDesktopGroup -Name * -AutomaticPowerOnForAssignedDuringPeak $True
Set-BrokerDesktopGroup -Name * -OffPeakBufferSizePercent 100
Set-BrokerDesktopGroup -Name * -PeakBufferSizePercent 100
Set-BrokerDesktopGroup -Name * -ShutdownDesktopsAfterUse $False
Note: Need to execute the above commands in delivery controller.
Above commands would let all your VDAs be in power on state, even after users logoff.
If you are working on a test environment or dev, where you need your VDA (or VDI) to be turned off until you click on the VDI icon in your citrix portal, you can set buffer VDI size to zero as shown below. With below commands all your VDIs will be powered off and they will be powered on only when you click on the VDI icon in your citrix portal.
To disable power management completely, use:
Set-BrokerDesktopGroup -Name * -AutomaticPowerOnForAssigned $False
Set-BrokerDesktopGroup -Name * -AutomaticPowerOnForAssignedDuringPeak $False
Set-BrokerDesktopGroup -Name * -OffPeakBufferSizePercent 0
Set-BrokerDesktopGroup -Name * -PeakBufferSizePercent 0
Set-BrokerDesktopGroup -Name * -ShutdownDesktopsAfterUse $True
Note: This would take a while for the session to start as VDIs are in powered off state, you have to wait till they are powered on and your session is logged in.