Dedicated VM shuts down and remains powered off, even though logoff behavior “ShutdownDesktopsAfterUse” is set to false

Dedicated Virtual Machine shuts down and remains powered off, even though Logoff behavior ShutdownDesktopsAfterUse is set to false.

Cause

The problem occurs after updating the master image of a Dedicated type catalog using the PowerShell SDK commands listed under CTX129205 – How to Update the Master Image for Dedicated and Pooled Machine Types using PowerShell SDK Console.

Changes applied to the master image of a Dedicated Catalog should only affect new machines created from the image and those changes does not apply to the existing machines in that catalog.

The problem occurs because the update process assigns the new updated image to all the Virtual Machines in the catalog, marking the existing ones with the ImageOutOfDate flag. Once the flag is enabled for the Virtual Machine, it shuts down after logging off with the attempt to start to the newly assigned image. At this point, the flag is always enabled since Dedicated machines cannot change to a different image.

Resolution

There is a two-part process to correct this issue:

  • A SQL query to fix the ImageOutOfDate flags of the affected catalog within the database.
Following is an SQL update statement that fixes the Dedicated machines in this state. This update does not require a restart of any services: Note: Verify there is a working database backup before proceeding update MachinePersonalitySchema.VMInfo set AssignedImage = BootedImage where VirtualMachineId in (select VirtualMachineId from MachinePersonalitySchema.VMInfo, DesktopUpdateManagerSchema.ProvisionedVirtualMachine, DesktopUpdateManagerSchema.ProvisioningScheme where (MachinePersonalitySchema.VMInfo.VirtualMachineId = DesktopUpdateManagerSchema.ProvisionedVirtualMachine.VMId and DesktopUpdateManagerSchema.ProvisionedVirtualMachine.ProvisioningSchemeUid = DesktopUpdateManagerSchema.ProvisioningScheme.ProvisioningSchemeUid and DesktopUpdateManagerSchema.ProvisioningScheme.CleanOnBoot = 0))

The query fixes the existing catalogs in this state, but the change only applies to new sessions or after restarting the Virtual Machine. Existing sessions have to log off for the machine to restart.

Read the original post here at the Citrix knowledgebase.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.