Sometimes VM may show unknown, invalid or orphan on vCenter Server, but it still running somewhere. Some technical support engineer may request reboot VM/ESXi host, or search on each host one by one.
Declare: This article only apply to ESXi 5.1, I haven’t tested on other version.
This is easiest way to find out which host lock the VM:
- SSH to any host on the cluster.
- Go to VM folder. ( Usually it’s under /vmfs/volumes/… )
- Run command: vmkfstools -D “vmx file name” | grep owner
- Return line similar like this:
gen 483, mode 1, owner 529495c4-0b6a7d90-a0f3-0025b541a0dc mtime 211436
- The red highlight section is MAC address of owner host.
- Run command: esxcfg-nics -l on each ESXi host to see which host match this MAC address.
Then you need to remove the invalid VM from inventory, and login to the owner host by vSphere Client and import the VMX file again.
This procedure can save lot of time to find the real owner host, but it still consumes time if it’s a large cluster. You want to more fast? It’s possible!
After you find the MAC address, change it to regular format, like: xx:xx:xx:xx:xx:xx.
Logon vMA console and connect to vCenter Server by command: vifptarget -s vCenter Server Name
Run command: esxcfg-nics -h ESXi host name -l | grep xx:xx:xx:xx:xx:xx
Try use Excel to list commands with all ESXi host name then past on console….