Citrix MCS No_Host_Available

I’m currently working on a project where I’m migrating the customer’s users to a newly created Citrix Virtual Apps and Desktops (CVAD) environment based on Windows 2019 combined with Nvidia GPUs. This environment is based on Citrix Machine Creation Services (MCS). In the past, they decided to let their VMs run on local storage, which is a relatively normal choice in a small environment. Throughout the project, we needed to update the machine catalogs with a new version of the master image. Luckily this is all based on the code, so every image is recreated from scratch. But after every change, we needed to update the Machine Catalog using MCS. That’s usually not an issue if you use shared storage and have plenty of resources.

As you can guess, this isn’t the case with this customer. They have six hosts with GPUs and use local storage, as mentioned before. Within Citrix Studio, you create a Hosting Connection where you specify the storage used. As the customer uses local storage, you must select the local storage repository (SR) from all hosts.

Hosting Connection Citrix Studio

When you update a Machine Catalog with a new version of the master image (Snapshot) during the MCS process, it will start a preparation VM when the copy task is completed. This VM is based on the original VM (Snapshot, which is just uploaded), So Memory, GPU, and CPU, but the network is disconnected. This is when the problem starts. Because Citrix studio can’t look at the available resources within a Hosting Connection, it will start the preparation VM on the first available host within the Cluster or Pool. When this host has no resources available, you get the error NO_HOST_AVAILABLE.



Citrix cannot look at the resources available from the hosting connection mentioned in this Support Article, so you need to look at other options. In our case, as we have a static environment and use GPUs in passthrough mode, we selected one host where the resources are available to start the preparation VM. To achieve this and make sure the preparation VM is always started on that host, the only option is to edit the hosting connection and only select the SR for that host. After this, all the Preparation VMs will start on that host, and every Machina Catalog update will be successful. The screenshot shows that the host used for the preparation VM is CH4 (Citrix Hypervisor).

Hosting Connection Citrix Studio


Every company likes to use all the resources available within its environment. Of course, they will know they need to update the Master Image and need resources for the preparation VM. Still, it’s sad to see it’s not possible to specify one host within the studio to act as a Preparation VM host. Suppose you only have shared storage combined with GPUs and/or limited memory and don’t use the local storage within a hypervisor. Then you are screwed, it could be that the preparation VM is started on a host that currently doesn’t have resources available, and your Machine Catalog update will fail.

As a feature request for Citrix, it would be nice if you could specify a host within the hosting connection that will be used to run the preparation VM as long as they can’t check the available resources for the Hosting Connection.

Reset Windows Rearm count

When working with Machine Creation Services we discovered that the Clients all have the same CMID. A different CMID is needed to activate using KMS services. We searched for a solution and everyone mentioned rearming the machine, but then we received the message that we can’t rearm. We then searched for a solution but everyone was pointing out to set the Skiprearm to 1. When testing this we discovered that the CMID keeps the same after rearming the Windows machine.

We discovered that the “Remaining Windows Rearm Count” was 0. which means that when you set SkipRearm then you don’t rearm the machine. Knowing this we searched how to reset the Rearm count and found an article that explained how we could reset the rearm count.

To do this follow the below instructions:

  1. Create reset.bat on C:\
  2. add the following code:

    reg load HKLM\MY_SYSTEM “%~dp0Windows\System32\config\system”
    reg delete HKLM\MY_SYSTEM\WPA /f
    reg unload HKLM\MY_SYSTEM

  3. Restart your machine to repair mode using the F8 key.
  4. In the System Recovery Options menu, select Command Prompt.
  5. Now type in D:\reset.bat. The C-drive is used as a recovery partition.
  6. If the script is executed successfully, you should get the message “The operation completed successfully”.
  7. Reboot your machine.

Now the rearm count is reset to 5. You can check this using slmgr /dlv.

rearm count

Now set make sure the Skiprearm is set to 0 at the following location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SoftwareProtectionPlatform

Now the Image is ready to deploy and the KMS server will receive different CMID’s from the servers.