VMware Horizon – Desktop pool maintenance & cleanup

Release date: April 15th 2020

Welcome to my VMware Horizon series. From time to time I have to do some maintenance and cleanup obsolete parent vm’s from deleted desktop pools. The image below clearly describes this. As this is my LAB, I often delete and recreate desktop pools, so after a while, the environment get somewhat cluttered.

Desktop-Pool_Cleanup-01

 

As these are protected by VMware Horizon I cannot delete them directly in vSphere.

Desktop-Pool_Cleanup-02

 

Before I can delete these from vSphere, I will have to unprotect them. VMware have a very nice documentation of how to do this here: Instant-Clone Maintenance Utilities

I have removed my desktop pools in Horizon prior to doing this session, in order to do a complete cleanup. To unprotect the obsolete vm’s, I first log into my VMware Horizon Connection Server. The utilities needed to do this, are located in the following folder: C:\Program Files\VMware\VMware View\Server\tools\bin

Desktop-Pool_Cleanup-03

 

Next, I open an administrative command prompt and browse to the folder above. I will run the following command which will unprotect any vm’s that are still present: IcUnprotect.cmd -vc hostname_or_IP_address -uid user_ID [-includeFolders][-skipCertVeri]. In a production environment, I of course wouldn’t delete all desktop pools prior to doing this exercise, but rather investigate more thorough and only delete the obsolete vm’s in question. It is just easier and faster to do it this way in a lab, as I’m doing here.

I enter the ip-address and a user with permissions in vCenter to do this task.

Desktop-Pool_Cleanup-04

 

During execution, I enter the password for my vCenter user and let the job complete.

Desktop-Pool_Cleanup-05

 

Now that protection is removed, I can delete the vm’s from vSphere

Desktop-Pool_Cleanup-06

 

Finally, I recreate the desktop pools I temporarily deleted prior to doing this maintenance job.

 

VMware Horizon planning, deployment etc.

Disclaimer: Every tips/tricks/posting I have published here, is tried and tested in different it-solutions. It is not guaranteed to work everywhere, but is meant as a tip for other users out there. Remember, Google is your friend and don’t be afraid to steal with pride! Feel free to comment below as needed.