Remove Horizon View Desktops Pools and VMs stuck in delete state

A while back i had to manually clean up some Horizon View (version 6.2) Desktop pools that were stuck in the delete state. Reasons for this was failed attempts to delete Horizon View VDIs even though their corresponding vCenter Server VMs were successfully deleted. Below is a print screen from the Horizon View UI showing the state of the Horizon View Desktop pools.

Screen Shot 2016-02-24 at 15.53.24

Obviously the VDIs in the Desktop were stuck in a non working state since they were removed in vCenter Server. You could see the affected VDIs in the Problem Machines section in the Horizon View UI.

Screen Shot 2016-02-24 at 15.53.06

The tool viewdbchk that used to be a VMware fling but was included in Horizon View from version 6.2 if i’m not mistaken is your friend in this situation. The viewdbchk.cmd file is located in the installation Horizon View directory which is my case was d:\Program Files\VMware\VMware View\Server\tools\bin

The number of problem VDIs were around 40 but just to be on the safe side i used 100 VMs as the limit for the scan via the following command (two minus signs before the scanMachines and two minus signs before the limit:

  • viewdbchk.cmd –scanMachines –limit 100

Who i ran the command it processed one Horizon View desktop pool at the time and the below screenshot include one of the desktop pools that only contained one Problem Machine (VDI).

Screen Shot 2016-03-30 at 22.48.28
As you can see i had a few errors for the specific VM before the delete process started:

  • VM state: ERROR
  • VM Clone Error: Failed to delete VM – null
  • VM Clone Error Time: Feb 4, 2016 7:13:15 PM
  • View Composer Error: Failed to delete VM – null
  • VM Missing in vCenter: true

When prompted just answer “yes” to the question “Do you want to remove the desktop machine” and in this case both the VDI and the Horizon View Desktop Pool will be deleted. For Horizon View Desktop pools with many Problem Machines the Horizon View Desktop pool will be deleted as the last step after all Problem Machines have been deleted.
And yes, i had to answer yes to the question for each and every problem VDI so it took some time but as i mentioned, it solved my problem and now it’s all good.

Since this was a non production system i didn’t care about investigating the root cause for the problem. I haven’t seen this problem after this isolated event in the non production environment and not in the production environment deployed a few weeks back but if i do i’ll update this blog post with root cause analysis and hopefully an explanation.

22 pings

Skip to comment form

Comments have been disabled.