View Composer - How to Delete Orphaned Protected Entities in vCenter
View Composer enables the use of linked clones with View Manager in order to reduce the amount of storage needed per VM. It does this by coping the parent VM + snapshot into a protected VM or entity. This VM is protected so it can’t be deleted in vCenter to ensure an admin doesn’t accidentally delete the VM which users may be referencing.
The correct way to manage these protected VM’s isn’t within vCenter, it’s in View Manager. When a linked clone enabled pool is created, recomposed, or deleted this updates the protected entity accordingly. In some cases it may be necessary to manually unprotect and remove the protected entity in vCenter. SVICONFIG.EXE is included with View Composer to assist with this. Located under “C:\Program Files\VMware\VMware View Composer\SviConfig.exe” this command will unprotect any View Composer related protected entity.
Here is how to unprotect the host folder and any entities it may contain:
1. On the vCenter/View Composer server launch Start –> Run –> CMD
2. Browse to “C:\Program Files\VMware\VMware View Composer”
3. Type the command below replacing the default information with specific information for your environment.
“SviConfig -operation=UnprotectEntity -VcUrl=https://my.vc/sdk -Username=User1 -Password=123 -InventoryPath="/My Datacenter/vm/MyReplicaFolder" -Recursive=True”
If this is successful it will return a confirmation of any entities unprotected. Now it will be possible to use vCenter to delete the newly unprotected entity.
The command work without a hitch, I was able to remove the orphaned replica and source.
How do I put the protection back on the folder?
Ken
Posted by: Ken | 01/12/2009 at 08:27 AM
Having just been caught out by directly following your post you might want to make it clear that the "/vm/" part of the InventoryPath variable is actually a mandatory part of the commandline structure. For the InventoryPath variable just the "My Datacenter" and "MyReplicaFolder" parts need to be customised for the environment the command is being run in.
Posted by: Mark | 01/24/2009 at 02:45 AM
Curious if there's a solution for those of us who have upgraded our vCenter Server to 4.0 (actually migrated/upgraded to a new, 64-bit OS)? This command of course isn't supported in vCenter 4.0 since View doesn't yet support that (we spun up a different vCenter 2.5 server for our View instance so that we could upgrade vCenter). The pools were all deleted in advance I believe, but we have the replica and source VM orphans. The command above throws this error:
SviConfig finished with an error. Exit code: 4
This VC api version (4.0) is not supported.
Posted by: Allen | 10/13/2009 at 06:29 AM
FYI, I ended up filing an SR with VMware for this issue and they gave me a different version of the SviConfig tool that resolves this issue. If anyone else sees this and is in the same situation as me, just contact VMware support. Also see http://communities.vmware.com/message/1388360.
Posted by: Allen | 10/26/2009 at 02:31 PM
That link did not work anymore, a new KB with a link to the new sviconfig that works on vCenter4.1 would be helpful and productive, please! We just want to get rid of the orphaned
WARNING: Unprotecting VC managed entities will allow operations
(power on, delete, migrate) that can cause existing linked clone
to those managed entities to fail to work correctly.
Establishing connection to the VC server.
SviConfig finished with an error. Exit code: 4
This VC api version (4.1) is not supported.
Posted by: Bud | 11/19/2010 at 10:50 AM
It does not works. I think because I deleted the replica manually in the datastore.
Is there other way to remove the replica in vCenter? Thanks Joe
"SviConfig finished with an error. Exit code: 11
Entity not found."
Posted by: Joe | 12/26/2010 at 10:04 AM
It does not works. I think because I deleted the replica manually in the datastore.
Is there other way to remove the replica in vCenter? Thanks Joe
"SviConfig finished with an error. Exit code: 11
Entity not found."
Posted by: Joe | 12/26/2010 at 10:04 AM
I follow "Mattpendleton" and it's works:
1. If you are using vCenter, log in to the host that has the orphaned replica using the vSphere client.
2. You should see the orphaned replica there and you should be able to right-click and choose Delete.
3. Then go back to vCenter, find that same host, and right-click, choose Disconnect
4. Then choose Remove
5. Then right click on your Cluster and add the host back.
Posted by: Joe | 12/26/2010 at 10:32 AM
Thank you Joe for saving me a lot of hassle!
Posted by: JG | 02/21/2011 at 09:43 AM
To fix exit code: 4
I found that I was using the root logon and password for esx instead of my Domain User for Virtual Center.
use: DOMAIN\username
To fix exit code: 11
I found that the replicas were in a different folder. I did an Advanced Search from my Vsphere client with "VM Name" and "Contains" and then the replica name as the criteria. The search results showed that the replica was in: InventoryPath="/My Datacenter/vm/VMwareViewComposerReplicaFolder/replica-799f3b16-dc63-4cb1-aacd-fa4efbef3058"
So once I took out the MyReplicaFolder as stated in some of the examples and replaced it with VMwareViewComposerReplicaFolder.
I was able to unlock and remove my orphaned replica.
Posted by: Nando | 06/09/2011 at 02:54 PM
I used the command and it unprotected all VM because I did not have a My replica Folder so it unprotected all VMs so I altered the command to Portect..
“SviConfig -operation=protectEntity -VcUrl=https://my.vc/sdk -Username=User1 -Password=123 -InventoryPath="/My Datacenter/vm/MyReplicaFolder" -Recursive=True”
Posted by: William | 08/08/2011 at 09:03 AM
hey awesome just what i was needing to do!
Posted by: Watch full movies online | 10/10/2011 at 08:55 PM