How to delete an orphaned desktop pool
Time for a new problem in the VMware Horizon View series. After running into problems which forced me to ‘Manually delete protected Horizon View replicas‘ and ‘Link a VMware View desktop to its replica‘, now I encountered an orphaned desktop pool which could not be deleted.
First, What got me into this mess. As I told you last week I was testing a Nvidia Quadro K5000 graphics card when my ESXi whitebox died on me. This also corrupted the one hard drive which contained all my Horizon View desktops. Fortunately the golden images resided on my NFS storage so no harm done, just delete the pools, recreate them and we’re up and running again. Wrong! Because the VDI virtual machines were no longer present, I ended up with an orphaned desktop pool. Similar like you would get when deleting View virtual machines directly from the vCenter client.
When I tried to delete the desktop pools in the Horizon View Administrator I got an error stating internal problems with the Composer server or service.
It’s not much to go on but I checked the View Composer service, Composer logs, Windows domain membership and I even reconfigured Composer in the Horizon View Administrator Server settings. No success. Then I remembered manually deleting the protected Horizon View replicas and I searched for orphaned desktops pools.
I found this VMware KB article: Manually deleting linked clones or stale virtual desktop entries from VMware View Manager and Horizon View (1008658)
This confirmed my suspicion that this had nothing to do with the Composer service but that it was caused by the disappearance of the View virtual machines due to the hard disk corruption. Much like you would get when deleting View virtual machines directly from the vCenter client instead of the proper way, in the Horizon View Administrator console.
To solve this problem and remove the bad entries to be able to delete the desktop pool I had to do the following:
- Open up vSphere and connect to vCenter.
- Open up the console for the Horizon View Connection Server.
- Connect to the Horizon View ADAM database:
- Click [Start > Administrative Tools > ADSI Edit].
- In the console window, right-click ADSI Edit and click [Connect to].
- In the Name field type: [View ADAM Database].
- Select [Select or type a Distinguished Name or Naming Context].
- In the field below, type [dc=vdi,dc=vmware,dc=int].
(do not try to be smart and change these to match your own AD domain like I did. This is the distinguished name of the Horizon View ADAM database)
- Select [Select or type a domain or server].
- In the field below, type [localhost].
- Click [OK].
- Click [View ADAM Database] to expand.
- Click [DC=vdi,dc=vmware,dc=int] to expand.
- Locate the GUID of the virtual machine. To locate the GUID of the virtual machine:
- Right-click the Connection [View ADAM Database], and click [New > Query].
- Under Root of Search, click [Browse] and select the [Servers] organizational unit.
- Click [OK].
- In the Query String, paste this search string: (&(objectClass=pae-VM)(pae-displayname=VirtualMachineName))
Where VirtualMachineName is the name of the virtual machine for which you are trying to locate the GUID. You may use * or ? as wildcards to match multiple desktops.
- Click [OK] to create the query.
- Click the query in the left pane. The virtual machines that match the search are displayed in the right pane.
- Record the [GUID] in cn=<GUID>.
- Delete the [pae-VM object] from the ADAM database:
- Locate the [OU=SERVERS] container.
- Locate the corresponding virtual machine’s GUID (from above) in the list which can be sorted in ascending or descending order, choose [Properties] and check the pae-DisplayName attribute to verify the corresponding linked clone virtual machine object.
- Delete the pae-VM object.
- Check if there are entries under OU=Desktops and OU=Applications in the ADAM database.
- Check for entries in both the [OU=Server Groups] and [OU=Applications] and remove both. Removing one entry and not the other from the ADAM database results in the java.lang.nullpointerexception error when attempting to view the pools or desktops inventory in View Manager.
This did the trick. After deleting all references to the old VDI virtual machines and desktop pools, I’ve got a fresh and clean Horizon View Connection Server.
The founder and driving force behind VMGuru. With over 20 years experience in IT, he now works as a Cloud Management Specialist at VMware Benelux. He worked as technical consultant, pre-sales and solutions architect for several systems integrators.
He’s a long time VMware VCP, VCP Desktop, VCA, VSP and VTSP, vExpert Cloud (2017) and 9 year vExpert (2009 – 2017).