After reinstalling composer server in my lab I was left with some orphaned replicas in the lab. While I was able to delete the virtual desktop VMs it was not possible to delete those replicas VM from within the vSphere client as the option is grayed out. The replica VM has some strange name as you can see.
So what's the options? In fact the only option is a command line utility called sviconfig installed on the composer server. Well there are two and I'll show you the more easy one as the one provided by VMware KB 1008704 did not work and I had error code 11 all the time when executing the command on my View Composer server:
sviconfig -operation=UnprotectEntity -DsnName=name_of_DSN -DbUsername=Composer_DSN_User_Name -DbPassword=Composer_DSN_Password -VcUrl=https://vCenter_Server_address/sdk -VcUsername=Domain\User_of_vCenter_Server_account_name -VcPassword=vCenter_Server_account_password -InventoryPath=/Datacenter_name/vm/VMwareViewComposerReplicaFolder -Recursive=true
Note: If you receive Error code 11 when you run the command and your replicas are in a folder and not directly under the Data center. The path should be manually substituted in place of VMwareViewComposerReplicaFolder.
Here you can see that the right click do not allows you to delete the replica like that.
How-to delete orphaned Horizon View replica
The problem is the replica VM can't be deleted in the normal circumstances, but it can be deleted when you connect to the ESXi host directly! Sure, you can delete the view replica by connecting directly to the host (not vCenter), but vCenter view is not updated and the replica is still present there.
You need to proceed with this steps:
Select the cluster view > disconnect host > remove > and add the ESXi host back to vCenter and you're done! The reference to the replica is gone!
All this can be done in less than 5 min. -:)
Worked for me… Very helpful, thank you for sharing!
It only it were this simple…
To remove a ESXi host from a cluster, it must be in maintenance mode. For this, all VMs must be migrated to another host or they must be powered down. Moreover, if the ESXi host is part of a vDSwitch, it cannot be removed from the cluster. The switch essentially has to be deleted and recreated without the host. This will invalidate all the VM’s network adapter mappings until the switch has been added back. One can add hosts to a vDSwitch, but not remove it until the adapters have been reassigned. All this is a lot of work and would take several hours for a ESXi host with a lot of VMs.
Shyju Kanaprath says
Nice. Worked for me also in vSphere 5.5 Cluster.
Worked like a charm, thank you!
Jerome B says
Very nice ! worked for me too in vSperre 5.5 Cluster with a replica VIEW.
Thanks a lot
Thanks a lot.It works for me.
Antonio Melo says
I need help! I have too orphaned replicas, but I didn’t install view composer, I installed a new feature VMware Horizon Instant Clone..
How I delete this replicas?
for deleting instant clones you need to use “IcUnprotect.cmd”. see https://pubs.vmware.com/horizon-7-view/topic/com.vmware.horizon-view.desktops.doc/GUID-6025D684-2E05-4857-9C24-18F16DDC38FD.html