{"id":17720,"date":"2016-08-03T09:00:05","date_gmt":"2016-08-03T07:00:05","guid":{"rendered":"http:\/\/nolabnoparty.com\/en\/?p=17720"},"modified":"2016-07-29T13:03:54","modified_gmt":"2016-07-29T11:03:54","slug":"vmware-horizon-manually-removing-orphaned-stale-virtual-desktops","status":"publish","type":"post","link":"https:\/\/nolabnoparty.com\/en\/vmware-horizon-manually-removing-orphaned-stale-virtual-desktops\/","title":{"rendered":"VMware Horizon: manually removing orphaned or stale virtual desktops"},"content":{"rendered":"<p><img decoding=\"async\" class=\"aligncenter wp-image-17726 size-full\" title=\"removingorphanedstalevdi01\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi01.jpg\" alt=\"removingorphanedstalevdi01\" width=\"602\" height=\"202\" \/><\/p>\n<p>Horizon sometimes fails to\u00a0process\u00a0some VMs\u00a0leaving orphaned or stale virtual desktops in pools that cannot be removed from the GUI.<\/p>\n<p>Manually\u00a0removing orphaned or stale virtual desktops\u00a0<strong>from the vCenter<\/strong> is not enough to\u00a0clean the\u00a0VMware View Manager and its database.<!--more--><\/p>\n<p>&nbsp;<\/p>\n<h2>Remove the VDI<\/h2>\n<p>From the <strong>Horizon View Administrator<\/strong>, right click the machine to delete\u00a0and click <strong>Remove<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17727 size-full\" title=\"removingorphanedstalevdi02\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi02.jpg\" alt=\"removingorphanedstalevdi02\" width=\"563\" height=\"565\" \/><\/p>\n<p>Click <strong>OK<\/strong> to proceed.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17728 size-full\" title=\"removingorphanedstalevdi03\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi03.jpg\" alt=\"removingorphanedstalevdi03\" width=\"520\" height=\"170\" \/><\/p>\n<p>This is one type of error you can experience. in the example the<strong> vCenter Server is corrupted<\/strong>\u00a0and the machine cannot be removed.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17729 size-full\" title=\"removingorphanedstalevdi04\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi04.jpg\" alt=\"removingorphanedstalevdi04\" width=\"400\" height=\"174\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Clean ADAM database<\/h2>\n<p>To remove the orphaned VM, the View database must be cleaned in order to remove all the entries no longer needed. From the <strong>Horizon Connection Server<\/strong>, open the <strong>ADSI Edit<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17731 size-full\" title=\"removingorphanedstalevdi05\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi05.jpg\" alt=\"removingorphanedstalevdi05\" width=\"543\" height=\"271\" \/><\/p>\n<p>Right click the <strong>ADSI Edit<\/strong> item and select <strong>Connect to...<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17732 size-large\" title=\"removingorphanedstalevdi06\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi06-600x462.jpg\" alt=\"removingorphanedstalevdi06\" width=\"600\" height=\"462\" \/><\/p>\n<p>In the <strong>Connection Settings<\/strong> window, enter\u00a0the following parameters:<\/p>\n<blockquote><p><strong>Name<\/strong>: View ADAM Database<br \/>\n<strong>Connection Point<\/strong>: dc=vdi,dc=vmware,dc=int<br \/>\n<strong>Computer<\/strong>:\u00a0localhost:389<\/p><\/blockquote>\n<p>Click <strong>OK<\/strong> to confirm.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17733 size-full\" title=\"removingorphanedstalevdi07\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi07.jpg\" alt=\"removingorphanedstalevdi07\" width=\"394\" height=\"393\" \/><\/p>\n<p>If the connection to the <strong>ADAM database fails<\/strong>, one reason could be that the\u00a0user logged in the Connection Server doesn't have the <strong>correct permissions<\/strong> to administer VMware View.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17734 size-full\" title=\"removingorphanedstalevdi08\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi08.jpg\" alt=\"removingorphanedstalevdi08\" width=\"398\" height=\"185\" \/><\/p>\n<p>In the <strong>View Administrators group<\/strong> enter the account to entitle then\u00a0click <strong>OK<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17735 size-large\" title=\"removingorphanedstalevdi09\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi09-600x527.jpg\" alt=\"removingorphanedstalevdi09\" width=\"600\" height=\"527\" \/><\/p>\n<p>The connection to the ADAM database is now successful.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17736 size-large\" title=\"removingorphanedstalevdi10\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi10-600x463.jpg\" alt=\"removingorphanedstalevdi10\" width=\"600\" height=\"463\" \/><\/p>\n<p>Right click the <strong>View ADAM Database<\/strong> and select <strong>New &gt; Query...<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17737 size-full\" title=\"removingorphanedstalevdi11\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi11.jpg\" alt=\"removingorphanedstalevdi11\" width=\"517\" height=\"341\" \/><\/p>\n<p>Give the\u00a0query a <strong>Name<\/strong>\u00a0(i.e. VDI) and click <strong>Browse<\/strong>. Select <strong>Servers<\/strong> and click <strong>OK<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17738 size-large\" title=\"removingorphanedstalevdi12\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi12-600x463.jpg\" alt=\"removingorphanedstalevdi12\" width=\"600\" height=\"463\" \/><\/p>\n<p>Enter the string below in the\u00a0<strong>Query String<\/strong>\u00a0field specifying the orphaned VM name.\u00a0Click <strong>OK<\/strong>\u00a0to execute the query.<\/p>\n<blockquote><p>(&amp;(objectClass=pae-VM)(pae-displayname=<em>VM_to_remove<\/em>))<br \/>\ni.e. (&amp;(objectClass=pae-VM)(pae-displayname=<span style=\"color: #0000ff;\"><em>view-lab-1<\/em><\/span>))<\/p><\/blockquote>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17739 size-full\" title=\"removingorphanedstalevdi13\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi13.jpg\" alt=\"removingorphanedstalevdi13\" width=\"394\" height=\"393\" \/><\/p>\n<p>As result, a new <strong>ADSI Edit\u00a0item<\/strong> appears at the bottom of the window (<strong>VDI<\/strong>). Take note of the <strong>CN string<\/strong> in the right pane.<\/p>\n<blockquote><p>i.e.\u00a0CN=ccbace2f-e506-48c4-8248-d92d5821876a<\/p><\/blockquote>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17740 size-large\" title=\"removingorphanedstalevdi14\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi14-600x463.jpg\" alt=\"removingorphanedstalevdi14\" width=\"600\" height=\"463\" \/><\/p>\n<p>Double click the <strong>CN object<\/strong> and check if the\u00a0<strong>pae-DisplayName<\/strong>\u00a0reflects the name assigned to the VDI. Click <strong>OK<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17741 size-full\" title=\"removingorphanedstalevdi15\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/07\/removingorphanedstalevdi15.jpg\" alt=\"removingorphanedstalevdi15\" width=\"414\" height=\"462\" \/><\/p>\n<p>In the <strong>Servers OU<\/strong>,\u00a0locate the entry with the <strong>same CN<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17744 size-large\" title=\"removingorphanedstalevdi16\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi16-600x463.jpg\" alt=\"removingorphanedstalevdi16\" width=\"600\" height=\"463\" \/><\/p>\n<p>Again, double click the <strong>CN object<\/strong> and check if the\u00a0<strong>pae-DisplayName<\/strong>\u00a0reflects the name assigned to the VDI then click <strong>OK<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17745 size-full\" title=\"removingorphanedstalevdi17\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi17.jpg\" alt=\"removingorphanedstalevdi17\" width=\"414\" height=\"462\" \/><\/p>\n<p>Right click the verified CN object and select <strong>Delete<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17746 size-large\" title=\"removingorphanedstalevdi18\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi18-600x463.jpg\" alt=\"removingorphanedstalevdi18\" width=\"600\" height=\"463\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Click <strong>Yes<\/strong> to confirm.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17747 size-full\" title=\"removingorphanedstalevdi19\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi19.jpg\" alt=\"removingorphanedstalevdi19\" width=\"349\" height=\"172\" \/><\/p>\n<p>The object has been removed from the ADAM Database.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17748 size-large\" title=\"removingorphanedstalevdi20\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi20-600x463.jpg\" alt=\"removingorphanedstalevdi20\" width=\"600\" height=\"463\" \/><\/p>\n<p>When you <strong>refresh<\/strong> the Horizon View Administrator screen, the orphaned virtual desktop has been removed.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17750 size-large\" title=\"removingorphanedstalevdi21\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi21-600x407.jpg\" alt=\"removingorphanedstalevdi21\" width=\"600\" height=\"407\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Clean Active Directory<\/h2>\n<p>Remove the computer also from the <strong>Active Directory<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17751 size-large\" title=\"removingorphanedstalevdi22\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi22-600x541.jpg\" alt=\"removingorphanedstalevdi22\" width=\"600\" height=\"541\" \/><\/p>\n<p>Click <strong>Yes<\/strong> to confirm.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-17752 size-full\" title=\"removingorphanedstalevdi23\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2016\/08\/removingorphanedstalevdi23.jpg\" alt=\"removingorphanedstalevdi23\" width=\"473\" height=\"172\" \/><\/p>\n<p>In this procedure the old vCenter Server was corrupted\u00a0and the <strong>Horizon View database<\/strong> installed in the same VM was\u00a0not available as well. To <strong>complete the overall procedure<\/strong>, the orphaned VM should be removed also from the vCenter Server and the Horizon View database.<\/p>\n<p><img decoding=\"async\" title=\"signature\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/images\/firma.jpg\" alt=\"signature\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Horizon sometimes fails to\u00a0process\u00a0some VMs\u00a0leaving orphaned or stale virtual desktops in pools that cannot be removed from the GUI. Manually\u00a0removing orphaned or stale virtual desktops\u00a0from the vCenter is not enough to\u00a0clean the\u00a0VMware View Manager and its database.<\/p>\n","protected":false},"author":3,"featured_media":17726,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":{"linkedin_93tdZWzMZc_93tdZWzMZc":"","facebook_2879994398731222_17841400390232720":"","twitter_113568041_113568041":"","mastodon_115463926174894442_115463926174894442":""},"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[903,1025],"tags":[1711,1712,1713,994],"class_list":["post-17720","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vmware-en","category-horizon-en","tag-horizon","tag-orphaned","tag-stale","tag-view-en","has_thumb"],"_links":{"self":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts\/17720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/comments?post=17720"}],"version-history":[{"count":0,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts\/17720\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/media\/17726"}],"wp:attachment":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/media?parent=17720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/categories?post=17720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/tags?post=17720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}