donderdag, september 20, 2007

VMware: Stopping a Virtual Machine gone haywire

Sometimes a Virtual Machine can't be stopped via the VIClient. The job just hangs. There are a number of options to stop your Virtual Machine from within the Service Console. Keep in mind that these are last resort options!

  • Stopping 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 stop hard. 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.

4 opmerkingen:

daniel zei

There is a problem using PS to kill the running VM process, in that it can still leave the VM World running in the background.
Another way to stop an errant VM is to issue the commands vm-support -x to list the running VMs and their World IDs, then vm-support -X worldid (note the x is case sensitive in both commands). This then prompts the user with a couple of questions, then runs a debug stop of the VM, and creates a set of log files as well that you can forward to VMware tech support for them to check if you so desire

Erik zei

Thanks, this worked for me. I am a happy man now.
I use VM Ware Server 1.0.3 on Windows Server 2003 but the same command worked nonetheless.

Vikash Kumar Roy zei

You can also try switch force stop with vmware-cmd and it work. I had simmilar situation long time and I was able to stop it using force stop.

Vikash

id-dave zei

The kill -9 process worked perfect for me :) I wish I had tried the vm-support command first though to test it out. Environment I use is ESX 3.5 and Virtual Centre 2.5