The other day I was cleaning up my home lab and then I noticed that there were more instant clone virtual machines than desktop pools. So it seems that after rolling out a new master image, the old virtual machines associated with the instant clone process are not cleaned up.
As you can see there are currently several machines running while only 2 desktop pools are present in the VMware Horizon Administator console.
It is impossible to remove these machines from the vCenter console because they are protected.
Fortunately, Vmware Horizon comes with a tool that can remove these Virtual Machines. You can start and run this tool from the command line on one of your connection servers.
Login to the Windows Server where the Horizon Connection Serveris installed and open the Command Prompt. Navigate to C:\Program Files\VMware\VMware View\Server\tools\bin> directory and run the following command to connect to your vcenter server:
iccleanup.cmd -vc <vCenter> -uid firstname.lastname@example.org -skipCertVeri
Enter “list” to get a display all of the objects:
As you can see the numbers 1,3 and 4 have the status deleted in the screenshot above.
These can be removed from vCenter with the following command:
Delete –index <number>
After doing this all unnecessary template and parent virtual machines have been removed.
This is a very powerful tool to clean up unnecessary instant clone virtual machines and you will immediately have some more storage space available.