May 062020

I recently ran into having to create a chunk of MCS dedicated machines for this COVID-19 situation the world is in. MCS Dedicated machines are very different from MCS Pool machines. One of the HUGE differences is updating the machine’s images and updating the targets. As your aware MCS Pooled is very similar to PVS and it’s a nice update feature for the PVS/MCS targets. But MSC dedicated machines are not the same. 

This Blog is around MCS Dedicated Full Clones only and updating the Master image to update only new created machines.

Dedicated desktops are assigned to individual users and the data and settings will persist on the desktops. Optionally, the Citrix Profile Management solution can be used to store the user profile and data on central file servers. For dedicated desktops there is a new option available under Desktop OS Catalogs virtual machine copy mode, “Use full copy for better data recovery and migration support, with potentially reduced IOPS after the machines are created”.

“When you deploy the image, you will notice that MCS will do a full VMDK copy of your snapshot chain into a folder of every datastore that is defined in your hosted XenDesktop environment. This makes desktop creations extremely quick when scaling out additional VMs because it 1) negates the need to potentially copy VMDKs across datastores during desktop creation and 2) negates the need to consolidate snapshots during creation. The folder will typically be the machine catalog name + basedisk + random datastore identifier assigned by XenDesktop. This applies to all MCS images; static and pooled.”

You can see the base Snapshot MCS created called Citrix_XD_Name. This is the initial snapshot Studio-MCS makes. But ideally can keep them all around. So my steps are as outline below

Deleting all Snapshots. (Deleted All Yes) I didn’t want any old stuff floating around.

Create new snapshot

Now I’ll update all tools, software and whatever I need to update.

Let check the Provision Scheme so I can get the Provisioning Scheme and the XDhyp information and display the list of snapshots on the virtual machine:

I copied it from PowerShell and put it in OneNote so I could see what I was looking for. As you can see here it still shows my old snapshots. We will update that.

Note to find the ProvisiongSchemeName   (Its list in the Get-ProveSheme) Command. Keep this name for later

  1. Now at this time, I need to run this

a. Get-ChildItem -Recurse -Path ‘XDHyp:\hostingunits\%hostName%\%vmName%.vm’

b. This will list the Snapshot that is associated with the VM itself

c. For me it’s this:

d. get-childitem -Recurse -Path “XDHyp:\HostingUnits\XA_XD Netwrk Connection VS1VC01_PROD_176\XD7MSTRHR.vm”

  1. Then my output is

*Note* you can see that it shows my snapshot listed

  1. I need to take the “Full Path” and note it for the next command.
  1. Second command is:
  1. Publish-ProvMasterVmImage -ProvisioningSchemeName “%provisioningSchemeName%” -MasterImageVM “%templatePSPath%”
  2. For me Its:
  3. Publish-ProvMasterVmImage -ProvisioningSchemeName “Citrix Human Resources Desktop” –masterimagevm “XDHyp:\HostigUnits\XA_XD Netwrk Connection VS1VC01_PROD_176\XD7MSTRHR.vm\ImageUpdate.snapshot”

While this is running in my Hypervisor you will see this.

Once it’s completed you will see

Now Run Get-ProvScheme

These updates will only apply to new machines created from the MCS full Clones. It will not update previously created ones. That is the downfall of MCS Dedicated full clones. 


Dec 202017

In my environment I have nearly 100 persistent MCS VDAs. Our developers, contractors, and even us IT people need the ability to change things on our VDI desktops (install/uninstall/set registry/create local IIS sites/etc.) and have them persist reboots. Luckily, the only software I have to maintain on these desktops is the VDA itself. That still means when Citrix releases a new version that I want to move to, I have to upgrade almost 100 individual desktops. The last time I had to do this I wanted to rip my hair out, and decided to write a script to automate the task. It has saved me TONS of time, so I want to share it in hopes that it can save someone else some time (and hair).

I wrote the script specifically for my MCS environment, which runs on XenServer, but with a little tweaking it can be modified for any environment.

How it works (the short version):

  1. Gets the computer(s) you set – can be manual input or a delivery controller query
  2. On each computer it will create 2 scripts, and 2 scheduled tasks
    1. The first script loads auto logon info into the registry
    2. The second script handles the vda removal and install
  3. One scheduled task runs once to run the first script and reboot
  4. The second scheduled task runs the second script at logon (first script sets up a user – in my case the local administrator – to logon automatically)

Most things are explained in the script, and this time I’ve also created a youtube video to go through it all/show it in action.