How to convert MCS provisioned VM’s identity disks to streaming optimized disks.

How to convert MCS provisioned VM’s identity disks to streaming optimized disks.

book

Article ID: CTX691779

calendar_today

Updated On:

Description

Description:

Support for VMware vSAN8 was incorporated into all current releases of Citrix Virtual Apps and Desktops as detailed in this blog. With this support, Machine Creation Services (MCS) creates VMDK files with a stream-optimized format for all VMs. As the blog mentioned, there might be existing VMs created by legacy versions of CVAD with identity disks in monolithic flat format. This Knowledge Base article provides instructions on how to convert identity disks with monolithic-flat VMDK format to a stream-optimized VMDK format in a vSAN8 environment using PowerShell scripts.  

 

Highlights:

  • The ConvertVmdkFiles function offers the ability to transform the identity disks of existing virtual machines (VMs) from a monolithic-flat format into a stream-optimized VMDK format. Notably, this function includes parameters that enable the conversion of identity disks for all VMs within a machine catalog or for a specific VM designated by administrators. During the VMDK conversion process, the identity disk of the virtual machine is downloaded as stream-optimized files and subsequently uploaded back to the vSAN storage as a new identity disk file and attached to the virtual machine. This original disk is retained within the VM folder unless administrators specifically choose to remove it.

  • The RemoveOrphanIdentityDisks function allows you to remove the original flat identity disk from the VM. The function assumes that the original identity disk is still present in the VM folder and was not removed during the VMDK file format conversion.

  • The RollBackIdentityDiskConversion function is used to rollback the conversion of the identity disks from a stream-optimized VMDK format to a monolithic-flat. This operation involves detaching the stream-optimized identity disk and subsequently reattaching the original identity disk with a monolithic-flat format.

  • The scripts are easy to use and utilizes Citrix PowerShell cmdlets and VMware PowerCLI cmdlets 

The scripts are available on GitHub at [link to GitHub].


Instructions

  1. Download the powershell scripts from GitHub.

  2. Extract the scripts to a convenient location on your computer.

  3. The computer must be domain joined to the domain associated with the resource location used by the powershell scripts.

  4. Install the Remote Powershell SDK for Citrix Cloud.

  5. Open a powershell window.

  6. Navigate to the directory where you extracted the scripts.

  7. Import the required modules, run the following command:

Import-Module .\FlatVmdkConverter.psm1

ConvertVmdkFiles
           -VMName myVM
           -CloudCustomerId "myCloudCustomerId"
           -CloudCustomerApiKey "myCloudCustomerApiKey"
           -vCenterServerAddress "0.0.0.0"

 

Additional Information:

  • The scripts will not be compatible with Encrypted Virtual Machines, as they depend on the VMware ExportVM capability.

  • The minimum set of permissions required to run this script has not been assessed. It is recommended to use administrator privileges when executing this script.

 

Conclusion:

The FlatVmdkConverter converter scripts are a tool for vSAN8 support to convert existing VMDK files with monolithic-flat format. They are easy to use and provide functions necessary to connect and interact with vSphere. 

Environment

Citrix is not responsible for and does not endorse or accept any responsibility for the contents or your use of these third party Web sites. Citrix is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement by Citrix of the linked Web site. It is your responsibility to take precautions to ensure that whatever Web site you use is free of viruses or other harmful items.

Additional Information

Introducing support for machine creation in a VMware vSAN 8 environment - Citrix Blogs

https://github.com/citrix/citrix-mcs-sdk-samples/tree/main/VMware/SampleAdminScenarios/vSan%20VMDK%20Migration