How to Support Virtual Machines with Long Startup Times in XenDesktop Environment

How to Support Virtual Machines with Long Startup Times in XenDesktop Environment

book

Article ID: CTX140522

calendar_today

Updated On:

Description

This article desc​ribes how to increase the time allowed for a Virtual Machine (VM) to start up and register with a XenDesktop site during session launch. This might be required in environments where launches fail because of long VM startup times rather than a specific fault.

Background

When a VM requires to be switched on or resumed to accomplish a session launch request for a user, XenDesktop 7.x allows the Virtual Machine time to register with the site before continuing with the session launch. If the VM does not register within this time, the launch is considered to have failed and an error is reported to the end user through Receiver.

Instructions

Increasing Allowed Time for VM Startup During Session Launch

The default maximum time allowed for a VM to register after being switched on or resumed for a session launch is 2 minutes (this is in addition to the time allowed to establish the connection from the user’s device to the VM and so on). In most environments this default time is adequate to reliably allow a VM to start-up and register.

In some environments, in particular Cloud-based, VMs might routinely require more than 2 minutes. In this case the maximum allowed time can be specified using the following registry value on the controller:

Caution! Refer to the Disclaimer at the end of this article before using Registry Editor. 

HKLM\Software\Citrix\DesktopServer\ExtraSpinUpTimeSecs (DWORD)

The same value must be specified on all controllers in the site. Alternatively the value can be provided by GPO using this registry value:

HKLM\Software\Citrix\Policies\DesktopServer\ExtraSpinUpTimeSecs (DWORD)

Both preceding values are specified in seconds. The default time used where neither value exists is 120.

This setting is site-wide (it cannot, for example, be restricted to a specific hypervisor connection) and it applies in all cases where a VM must be switched on or resumed in order to accomplish a session launch request.

Note: If the allowed time is increased above 20 minutes then the MaxRegistrationDelayMin registry value (same paths as above) must also be adjusted. This defines the maximum time allowed after a VM is switched on for it to register, this is specified in minutes (not seconds) and defaults to 20. If the machine has not registered after this time, it is assumed to have failed and is shut down.

Avoiding VM Startup During Session Launch

Although the maximum allowed time can be increased to any required value, the user is waiting for their session to launch during this period, so if very long times are routinely required, then the interactive experience is likely to be poor and might ultimately be unacceptable.

In shared delivery groups, the impact of these long startup times can be mitigated by specifying appropriate pool management buffer size values to keep a small number of idle machines running in a state suitable for immediate use. These buffer sizes can be adjusted using the PowerShell SDK.

For more information, see the PeakBufferSizePercent and OffPeakBufferSizePercent parameters of the Set-BrokerDesktopGroup cmdlet.

VM Startup for Pool Management

If a VM is switched on to maintain the required level of running machines within a delivery group, but not specifically to accomplish a session launch request by a user, the time allowed for the VM to register is much larger than the 2 minutes allowed during launch. This is because many VMs might be switched on in a short space of time (for example, at the transition from off-peak to peak hours) so they might be expected to take longer to start in these situations. In addition, the end user is not waiting for a specific VM to startup and register in this case.

Environment

Caution! Using Registry Editor incorrectly can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.

Issue/Introduction

This article desc​ribes how to increase the time allowed for a Virtual Machine to start up and register with a XenDesktop site during session launch. This might be required in environments where launches fail because of long Virtual Machine startup times rather than a specific fault.

Additional Information

For additional information about registry settings that impact the behavior of the Citrix Broker Service, see CTX126704 - Registry Entries Used by XenDesktop 5.x Broker Service

For general information about the XenDesktop PowerShell SDK, see the online documentation.