vSphere Virtual Machine is orphaned

Jump onto the service console on each ESX host and run vm-support -x to get a list of all VMs that host is running or things it is running.

You should be able to ID the correct host. If it doesn't show up on any host, then none of them is running it and you should be try the 'add to inventory' route to re-attach it.

On the other hand if you do find it, you can make a note of the VMID then run the following to bring it down:

  • less /proc/vmware/vm/{Enter VMID Here}/cpu/status
  • Scroll over to the right until you find a piece of text in the format vm.####
  • Make a note of the 4 digits show in this text. This is the Master User World ID. It's usually one digit lower than the VMID
  • /usr/lib/vmware/bin/vmkload_app -k 9 {Enter Master User World ID Here}
  • You should now be able to re-attach the VMX to an inventory.

Future-wise, consider a physical vCenter box. A virtual one still doesn't sit quite right with me.