Overview
Citrix Machine Creation Services (MCS) has seen many advancements since its inception in XenDesktop 5.0, and the team continues to innovate within Citrix Virtual Apps and Desktops product line.
With the Image Management functionality, MCS separates the mastering phase from the overall provisioning workflow.
You can prepare various MCS-Image versions (aka Prepared Images) from a single Master image and use it across multiple, different MCS-based Machine Catalogs, bringing both version management and logical grouping to Citrix MCS.
This implementation significantly reduces the storage cost, the needed deployment time, and the administrative burden for VM deployment and image updating.
The benefits of using Image Management are:
- Generate prepared images in advance without creating a Machine Catalog.
- Reuse prepared images in multiple scenarios, such as creating and updating a Machine Catalog.
- Significantly reduce the time needed to create or update a Machine Catalog.
- Sharing a managed Image between different Hosting Connection Resource Pools/Hosting Units
NOTE:
This feature is currently applicable only to Azure and VMware virtualization environments.
You can still create an MCS-based Machine Catalog without using Prepared Images - you cannot get the benefits of Image Management after creation.
Requirements
- For Windows Master Images, a VDA with version 2311 or later and the Machine Creation Service (MCS) Storage Optimization feature enabled are supported.
- You need to use Citrix WebStudio version 2402 or later.
Limitations
The following limitations apply:
- Persistent data disks in Machine Catalogs using Image Management are not supported.
- The Backup VM configuration feature and Confidential VMs are not supported.
- Multiple NICs in Azure-based VMs are not supported.
- Hibernation for Multi-Session-typed VMs is not supported.
- VHD- and VHDX-based Master Disks on Azure are not supported. The Master Image in Azure must be a snapshot, a managed disk, or an Azure Compute Gallery Image.
CAUTION:
The Master Image cannot be deleted after preparing an Image if an Image Version based on it is needed!
Use cases
The benefits of using Image Management and Prepared Images include:
- Centralize Management: Manage all Images in one place using the Image node in Citrix Webstudio.
- Share Easily: Share prepared Images with multiple Machine Catalogs.
- Deploy Quickly: Prepare Images ahead of time for faster catalog provisioning.
- Save Costs: Save time and storage costs.
- Control Versions: Continuously update and manage the Image versions.
- Reduce Upgrade Risks: Use canary Image rollout for safer upgrades and fast rollbacks.
- Version Management: Manage different iterations or updates of a Master Image and maintain multiple versions for other purposes.
- Logical Grouping: Logically group Image versions based on various criteria such as project, department, or application and desktop type
- Sharing a managed Image between different Hosting Connection Resource Pools/Hosting Units
Image Management Components
Prepared Images
This new technology decouples the mastering phase from the Machine Catalog creation process or update workflow. It enables administrators to generate published Images from source Master Images without relying on Machine Catalog creation or updates.
This functionality empowers admins to produce numerous published Images from a single Source Image and manage them accordingly.
Additionally, you can use Citrix Studio to streamline administrator tasks, facilitating image browsing, property viewing, and action-taking.
Image Definitions
Image definitions are a logical grouping of versions of an Image.
An Image Definition holds information about:
- The used Operating System.
- Support for Single- or Multi-Session Machine types.
Image Version
Image Versions manage the versions of the Image Definitions.
An Image Definition can have multiple Image Versions.
Over time, somebody can apply updates, patches, or improvements to the Images.
You can use the same Image Version to provision multiple Machine Catalogs while easily tracking the associations.
Master Image
When creating an Image Version, you choose the Master Image for this version.
NOTE:
Important for vSphere-based environments: You can use only existing snapshots of a Master VM - you cannot use the VM's base disk.
NOTE:
Important for Azure-based environments: VHD- and VHDX-based Master Disks on Azure are not supported. The Master Image in Azure must be a snapshot, a managed disk, or an Azure Compute Gallery Image.
Machine Profiles
When creating an Image version, you can also choose a Machine Profile - the Image Version can inherit the settings from e.g. a chosen vSphere Machine Profile like:
- Tags placed on the template
- Custom attributes
- vSAN Storage Policies
- Virtual Hardware versions
- vSphere Virtual TPMs (vTPMs)
- CPU counts and Cores per socket
-
NIC counts
Machine Specification
You can change some settings of the inherited Master Image/Machine Profile properties.
For Azure:
You can select a VM size. If you select a Machine Profile on the Image page, the wizard selects the VM size of the Machine Profile by default.
The CMEK setting can also be modified.
For vSphere:
If you select a Machine Profile, you can see the Virtual CPU count derived from the machine profile, which is unchangeable.
If you do not select a Machine Profile, you can only see and alter the memory size derived from the Master Image.
NICs
You can select or add NICs to prepare the Image.
For each NIC, select an associated Virtual Network.
For vSphere:
If you did not select a Machine Profile, then the NIC associated with the master image is selected by default.
If you select a Machine Profile, the NICs are derived from the Machine Profile, and the NIC count is unchangeable.
For Azure:
Multiple NICS are NOT SUPPORTED in Azure!
Disk Settings
This page is only applicable to Azure-based environments.
You can select the customer-managed encryption key (CMEK). If the Machine Profile doesn’t have a CMEK but the Master Image has, it pre-selects the CMEK from the Master Image.
Create an MCS-based Machine Catalog on Microsoft Azure (Example)
Create different Hosting Connection Resource Pools/Hosting Units in a Hosting Connection
If you create different Hosting Connection Pools/Hosting Units using the same Hosting Connection, you can distribute the Resources, e.g., between different Azure locations.
That enables you to share the Managed Image automatically between these Hosting Units or, e.g., between the different Azure Locations.
In this example, we have configured different Hosting Connection Resource Pools/Hosting Units in 2 different Azure locations - one in EastUS, and one in WestEurope:
Create a Prepared Image/an Image Definition
-
A new node in WebStudio named Images enables you to create and manage Prepared Images. Click on “Create Image Definition” to start creating a Prepared Image.
-
A Pop-Up shows you an Overview of the process ahead.
-
Choose the OS type and Session type suitable to your needs.
NOTE:
These Image Definition settings cannot be changed later or in later versions.
If you need another OS type or Session type, you must create a whole new Image Definition!
-
Choose the Hosting Connection and the adjacent Hosting Connection Resource Pool/Hosting Unit.
-
Choose if a new Resource Group should be created or choose an existing Resource Group where the Image should be deployed:
-
Choose if the wizard should create a new Azure Compute Gallery or if you want to use an existing Compute Gallery.
The Image Definition and its versions will be stored in the chosen Compute Gallery and enable the sharing of the Managed Image between the different Hosting Connection Resource Pools/Hosting Units:
If you choose to create a new Azure Compute Gallery, the wizard will create it and store the Image Definition and all its adjacent versions in it:
-
Choose the Resources and Master Image you want to include. Choose the Resource where the shared Image is available and which is most suitable to your needs.
CAUTION:
The Virtual Machine containing the snapshot must NOT be running to ensure a smooth creation of the following steps!
-
You can select a Machine Profile if needed (see explanations earlier in this guide).
-
Choose the Storage and License Types according to your needs:
-
You can change some settings for the image version using the Machine specifications:
-
Choose the NIC settings according to your needs:
-
Choose the Disk Settings according to your needs:
-
You can enter a description to pin detailed information about this version of the Image Definition.
-
Now, the Image Definition is created. Depending on the underlying system, it takes a few minutes:
-
The Image Definition, together with the first Image Version, is successfully created:
Sharing the Image
After successfully creating the Image Definition, you can share the Image between all Hosting Connection Resource Pools/Hosting Units adjacent to the chosen Hosting Connection.
IMPORTANT:
If you created the Image Definition/Image Versions in the Tech Preview stage, you cannot share the Managed Image - the adjacent "Manage Image Share" button is greyed out.
If you created the Image Definition recently, the "Manage Image Share" button is available:
Click on the "Manage Image Share" button to check the status - in this example screenshot, you see, that the Image is currently not shared between all available Hosting Connection Resource Pools/Hosting Units adjacent to the Hosting Connection:
Choose the available Hosting Connection Resource Pools/Hosting Units adjacent to the Hosting Connection to enable Image sharing:
The wizard is now automatically updating all needed entities to enable Image sharing:
After some time, Image sharing is enabled:
You can now deploy the shared Image while creating the Machine Catalog.
Create a new Image Version
IMPORTANT:
You can change the Hosting Connection Resource Pool/Hosting Unit of the new version adjacent to your needs.
If you want the Image Version configured differently from the initial configuration, configure the applicable settings on the Image, Storage, and License Types, Machine Specification, NICs, and Disk Settings pages of the Create Image Version dialog.
IMPORTANT:
These settings are Hypervisor-/Hyperscaler-dependent! Please be aware that not all settings are available for each Hypervisor/Hyperscaler!
To create a new Image Version, follow these steps:
-
Click “Create Image Version” to generate a new version.
-
The wizard now lists all possible Hosting Connection Resource Pool/Hosting Units. Choose a Hosting Connection Resource Pool/Hosting Unit for the new version that is adjacent to your needs:
-
Choose the Master Image disk/snapshot that applies to this new version. See explanations earlier in this guide.
-
Choose the Machine Profile.
-
Choose the Storage and License Types according to our needs:
-
Alter the Machine Specification if necessary:
-
Alter the NICs settings if necessary::
-
Alter the Disk Settings if necessary:
-
Enter a description if needed:
-
Depending on the underlying system, it takes a few minutes to create. The creation is complete. The new Image Version is shown in the Image Definition tab:
Create an MCS-based Machine Catalog based on an Image Definition
After creating an Image Definition and an Image Version we can now create a MCS-based Machine Catalog.
You will notice that creating a Machine Catalog based on a Managed Image is far quicker than creating a Machine Catalog based on an unmanaged Image:
The steps of creating a Machine Catalog based on a Managed Image are very similar to creating a “normal” Machine Catalog:
IMPORTANT:
You cannot change the Machine type. It is determined by the Image Definition.
-
Choose the Machine Management type. As this is a Shared Image, you can choose the Host Connection Resource Pool/Hosting Unit in the Resource drop-down field:
If you create a Machine Catalog based on a non-Shared Image, you will NOT be able to choose the Host Connection Resource Pool/Hosting Unit in the Resource drop-down field:
-
Choose the Desktop Experience:
-
The Image is already determined, you can alter the Machine Profile according to your needs and select the correct Functional level of the MC:
-
Select the correct Storage and License type according to your needs:
-
Select the number of VMs and the settings that are needed further. Complete the MCS wizard.
-
Creation complete. The Machine Catalog is now ready for use
.
Update an existing MCS-based Machine Catalog with a new Image Definition/Image Version
After creating a Machine Catalog, you can change the Image Definition/Image Version to another Image Version.
IMPORTANT:
Deleting an Image Definition is only possible if no Image Version exists.
Deleting an Image Version is only possible if no Machine Catalog uses it.
IMPORTANT:
You cannot change the Image Type.
Updating an existing Machine Catalog is a straightforward process:
The current version of the used Image contains LibreOffice.
Let´s assume we want to change LibreOffice to Office 365, so we must change the Image Version.
- The current Image Version has LibreOffice installed.
- Choose the Prepared Image containing Office 365.
- Choose the rollout strategy you want to use to deploy the new Image Version.
- Changing the Image Version is complete.
-
The Machine Catalog is now running on an Image Version containing Office 365.
All VMs got the new version.
Create an Image Definition and an MCS-based Machine Catalog on vSphere
In this part of the guide, we will explore using PowerShell to automate the creation of a new Image Definition and a new MCS-based Machine Catalog based on this Image Definition.
The underlying infrastructure is vSphere.
NOTE:
We will only mention the differences in Powershell cmdlets for an Azure-based infrastructure—a complete walkthrough is not yet provided.
Create a Prepared Image/an Image Definition using PowerShell
Before creating the Image Definition/Image Version, we need to get more details about the environment - like the name of the Hosting Unit, the name of the Network to use, and the snapshot we want to use.
We can retrieve these properties using PowerShell.
Run the following cmdlets on one of the Delivery Controllers:
PS C:\_TACG> Add-PSSnapin Citrix.*
PS C:\_TACG> Get-ChildItem XDHyp:\Hostingunits
Write down the values of HostingUnitName and NetworkPath or save these in variables for later use.
#Load the Citrix Powershell Snap-In
#Get all HostingUnits registered
PSPath : Citrix.Host.Admin.V2\Citrix.Hypervisor::XDHyp:\Hostingunits\VMN PS C:\_TACG> |
Now that we have the HostingUnitName and the NetworkPath, we need to determine the path of the snapshot we want to use.
Make sure you use the correct HostingUnitName in the -LiteralPath setting of the cmdlet:
PS C:\_TACG> Get-HypInventoryItem -LiteralPath "XDHyp:\HostingUnits\VMN" -ResourceType snapshot -MaxRecords 100 | Select-Object FullPath | Format-Table -AutoSize
#Get all available snapshots
PS C:\_TACG> |
IMPORTANT:
You need to alter the format or the full path for the following steps to work:
The original path looks like this:
XDHyp:\HostingUnits\VMN\TACG.datacenter\10.10.110.12.computeresource\TACG-VSP-W11-M.vm\main.snapshot\mit libreoffice.snapshot\with office.snapshot\nach office.snapshot
Remove the references to the Datacenter- and Host-name, so the usable path must look like this:
XDHyp:\HostingUnits\VMN\TACG-VSP-W11-M.vm\main.snapshot\mit libreoffice.snapshot\with office.snapshot\nach office.snapshot
Write down the values of the full path of the snapshot you want to use or save it in a variable for later use.
All prerequisite variables are available now, so we can start the creation of the Image Definition/Image Version:
#Check if the desired name is available
PS C:\_TACG> Test-ProvImageDefinitionNameAvailable -ImageDefinitionName "PoSH-ImgDef-Test"
Name Available
---- ---------
PoSH-ImgDef-Test True
PS C:\_TACG>
This cmdlet checks if the desired name for the Image Definition is available:
#Check if the desired name is available
Name Available
PS C:\_TACG> |
As the name is available, we can continue.
# Create Image Definition
PS C:\_TACG> $ImageDefinition = New-ProvImageDefinition -ImageDefinitionName "PoSH-ImgDef-Test" -OsType Windows -VdaSessionSupport SingleSession
PS C:\_TACG> $ImageDefinition
CreationTime : 31.05.2024 10:20:56
Description :
ImageDefinitionName : PowerShell-ImgDef-Test
ImageDefinitionUid : ad362330-98af-4f1f-a662-5eb12f7388ff
LatestVersion : 0
Metadata : {}
OsType : Windows
VDASessionSupport : SingleSession
VersionsCount : 0
# Create Image Definition
PS C:\_TACG> $ImageDefinition
PS C:\_TACG> |
The Image Definition was successful. Now we can create the Image Version:
#Create Image Version
PS C:\_TACG> $ImageVersion = New-ProvImageVersion -ImageDefinitionName $ImageDefinition.ImageDefinitionName -Description "V1"
PS C:\_TACG> $ImageVersion
CreationTime : 31.05.2024 10:41:14
Description : V1
ImageDefinitionName : PoSH-ImgDef-Test
ImageDefinitionUid : 310ea5ff-910e-472b-b1f6-29ee948853bf
ImageVersionNumber : 1
ImageVersionSpecsCount : 0
ImageVersionUid : c25b2662-2c3a-474e-a116-d98d27f1321f
Metadata : {}
PS C:\_TACG>
#Create Image Version PS C:\_TACG> $ImageVersion
CreationTime : 31.05.2024 10:41:14 PS C:\_TACG> |
We created the Image Version, and now we can set the needed properties:
#Set the properties for the Image Version
PS C:\_TACG> $MasterImageVersionSpec = Add-ProvImageVersionSpec -ImageDefinitionName $ImageVersion.ImageDefinitionName -ImageVersionNumber $ImageVersion.ImageVersionNumber -HostingUnitName VMN -MasterImagePath $MasterImagePath
PS C:\_TACG> $MasterImageVersionSpec
Context : {"PluginFactoryName":"VmwareFactory"}
CreationTime : 31.05.2024 10:47:42
DiskSize : 60
Error :
HostingUnitName : VMN
HostingUnitUid : 5f09bb65-3ce5-4f68-aab4-bcc8503519ff
ImageDefinitionName : PoSH-ImgDef-Test
ImageDefinitionUid : 310ea5ff-910e-472b-b1f6-29ee948853bf
ImageInstances : {}
ImageRuntimeEnvironment :
ImageVersionNumber : 1
ImageVersionSpecStatus : Success
ImageVersionSpecUid : 9eef9112-e2a1-444f-88b0-b31d64cafe7d
ImageVersionUid : c25b2662-2c3a-474e-a116-d98d27f1321f
ImportType : Customer
IsCitrixManaged : False
IsPrepared : False
MasterImagePath : /TACG.datacenter/10.10.110.12.computeresource/TACG-VSP-W11-M.vm/main.snapshot/mit libreoffice.snapshot/with office.snapshot/nach office.snapshot
Metadata : {}
PreparationType : None
ProvisioningSchemeCount : 0
SourceImageVersionSpecUid :
Warnings : {}
ZoneUid : d9bdd2c6-52de-41ff-839f-298258e4c862
PS C:\_TACG>
#Set the properties for the Image Version PS C:\_TACG> $MasterImageVersionSpec
Context : {"PluginFactoryName":"VmwareFactory"} PS C:\_TACG> |
All properties are set - we can start with the creation of the configured Image Version:
#Create the task to generate the Image Version asynchronously
#Be aware that the network mapping path is in the proper format – look at the corresponding HostingUnit property and change it into the correct format
PS C:\_TACG> $Task = New-ProvImageVersionSpec -SourceImageVersionSpecUid $MasterImageVersionSpec.ImageVersionSpecUid -NetworkMapping @{"0"="XDHyp:\HostingUnits\VMN\VM Network.network"} -VMCpuCount 2 -VMMemoryMB 4096 -RunAsynchronously
PS C:\_TACG> $Task
Guid
----
86a7d87e-ab44-4786-a059-27c2040fabb1
#Create the task to generate the Image Version asynchronously PS C:\_TACG> $Task = New-ProvImageVersionSpec -SourceImageVersionSpecUid $MasterImageVersionSpec.ImageVersionSpecUid -NetworkMapping @{"0"="XDHyp:\HostingUnits\VMN\VM Network.network"} -VMCpuCount 2 -VMMemoryMB 4096 -RunAsynchronously
PS C:\_TACG> $Task |
As the task is running asynchronously, we need to use a cmdlet to see the progress:
PS C:\_TACG> Get-ProvTask -TaskId 86a7d87e-ab44-4786-a059-27c2040fabb1
Here is the output of a still-running task - the TaskProgress property shows the percentage of completeness:
PS C:\_TACG> Get-ProvTask -TaskId 86a7d87e-ab44-4786-a059-27c2040fabb1
PS C:\_TACG> |
Here is the output of a successfully finished task:
PS C:\_TACG> Get-ProvTask -TaskId 86a7d87e-ab44-4786-a059-27c2040fabb1
|
We can now see the created Image Definition/Image Version in Web Studio:
Differences in the Cmdlets between vSphere and Azure:
Here are the example cmdlets for vSphere:
Test-ProvImageDefinitionNameAvailable -ImageDefinitionName "NameOfImageDefinition"
$ImageDefinition = New-ProvImageDefinition -ImageDefinitionName "NameOfImageDefinition" -OsType Windows -VdaSessionSupport SingleSession
$ImageVersion = New-ProvImageVersion -ImageDefinitionName $ImageDefinition.ImageDefinitionName -Description "VersionNumber"
$MasterImagePath = "XDHyp:\HostingUnits\HostingUnitName\VMName.vm\SnapshotName.snapshot"
$MasterImageVersionSpec = Add-ProvImageVersionSpec -ImageDefinitionName $ImageVersion.ImageDefinitionName -ImageVersionNumber $ImageVersion.ImageVersionNumber -HostingUnitName HostingUnitName -MasterImagePath $MasterImagePath
$Task = New-ProvImageVersionSpec -SourceImageVersionSpecUid $MasterImageVersionSpec.ImageVersionSpecUid -NetworkMapping @{"0"="XDHyp:\HostingUnits\HostingUnitName\VMNetworkName.network"} -VMCpuCount 2 -VMMemoryMB 4096 -RunAsynchronously
Here are the example cmdlets for Azure:
Test-ProvImageDefinitionNameAvailable -ImageDefinitionName "NameOfImageDefinition"
$ImageDefinition = New-ProvImageDefinition -ImageDefinitionName "NameOfImageDefinition" -OsType Windows -VdaSessionSupport MultiSession
$ImageVersion = New-ProvImageVersion -ImageDefinitionName $ImageDefintion.ImageDefinitionName -Description "VersionNumber"
$MasterImagePath = "XDHyp:\HostingUnits\AzureHostingUniteName\ImageName.folder\AzureResourceGroupName.resourcegroup\SnapshotName.snapshot"
$MasterImageVersionSpec = Add-ProvImageVersionSpec -ImageDefinitionName $ImageVersion.ImageDefinitionName -ImageVersionNumber $ImageVersion.ImageVersionNumber -HostingUnitName AzureHostingUnitName -MasterImagePath $MasterImagePath
$Task = New-ProvImageVersionSpec -SourceImageVersionSpecUid $MasterImageVersionSpec.ImageVersionSpecUid -NetworkMapping @{"0"="XDHyp:\HostingUnits\AzureHostingUnitName \virtualprivatecloud.folder\AzureResourceGroupName.resourcegroup\NetworkName.virtualprivatecloud\NetworkName.network"} -ServiceOffering "XDHyp:\HostingUnits\AzureHostingUnitName\serviceoffering.folder\MachineSize.serviceoffering" -CustomProperties "<CustomProperties xmlns=`"http://schemas.citrix.com/2014/xd/machinecreation`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`"></CustomProperties>" -RunAsynchronously
Create an MCS-based Machine Catalog on vSphere with the Image Management feature enabled using PowerShell
The difference between creating a “normal” MCS-based Machine Catalog and an MCS-based Machine Catalog based on a Managed Image is to reference the Managed Image in the New-ProvScheme cmdlet.
“Normal” Machine Catalog:
New-ProvScheme -HostingUnitName Name -IdentityPoolName Name -MasterImageVM 'XDHyp:\HostingUnits\PathToMasterImage'
-ProvisioningSchemeName Name -Scope @() -NetworkMapping @{"0"="XDHyp:\HostingUnits\NetworkPathAndName.network"} -RunAsynchronously
Machine Catalog with Managed Image:
$PreparedImageVersionSpec = Get-ProvImageVersionSpec -ImageDefinitionName image2 -ImageVersionNumber 1
New-ProvScheme -ProvisioningSchemeName Name -ImageVersionSpecUid $PreparedImageVersionSpec.ImageVersionSpecUid -HostingUnitName Name -IdentityPoolName Name -CleanOnBoot -Scope @() -SecurityGroup @() -NetworkMapping @{"0"="XDHyp:\HostingUnits\NetworkPathAndName.network"} -VMCpuCount 2 -VMMemoryMB 4096 -RunAsynchronously
For a complete guide to creating Machine Catalogs using PowerShell, please look at https://community.citrix.com/tech-zone/build/deployment-guides/citrix-azure-hibernation-posh/. You can find all the needed cmdlets and workflows there.
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now