Find master image used by machine catalog and Update master image steps

Website Visitors:

Find Master image:

We don’t have the option to view the master image used by machine catalog in citrix studio directly. We need to go through powershell to view the master image details. Here is the command:

**Add-PSSnapin citrix* ** - to load citrix commands

Get-ProvScheme  - to see the provisioning scheme for all the machine catalogs

Get-ProvScheme -ProvisioningSchemeName “Machine catalog name” - to see provisioning scheme for one particular machine catalog.

 Update Master image:

This is the scenario where we have static machines provisioned from a master image.

While creating machine catalog, if we point to a virtual machine, xendesktop automatically creates a snapshot of that virtual machine and use that snapshot to provision new VDIs in that machine catalog.

Before we get started, read the following info about Publish-ProvMasterVmImage command:

Provides the ability to update the hard disk image used to provision virtual machines. If the provisioning scheme is a ‘CleanOnBoot’ type, then the next time that virtual machines are started, their hard disks are updated to this new image. Regardless of the ‘CleanOnBoot’ type, all new virtual machines created after this command will use this new hard disk image.

A background task will be created to remove the old hard disk copies. You can locate and monitor this task using the Get-ProvTask cmdlet.

A snapshot is used rather than a VM, so that the content of the hard disk for the provisioning scheme can be easily determined.

As the snapshot is specified using a path into the Citrix Host Service Powershell Provider, the Citrix Host Service Powershell snap-in must also be loaded for this cmdlet to be used.

The previous hard disk image path is stored into the history (see Get-provSchemeMasterVMImageHistory). The data stored in the history allows for a roll back to be undertaken, to revert to the previous hard disk image if required.

Steps to update master image:

For some reason, if we need to update that master image ie., for windows updates or for any software install or uninstall from that image, follow the below process:

  1. login to your master image virtual machine and update it and shutdown.
  2. Create a snapshot of that virtual machine
  3. In your xendesktop server, open powershell and load citrix snapins.
  4. Get-ProvScheme -ProvisioningSchemeName “Machine catalog name” use this command to see the existing master image for your machine catalog.  Make a note of the parameter value, MasterImageVM.  Ex, masterimagevm parameter has XDHyp:\HostingUnits\Folder1\SOMENAME.vm\XXX.snapshot\XXX.snapshot.
  5. Now Use CD command in powershell to go to XDHyp:\HostingUnits\Folder1\SOMENAME.vm\
  6. Type ls command to see all the snapshots in this folder. You should see your new snapshot here.
  7. Use below command to point your machine catalog to this new snapshot: Publish-ProvMasterVmImage -ProvisioningSchemeName win7ded_anu –masterimagevm XDHyp:\hostingunits\anu\Anu-Win7.vm\existing.snapshot\Citrix_XD_win7- pooled.snapshot\Citrix_XD_win7-pooled.snapshot\sp1.snapshot\2505438.snapshot\afterupdate.snapshot where win7ded_anu is the machine catalog name and -masterimagevm is the path to your new snapshot. (OR) In the same powershell console, use cd XDHyp:\hostingunits\ and cd XXXX.vm, and go till you see your new snapshot and type Publish-ProvMasterVmImage -ProvisioningSchemeName win7ded_anu –masterimagevm .\afterupdate.snapshot . Note: You are now in XDHyp:\hostingunits\anu\Anu-Win7.vm\existing.snapshot\Citrix_XD_win7- pooled.snapshot\Citrix_XD_win7-pooled.snapshot\sp1.snapshot\2505438.snapshot folder.
  8. Provision a machine from that machine catalog and check.

More information about updating machine catalog is given here:

IMP Point: Make sure if cleanonboot option is set to false. If not, all the machines will get the updates from master image and all the users applications will be gone.

More info about publish-provmastervmimage:

To see what is default network vlan and configured storage settings for a storage unit, use the command, dir xdhyp:\hostingunits. If you have storage unit name as vlan01 then use Get-ChildItem | ? {$_.HostingUnitName -eq “vlan01”} to see the settings for that storage unit, which contains default vlan and storage for that storage unit. For whatever machine catalog is this storage unit attached, it uses the vlan and storage configured in it and creates vms in that particular vlan and storage.

Want to learn more on Citrix Automations and solutions???

Subscribe to get our latest content by email.

If you like our content, please support us by sponsoring on GitHub below: