Had a crash during an svmotion, vm orphaned and tried to readd to inventory but no luck. I have since restored the vm from a san snapshot and deleted all the original files and it now sits in a whole new folder but I cannot remove the 2 infentory items I tried to readd it after the intial failure.
I have rebooted the server, I have restarted mgmt-vmware, vmware-vmkauthd, and vmware-vpxa. -- several times now.
vmware-cmd -l on host does not list any references to the ghosted vm. cannot remove from vclient
vitoolkit (powershell) will list the 2 vms,
get-vm -Name vmname -
produces the name of the vm object.
but I cannot:
get-vm -Name vmname | remove-vm -- doesnt work because I get this error message..."Remove-VM : 5/11/2009 9:05:02 PM Remove-VM A general system error occurred: You must power off the virtual machine and complete the migration before invoking this operation."
nothing I have been trying gets me to remove the orphan.
i worked with vmware support on this issue, and ended up coming up with my own "solution" if this is a cluster a fix is pretty simple... I had all the same symptoms you had as well...
1. Place Node in Maint Mode
2. Remove Node from the Cluster
3. Re-Add the node to the Cluster..
Presto - Fixed.
Matter of fact, here is my original thread on this issue.
I think the only caveat is, that if you have Resource Pools in place this will screw those up on that node/vm's... but thats really wasnt an issue/concern for me in my case..
-
Have you tried the following:
1) restart the management service on ESX host:
service mgmt-vmware restart
2) restart the vCenter service
3) You can take a look at this Perl script I wrote that uses the VI Perl Toolkit to remove orphaned VM(s): http://communities.vmware.com/message/1243621#1243621
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
If you find this information useful, please award points for "correct" or "helpful".
as mentioned above, I had done the restart of services on host and vcenter server several times, rebooted servers. Tried powershell and it wants to finish the migration. I will give the perl script a try.
Script did not work either orphans remain, error message is the same type thing as in powershell.
SOAP Fault: Fault string: A general system error occured: You must power off the virual machine and complete the migration before invoking this operating.
completing the migration is going to be hard since I already removed the messed up vm files.
Check if the vm exists in the inventory file, /etc/vmware/hostd/vmInventory.xml. If it does, save the file, remove the entry, and restart hostd, 'service mgmt-vmware restart'
-KjB
VMware vExpert
i worked with vmware support on this issue, and ended up coming up with my own "solution" if this is a cluster a fix is pretty simple... I had all the same symptoms you had as well...
1. Place Node in Maint Mode
2. Remove Node from the Cluster
3. Re-Add the node to the Cluster..
Presto - Fixed.
Matter of fact, here is my original thread on this issue.
I think the only caveat is, that if you have Resource Pools in place this will screw those up on that node/vm's... but thats really wasnt an issue/concern for me in my case..
-
that did it runclear! I did not try the other one, so I don't know if that works, but removing from cluster and readding it did the trick and it was easy. Thanks.
Excellent post kjb007! This sollution worked like a charm