Introduction

In this article I will describe how to remove Instant Clone objects created in VMware Horizon DaaS from your vCenter Server.

I had to do this because I (on one of those famous rough Monday mornings 😉 ) deleted one of my demo tenants in VMware Horizon DaaS without properly clean the tenant first.

Note to self: kill the VDI’s first, than remove the images, etc. properly and THAN delete the tenant!

Unfortunately this wasn’t a very clever move because you can’t delete the remaining objects afterwards due to a lock in the database:

Deleting Instant Cloning cp-xxx objects is not possible due to a lock
Deleting Instant Cloning cp-xxx objects is not possible due to a lock

This can be avoided by changing the capacity of the desktop pools to 0 and convert/delete the images before you delete your tenant from the Horizon DaaS Service center.

Beware!
If these actions are outside your comfort zone, reach out to the VMware Support team to assist you with this. When you delete the wrong objects, there will be consequences.

Preparation

First, you need gather a list of cp-xxx objects you want to remove from the vCenter Server. I did this by listing all the VM objects sitting in the remaining desktop VLAN of my deleted tenant.

Now, export them to a Excel/CSV file.
In the second part of this article we will add a column to the file, so a clear overview is advised.

You can use the Data > “Text to columns” option in Excel to make the list more clear to read. My list looked like this:

Instant Clone - Overview
Instant Clone – Overview

Log on to the vCenter Server MOB.
To do this, type the following behind the FQDN of your vCenter Server: /mob/?vmodl=1.

Example: https://vcsa-fqdn/mob/?vmodl=1

After you logged on (use the [email protected] account, or equal privileges) to the MOB, Browse to Content.

vCenter Managed Object Browser ><noscript><img class=vCenter Managed Object Browser ><noscript><img class=vCenter Managed Object Browser ><noscript><img class=vCenter Managed Object Browser ><noscript><img class=vCenter Managed Object Browser ><noscript><img class=Instant Clone - Object correlation
Instant Clone – Object correlation

Remove the lock from the Instant Clone cp-xxx objects

In the following steps we will use MOB to remove the lock from Instant Clone cp-xxx objects.

Log on to the vCenter Server MOB.
To do this, type the following behind the FQDN of your vCenter Server: /mob/?vmodl=1.

Example: https://vcsa-fqdn/mob/?vmodl=1

After you logged on (use the [email protected] account, or equal privileges) to the MOB, Browse to Content.

vCenter Managed Object Browser ><noscript><img class=vCenter Managed Object Browser ><noscript><img class=vCenter Managed Object Browser ><noscript><img class=<!--array start --> <entity type="ManagedEntity" xsi:type="ManagedObjectReference">vm-0001</entity> <entity type="ManagedEntity" xsi:type="ManagedObjectReference">vm-0002</entity> <entity type="ManagedEntity" xsi:type="ManagedObjectReference">vm-0003</entity> <entity type="ManagedEntity" xsi:type="ManagedObjectReference">vm-0004</entity> <entity type="ManagedEntity" xsi:type="ManagedObjectReference">vm-0005</entity> <!--array end -->

Change the vm-xxx object names to the names you correlated during the preparations.

Copy/Paste the XML content from the second code block below to the method > vmodl.MethodName[] value.

<!-- array start -->
<entity type="MethodName" xsi:type="string">vim.VirtualMachine.unregister</entity>
<entity type="MethodName" xsi:type="string">vim.VirtualMachine.powerOff</entity>
<entity type="MethodName" xsi:type="string">vim.VirtualMachine.powerOn</entity>  
<entity type="MethodName" xsi:type="string">vim.ManagedEntity.destroy</entity>
<!-- array end -->
vCenter Managed Object Browser ><noscript><img class=

If you’re new to VMware Horizon DaaS, check out our Horizon DaaS Explained series here!

 2,811 total views,  4 views today