VMware Cloud Community
jwnchoate
Contributor
Contributor
Jump to solution

unable to remove orphaned and inaccessible vm from inventory.

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
runclear
Expert
Expert
Jump to solution

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..

-


-------------------- What the f* is the cloud?!

View solution in original post

9 Replies
lamw
Community Manager
Community Manager
Jump to solution

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".

Reply
0 Kudos
jwnchoate
Contributor
Contributor
Jump to solution

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.

Reply
0 Kudos
jwnchoate
Contributor
Contributor
Jump to solution

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.

Reply
0 Kudos
jwnchoate
Contributor
Contributor
Jump to solution

completing the migration is going to be hard since I already removed the messed up vm files.

Reply
0 Kudos
kjb007
Immortal
Immortal
Jump to solution

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

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
runclear
Expert
Expert
Jump to solution

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..

-


-------------------- What the f* is the cloud?!
jwnchoate
Contributor
Contributor
Jump to solution

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.

Reply
0 Kudos
runclear
Expert
Expert
Jump to solution

Very Cool - Glad it worked, i beat my head on the desk for a few hours trying to figure it out... just as all the other posters suggested, i did all of those things as well, ie: looking through the XML file for the guest .. etc etc...

-


-------------------- What the f* is the cloud?!
Reply
0 Kudos
ICT-Freak
Enthusiast
Enthusiast
Jump to solution

Excellent post kjb007! This sollution worked like a charm Smiley Happy

Reply
0 Kudos