Have you ever wished you could natively have a persistent VM reset back to its original state without having to provision the user with a new machine?

Developers, lab environments, and third-party users are some of the most common use cases for persistent VMs in Citrix DaaS deployments. Customers have asked us in the past to provide the native ability to return a persistent VM to its base image (before a user customized the VM) without having to provision the user with a new machine. While some customers have implemented custom scripts or workflows in their ITSM platform, this functionality has not been native to Citrix DaaS. Until now.

Citrix is excited to announce that administrators can now reset their VMs back to their original state, blending persistent VDIs with the centralized management capability of non-persistent VMs. Citrix DaaS currently supports this capability for VMs provisioned in VMware vSphere, but we plan to evaluate other hypervisor platforms in the future. This feature is also included in Citrix Virtual Apps and Desktops 2209.

The reset is transparent to the end user by re-creating the VM but preserving the user assignment in DaaS. Please note, administrators should proceed with caution with this new technology; improper use could result in users losing their work unexpectedly.

While the goal is for Citrix DaaS administrators to reset persistent VMs back to the latest OS disk state in both PowerShell and Studio, this feature is now only available in PowerShell. Another eventual goal is for end users to also reset their persistent VMs back to the latest OS disk state via the Citrix Workspace UI natively (bypassing the need for admin intervention).

Requirements

Citrix has introduced a new PowerShell commandlet Reset-ProvVMDisk, and there are a few prerequisites:

  • Currently only supported for VMware environments (including VMware Cloud variants)
  • Persistent VMs only
  • The hypervisor is not in maintenance mode
  • The hosting connection in Citrix DaaS is not in maintenance mode
  • VMs must be powered off
  • VMs must be in maintenance mode

Required Parameters

Let’s look at the required parameters for using this commandlet.

First, the admin must provide either a ProvisioningSchemeName or a ProvisioningSchemeUid. The ProvisioningSchemeName is simply the machine catalog name. The ProvisioningSchemeUid is an alternative parameter to use if you don’t want to use the ProvisioningSchemeName and can be obtained via the DaaS GUI by going to Machine Catalogs, selecting the desired Machine Catalog, and then viewing the information pane. Alternately, it can be obtained via PowerShell using Get-BrokerCatalog. One of these two parameters is required to run the command. Please note, the parameter must be specified within “quotes” if it contains a space.

Next, the admin must specify the VMName. Each VM should be specified within quotations. For multiple VMs, use a comma to separate each VM. This is also a required value.

The last required value is the OS parameter, which tells the command to specifically reset the OS disk of the persistent VM.

Here’s a complete example of running this command against a single VM:

Reset-ProvVMDisk -ProvisioningSchemeName “Test” -VMName "vm1" -OS

And here’s an example of running this command against multiple VMs:

Reset-ProvVMDisk -ProvisioningSchemeName “Test” -VMName ("vm1"," vm2") -OS

Optional Parameters

We’ve covered the minimum requirements to reset persistent VMs back to their base image. There are also several additional potentially useful optional parameters:

  • WhatIf shows what would happen if the commandlet were run without executing.
  • Force suppresses prompts for confirmation before proceeding to reset the OS disk(s) of the specified VM(s).
  • Confirm prompts for confirmation before running the commandlet.
  • RunAsynchronously indicates whether the command will return before the task is finished being executed in the hypervisor. The default action is to run synchronously, where the command in the PowerShell window will not return until the entire operation is complete. Be careful when running asynchronously. Administrators should not take VMs out of maintenance mode or power them on until the command completes.

Piping from other commandlets such as Get-ProvVM is also supported. For example, the following command resets all VMs in the machine catalog “Test.” Please note, this syntax is more efficient than using Get-ProvVM -ProvisioningSchemeName “Test” | Reset-ProvVMDisk -ProvisioningSchemeName “Test” -OS. Consider the example below. Reset-ProvVMDisk runs once with all the VMs as an input to that task (including checks like hypervisor capability, connection check, etc.) whereas the less efficient syntax will run Reset-ProvVMDisk for each VM and thus perform all the necessary checks for each VM. (Thanks to my colleague Joe Freedman for pointing this out.)

,(Get-ProvVM -ProvisioningSchemeName "Test") | Reset-ProvVMDisk -ProvisioningSchemeName "Test" -OS

Get Started Today!

The new Reset-ProvVMDisk command empowers IT admins by enabling them to reset persistent VM(s) back to their original state without having to provision the user with a new machine. But there are a few things you should remember before giving it a try:

  • This functionality is currently only supported in VMware environments for persistent VMs.
  • You must specify either a ProvisioningSchemeName or a ProvisioningSchemeUid.
  • Running this command is inherently a destructive action, so use the WhatIf parameter to validate your VM selection and syntax before executing.
  • Only admins can run this command because the commandlet validates delegated admin permissions prior to execution.

For interested admins, please refer to the Citrix Developer Docs and let us know what you think! Does this ability allow you to reduce dependency on third-party management tools? Is there another feature you’d like to see? Let us know below.


Disclaimer: The development, release and timing of any features or functionality described for our products remains at our sole discretion and are subject to change without notice or consultation. The information provided is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making purchasing decisions or incorporated into any contract.