inVURTED.com

With great virtualisation comes great responsibility!

[TUTORIAL] Stopping a Virtual Machine

VMware has added a new command in VI3 to help when a user has a VM that has become unresponsive. Below are the progressives steps to go through to get the VM cleanly powered off. Whatever you do, DO NOT kill the pid for the VM from the Service Console, unless you have tried absolutely everything. Killing the pid from the Service Console may prevent the VM from restarting.

The following steps assume that the usual graceful shutdowns do not work from within the VM operating system or the Virtual Infrastructure Client. Commands are bold underscore type, with descriptions of path names and some example output is included.

  1. Logon to the ESX host where the VM is running and become root.
  2. vmware-cmd -l to list all the registered VMs.
  3. vmware-cmd /path/copied/from/vmware-cmd getstate to get state of vm.
    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: vmware-cmd /path/copied/from/vmware-cmd stop hard
  4. If the vmware-cmd does not help next up is to kill the master user world id
  5. cat /proc/vmware/vm/*/names |grep vmname where vmname is the vm that is hung and find the value for vmid
  6. less /proc/vmware/vm/vmid value/cpu/status where vmid value is the number from above
  7. Scroll over to the right until you find the group field that shows vm.#### where the #### numbers after vm. will be the master user world id
  8. /usr/lib/vmware/bin/vmkload_app -k 9 #### where #### is the master user world id. If successful you will get a WARNING message that a signal 9 is being sent
  9. If vmkload_app does not help next up is to crash the vm with the vm-support -X command
  10. vm-support -x to get the vmid
  11. From a directory that has ample space vm-support -X #### where #### is the vmid
  12. 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.
Tagged as: , ,

Leave a Response

Please note: comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

*