«

»

Mar 30 2016

Remove Horizon View Desktops Pools and VMs stuck in delete state

“VMTurbo"

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:

  • 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.

14 comments

Skip to comment form

  1. Sean Massey

    Magnus,

    Great writeup. I’ve used this tool in the past, and it works great.

    Just an FYI, there are two typos in the command you provided to scan a pool.

    The command should be:
    viewdbchk –scanMachines –limit 100

  2. magander3

    tnx, i’ll update the post

    //Magnus

  3. Mustafa

    Great, thanks magander3. it’ s worked me.

  4. magander3

    good stuff

    //Magnus

  5. J Wilson

    Worked perfect. Thank you!

  6. magander3

    glad you found it useful//Magnus

  7. Jesse

    I appreciate this post tremendously. I have run the command and I’m not getting any problem VMs. The output says that 0 Vms on 0 Pools. Do you know of a command tool that will delete the actual pool? That seems to be where my problem is.

    Thanks again //jferg

  8. magander3

    Hi, the command should remove the desktop pool as well. if it doesn’t you might need to clean it from the ADAM database. If you are not experienced with that i suggest you can open a VMware SR or just google it.

    thanks and good luck.

    //Magnus

  9. JFerg

    View POwerCLI cmdlet:

    Remove-Pool -pool_id <xyz<

    Done…

  10. magander3

    Good stuff, thanks for sharing
    //Magnus

  11. Gary

    thank you. keep up the good work. These type of post help us all out by providing a quick answer.

  12. magander3

    Thanks Gary, glad you found it useful.

    //Magnus

  13. Hardoman

    This way is much easier then doing manually or via sviconfig.
    Much appreciated, good job!

  14. magander3

    Thanks for the feedback

    //Magnus

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">