Is it possible to use VI Perl API to modify "vmregister.pl" to allow you to unregister a VM on an ESX/ESXi host that is also managed by vCenter to not leave the VMs in an orphan grayed out state? Or should we only unregister a VM from directly the host if it's not being managed by vCenter and if so, use the vCenter server in place of --server argument?
=========================================================================
--William
If a vm is unregistered on the ESX host directly, then vCenter has no knowledge of that unregister action, which is what causes the grayed out state. You can avoid it by only unregistering through vCenter...
vmregister.pl --server your.vCenter.host --vmname name_of_vm
I'm aware of that solution, but the problem is I"m trying to integrate with VIMA's VI Fast Pass authentication and it only supports ESX/ESXi and not vCenter. I wanted to see if it was possible unregister and notify vCenter to remove the orphaned instances, or am I out of luck and have to unregister from vCenter or just manually "remove from inventory" all the orphaned VM(s).
=========================================================================
--William
Sorry, I didn't understand that you were wanting to use fastpass to connect.
Nothing really good immediately comes to mind. You could use the sessions feature of the SDK to connect to vCenter and save the session file (it's just a cookie), then when a VM is to be unregistered, use that session file to connect and do it, but I would imagine that the session will time out at some point.
