How to Stop a Stuck Virtual Machine which Cannot be Managed through vCenter Server

In a few occasions we have bumped into virtual machines which appered to be powered on, but in fact cannot be accessed/managed through the vCenter server.

The solution to this problem is by identifying the PID of the virtual machine, the ESX server that contains the virtual machine and killing that daemon.

Follow the following:

Stop the virtual machine by issuing the command: vmware-cmd /vmfs/volumes/<datastorename>/<vmname>/<vmname>.vmx stop. (This must be done on the ESX host where the Virtual Machine is running)

If this does not work, one can issue the following command: vmware-cmd /vmfs/volumes/<datastorename>/<vmname>/<vmname>.vmx stophard. This will try to kill the Virtual Machine instantly.

A final solution is to kill the PID (process ID). Issue the following command: ps auxfww | grep <vmname> to locate the correct PID (BTW: this cannot be done via ESXTOP). The first number to appear in the output is your PID. The PID can be used to terminate the process by issuing kill -9 PID.