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:

The Image Management feature is currently in Tech Preview. You can sign up for the Tech Preview here.

 

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 to the Tech Preview:

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

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: A base disk of the Master VM in VHD format is not supported. It has to be in VHDX format.


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 vSphere

Create a Prepared Image/an Image Definition

A new node in WebStudio named Images enables you to create and manage Prepared Images:

ws-images.png

ws-images-teaser.png

ws-images-create.png

ws-images-create-1.png

ws-images-create-2.png

NOTE:

These Image Definition settings cannot be changed later or in later versions.
If you need another OS type or Session type, you need to create a whole new Image Definition!

 

ws-images-create-3.png

ws-images-create-3a.png

CAUTION:

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

 

ws-images-create-3b.png

ws-images-create-3c.png

ws-images-create-4.png

ws-images-create-5.png

ws-images-create-6.png

ws-images-create-prog1.png

ws-images-create-7-ready-detail1.png

ws-images-create-7-ready-detail2.png

ws-images-create-7-ready-detail3.png

Create a new Image Version

IMPORTANT:

The hosting unit of all Image Versions of an Image Definition must be the same.

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.

To create image versions from the initial Image Version, follow these steps:

ws-create-new-version-1.png

ws-create-new-version-2.png

 

ws-create-new-version-3.png

ws-create-new-version-4.png

 

ws-create-new-version-5.png

ws-create-new-version-6.png

ws-create-new-version-7.png

ws-create-new-version-8.png

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: 

mcs-mc-1.png

mcs-mc-2.png

 

mcs-mc-3.png

IMPORTANT:

The Machine type must be the same as the Session type used in the Image Definition.

mcs-mc-4.png

mcs-mc-5.png

mcs-mc-6.png

mcs-mc-7.png

 

mcs-mc-8.png

 

mcs-mc-9.png

mcs-mc-10.png

mcs-mc-11.png

 

mcs-mc-12.png

 

mcs-mc-13.png

 

mcs-mc-ready1.png

 

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 MCS-based Machine Catalog on Microsoft Azure

Create a Prepared Image/an Image Definition

Creating a Prepared Image/an Image Definition in an Azure-based environment differs slightly from the on-prem workflow because the Azure backend requires a different configuration.
 

IMPORTANT:

Before starting the creation process, you need a Resource Location on Azure accessible from Citrix Cloud. Please ensure the Resource Location's cloud connectors are up and running.

 

IMPORTANT:

We will only show the differing steps between creating on-premise Image Definitions and Azure-based Image Definitions.

 

azure-create-image-definition-2.png

azure-create-image-definition-5.png

azure-create-image-definition-6.png

azure-create-image-definition-7.png

azure-create-image-definition-9.png

azure-create-image-definition-10.png

IMPORTANT:

Hibernation on an Azure-based Image Definition is currently not supported!

 

azure-create-image-definition-11.png

azure-create-image-definition-12.png

azure-create-image-definition-13.png

IMPORTANT:

Multiple NICs on an Azure-based Image Definition are currently not supported!

 

azure-create-image-definition-14.png

 

azure-create-image-definition-15.png

azure-create-image-definition-16.png

azure-create-image-definition-finished.png

All other steps, like creating a Machine Catalog based on the Azure Image Definition/Image Version, creating a new Image Version, and changing the Image Version of an existing Machine Catalog, are done in the same ways as the on-premise-based workflows but of the Azure-specific configurations seen in the previous step.
 

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