[TUTORIAL] Force Virtual Machine to shutdown
Occassionally, when you try to shut down a virtual machine the progress bar will stop meaning that the process will never complete in the background. The following steps will allow you to force the shutdown of a running virtual machine.
- Logon to the ESX host where the virtual machine is running and become root.
vmware-cmd -lto list all the registered virtual machines.vmware-cmd /path/copied/from/vmware-cmd getstateto get state of the target virtual machine.
If the state requires an answer:vmware-cmd /path/copied/from/vmware-cmd answer
If no answer is needed:
vmware-cmd /path/copied/from/vmware-cmd stop trysoft
If trysoft does not work use
vmware-cmd /path/copied/from/vmware-cmd stop hard- If the vmware-cmd does not work, the next step is to kill the master user world id.
cat /proc/vmware/vm/*/names |grep vmnamereplace vmname with the name of the virtual machine that has hung. From this list, get the VMIDless /proc/vmware/vm/vmid value/cpu/statuswhere vmid value is the number from above.- Scroll over to the right until you find the group field that shows vm.####. The #### numbers are the master user world id.
/usr/lib/vmware/bin/vmkload_app -k 9 ####where #### is the master user world id. If the command is successful you will get a WARNING message that a signal 9 is being sent.- If
vmkload_appdoes not help the next thing to try is to crash the virtual machine with thevm-support -Xcommand. vm-support -xto get the vmid.- From a directory that has ample space
vm-support -X ####where #### is the vmid. - Answer all the questions with the default answers. The entire process takes about 10 minutes and creates an archive log that can be submitted to support. It will also crash the vm
