Jump to content

Image Management - A new way of deploying Machine Catalogs and reducing Master Image Complexity

  • Contributed By: Gerhard Krenn Special Thanks To: Fenfen Hu, Fenghua Jie, Hao Rong

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.

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. 

 

MCSIO.png

webstudio-version.png

 

Limitations

The following limitations apply:

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

schema-prepared-image-overview.png
 

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:


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:

Machine Specification

You can change some settings of the inherited Master Image/Machine Profile properties.

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:

hc.png
 

Create a Prepared Image/an Image Definition

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!

 

  1. Choose the Hosting Connection and the adjacent Hosting Connection Resource Pool/Hosting Unit.
    imgdef-2.png

 

 

CAUTION:

The Virtual Machine containing the snapshot must NOT be running to ensure a smooth creation of the following steps!
 

 

 

 

 

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.
 

imgmgmt-noshare.png
 

If you created the Image Definition recently, the "Manage Image Share" button is available:
imgmgmt-shareok1.png
 

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:
imgdef-sharingnotconfigured.png

Choose the available Hosting Connection Resource Pools/Hosting Units adjacent to the Hosting Connection to enable Image sharing:
imgdef-managesharingboth.png


The wizard is now automatically updating all needed entities to enable Image sharing:
imgdef-update-to-2nd-hcpool.png


After some time, Image sharing is enabled:
imgdef-sharingcomplete.png


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:

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:

Example: Creation time using a Managed Image

mcs-mc-ready.png

 

Example: Creation time using an Unmanaged Image

mcs-mc-without-imagemgmt-ready.png

 

The steps of creating a Machine Catalog based on a Managed Image are very similar to creating a “normal” Machine Catalog: 

  1. Click “Create Machine Catalog” to start the wizard. Follow the instructions:
    mc-start.png

IMPORTANT:

You cannot change the Machine type. It is determined by the Image Definition.
 

 

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:

w11-img-libreoffice.png

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.

 

mcs-mc-change-image-1.png

mcs-mc-change-image-2.png

mcs-mc-change-image-3.png

 

mcs-mc-change-image-4.png

 

mcs-mc-change-image-5.png

mcs-mc-change-image-6.png

w11-img-office.png

ws-create-new-version-8.png

 

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
PS C:\_TACG> Add-PSSnapin Citrix.*

#Get all HostingUnits registered
PS C:\_TACG> Get-ChildItem XDHyp:\Hostingunits

PSPath                 : Citrix.Host.Admin.V2\Citrix.Hypervisor::XDHyp:\Hostingunits\VMN
PSParentPath           : Citrix.Host.Admin.V2\Citrix.Hypervisor::XDHyp:\Hostingunits
PSChildName            : VMN
PSDrive                : XDHyp
PSProvider             : Citrix.Host.Admin.V2\Citrix.Hypervisor
PSIsContainer          : True
HostingUnitName        : VMN
HostingUnitUid         : 5f09bb65-3ce5-4f68-aab4-bcc8503519ff
HypervisorConnection   : vcenter tacg
Metadata               : {}
MetadataMap            : {}
NetworkId              : Network:network-12
NetworkPath            : XDHyp:\Connections\vcenter tacg\TACG.datacenter\10.10.110.12.computeresource\VM Network.network
PermittedNetworks      : {XDHyp:\Connections\vcenter tacg\TACG.datacenter\10.10.110.12.computeresource\VM Network.network}
RootId                 : domain-s5048
RootPath               : XDHyp:\Connections\vcenter tacg\TACG.datacenter\10.10.110.12.computeresource
Storage                : {XDHyp:\Connections\vcenter tacg\TACG.datacenter\10.10.110.12.computeresource\datastore1 (1).storage}
VMTaggingEnabled       : True
UseLocalStorageCaching : False
PersonalvDiskStorage   : {}
GpuType                : {}
AvailabilityZones      : {}
AdditionalStorage      : {TemporaryStorage}
CustomProperties       :
FullPath               : 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> Get-HypInventoryItem -LiteralPath "XDHyp:\HostingUnits\VMN" -ResourceType snapshot -MaxRecords 100 | Select-Object FullPath | Format-Table -AutoSize
FullPath
--------
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
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
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX
XDHyp:\HostingUnits\VMN\XXXXXXXXXXXXXXXXXXXX

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
PS C:\_TACG> Test-ProvImageDefinitionNameAvailable -ImageDefinitionName "PoSH-ImgDef-Test"

Name             Available
----             ---------
PoSH-ImgDef-Test      True

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 = New-ProvImageDefinition -ImageDefinitionName "PoSH-ImgDef-Test" -OsType Windows -VdaSessionSupport SingleSession

PS C:\_TACG> $ImageDefinition
CreationTime        : 31.05.2024 10:20:56
Description         :
ImageDefinitionName : PoSH-ImgDef-Test
ImageDefinitionUid  : ad362330-98af-4f1f-a662-5eb12f7388ff
LatestVersion       : 0
Metadata            : {}
OsType              : Windows
VDASessionSupport   : SingleSession
VersionsCount       : 0

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 = 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>

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 = 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>

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
#Be aware that the network mapping path is in the correct 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
PS C:\_TACG>

 

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
TaskId                    : 86a7d87e-ab44-4786-a059-27c2040fabb1
Active                    : True
Host                      : TACG-IPS-DDC
DateStarted               : 31.05.2024 10:51:32
Metadata                  : {}
ImageVersionSpecUid       : 4079e3ee-e1ec-4b1d-ba32-b373f11b6ed3
SourceImageVersionSpecUid : 9eef9112-e2a1-444f-88b0-b31d64cafe7d
ImageDefinitionName       : PoSH-ImgDef-Test
ImageDefinitionUid        : 310ea5ff-910e-472b-b1f6-29ee948853bf
ImageVersionNumber        : 1
ImageVersionUid           : c25b2662-2c3a-474e-a116-d98d27f1321f
MasterImage               : /TACG-VSP-W11-M.vm/main.snapshot/mit libreoffice.snapshot/with office.snapshot/nach office.snapshot
DiskSize                  : 60
MachineProfile            :
HostingUnitName           : VMN
HostingUnitUid            : 5f09bb65-3ce5-4f68-aab4-bcc8503519ff
PreparationType           : Mcs
CustomProperties          :
NetworkMaps               : {0}
ServiceOffering           :
CpuCount                  : 2
MemoryMB                  : 4096
Storage                   : {/TACG.datacenter/10.10.110.12.computeresource/datastore1 (1).storage}
Warnings                  :
TaskState                 : ConsolidatingMasterImage
TaskType                  : NewProvImageVersionSpec
LastUpdateTime            : 31.05.2024 10:51:32
CurrentOperation          : ConsolidatingMasterImage
TerminatingError          :
TaskProgress              : 17,1
WorkflowStatus            : Running
DateFinished              : 01.01.0001 01:00:00
TaskExpectedCompletion    :
ActiveElapsedTime         : 0
Status                    : Running
TaskStateInformation      : ConsolidatingMasterImage
Type                      : NewProvImageVersionSpec

PS C:\_TACG>
 

Here is the output of a successfully finished task:

PS C:\_TACG> Get-ProvTask -TaskId   86a7d87e-ab44-4786-a059-27c2040fabb1
TaskId                    : 86a7d87e-ab44-4786-a059-27c2040fabb1
Active                    : False
Host                      : TACG-IPS-DDC
DateStarted               : 31.05.2024 10:51:32
Metadata                  : {}
ImageVersionSpecUid       : 4079e3ee-e1ec-4b1d-ba32-b373f11b6ed3
SourceImageVersionSpecUid : 9eef9112-e2a1-444f-88b0-b31d64cafe7d
ImageDefinitionName       : PoSH-ImgDef-Test
ImageDefinitionUid        : 310ea5ff-910e-472b-b1f6-29ee948853bf
ImageVersionNumber        : 1
ImageVersionUid           : c25b2662-2c3a-474e-a116-d98d27f1321f
MasterImage               : /TACG-VSP-W11-M.vm/main.snapshot/mit libreoffice.snapshot/with office.snapshot/nach office.snapshot
DiskSize                  : 60
MachineProfile            :
HostingUnitName           : VMN
HostingUnitUid            : 5f09bb65-3ce5-4f68-aab4-bcc8503519ff
PreparationType           : Mcs
CustomProperties          :
NetworkMaps               : {0}
ServiceOffering           :
CpuCount                  : 2
MemoryMB                  : 4096
Storage                   : {/TACG.datacenter/10.10.110.12.computeresource/datastore1 (1).storage}
Warnings                  : {}
TaskState                 : Finished
TaskType                  : NewProvImageVersionSpec
LastUpdateTime            : 31.05.2024 11:02:46
CurrentOperation          :
TerminatingError          :
TaskProgress              : 100
WorkflowStatus            : Completed

DateFinished              : 31.05.2024 11:02:46
TaskExpectedCompletion    : 31.05.2024 11:02:46
ActiveElapsedTime         : 673
Status                    : Finished
TaskStateInformation      : Completed
Type                      : NewProvImageVersionSpec

PS C:\_TACG>

 

 

We can now see the created Image Definition/Image Version in Web Studio:

posh-create-finished.png

 

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.


User Feedback


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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...