As I've been Storage vMotioning all of my VMs off of my datastores in order to upgrade them to VMFS 5 I cam across a situation where there was one VM that I just couldn't move. I couldn't remove it from inventory, I couldn't delete it from disk, in fact, I couldn't even see it when I was in 'VMs and Templates' view. It was almost as if the VM was marked as read only and after a little digging I realized that was exactly the case.
The VM created was actually a replica or clone of a parent virtual machine used for a small VMware View proof of concept that we carried out a a few months ago. What happens during the provisioning process of a linked clone pool of desktops in VMware View is that a complete copy of the Parent VM and its' associated snapshots are copied into a protected VM. The proteced VM is then used to scale environments and save disk space. It was this protected VM was item that I needed to remove or delete in order to format my datastore as VMFS 5. Obviously in a perfect world it would make sense to remove all of these disks through the View Manager by removing your desktops and desktop pools. I say in a perfect world because for some reason those pools and desktops no longer existed in my View Manager. Another option is to 'un-protect' this VM by using the sviconfig on the View Composer. There's a blog post on the VMware View Blog which outlines the command line parameters to use it. Again, in a perfect world one would still have a View Composer instance, that which I did not.
So, as a last ditch effort these are the steps I used to remove the replica disk.
1. Connect directly to the ESXi host and remove the replica
I know I know, you shouldn't perform actions directly on a host if it is connected to a vCenter instance, but I really had no choice on this one. Find out which host the replica is registered to and connect directly to it (either with the vSphere Client or vMA) and remove it from inventory. You should see it disappear from the host, however it will show up as orphaned in vCenter.
2. Maintenance Mode, Disconnect and Remove.
It seems extreme but this is what I had to do. Drop your host into Maintenance Mode. When that's complete, disconnect it from the vCenter Server, and when that's completed right click on your host and 'Remove' it from the vCenter instance.
3. Add the host back to your cluster.
In the 'Hosts and Clusters' inventory view, right click on your cluster and select 'Add Host'. You will have to provide the connection information to the host that you just removed in order to get it reconnected to your vCenter instance.
Voila, the replica VM is gone for good! It seems a little extreme to go to these lengths to get rid of one VM but its' the only sequence of events that I could process to get rid of it! As always, concerns, question, comments, suggestions are welcome in the comments below!