Troubleshooting Invalid Virtual Machines

##Troubleshooting Invalid Virtual Machines##

Virtual machines can show up as invalid if the datastore UUID changed due to resignaturing

*) Try to remove/re-add the VM to vCenter inventory, VM needs to be powered off

Identify VM Host from VM Summary info in vCenter.

Note the path/datastore location using the following commands:

– esxi 4.1 ~# vmware-cmd -l !–gets the full path to vms
– esxi 5.x ~# vim-cmd vmsvc/getallvms !– Note [VMID] / Datastore Volume Name
~# esxcli vm process list !– Note the full path

Identifying vm disk (mapping the full path above to a datastore volume name)

– esxi 4.1 ~# esxcfg-scsidevs -m
– esxi 5.x ~# esxcli storage filesystem list [map path to datastore volume name]

To Remove the VM from Inventory:
– Rick click VM, Remove from Inventory (DO NOT CHOOSE DELETE FROM DISK)
– Browse the datasore Identified above, to the VM directory, right click the .vmx file,
choose Add to Inventory.

*) Determine the sate of the VM

esxi 4.1
~# vmware-cmd <path.vmx> getstate
esxi 5.x
~# vim-cmd vmsvc/power.getstate [VMID]

Interpreting Output

if state is on !– vCenter may not be communicating with the host properly
if state is off !– the ESXi host may be unaware it is still running the virtual machine.

*) If you want to get VM world ID and turn off while debugging

~# vm-support -x ! — get world ID for affected VM.
~# vm-support -X <WorldID> !– Can take several minutes (up to 30 minutes)

*) Powering off the VM gracefully !– works if the VM process is running

esxi 4.1
~# vmware-cmd <path.vmx> stop
~# vmware-cmd <path.vmx> getstate
esxi 5.x
~# vim-vmd vmsvc/power.shutdown [VMID]
~# vim-cmd vmsvc/power.getstate [VMID]

*) Hard Powering off the VM

esxi 4.1
~# vmware-cmd <path.vmx> stop hard !– ungraceful hard shut down of the virtual machine
~# vmware-cmd <path.vmx> getstate

esxi 5.x
~# vim-vmd vmsvc/ [VMID]

*) To kill a virtual machine (works in 4.1 and 5.x)
c , for CPU
f , to display fields
c , to add the column for the Leader World ID (LWID)
Identify VM by it’s LWID
k , to bring up the “World to Kill” prompt
type the LWID, press Enter,


3 thoughts on “Troubleshooting Invalid Virtual Machines

  1. Hi Stranger! I’ve seen this twice myself – I found without much effort a good half dozen times this condition has been reported to us (not self resolved) since i’ve been here. 🙂

  2. It happened twice to me this week. The only way that I could resolve it was to reboot the esx host. This was also the resolution that I received from vmware support since the other option was to recreate the vm and map to the original vm disks.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s