inVURTED.com

With great virtualisation comes great responsibility!

[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.

  1. Logon to the ESX host where the virtual machine is running and become root.
  2. vmware-cmd -l to list all the registered virtual machines.
  3. vmware-cmd /path/copied/from/vmware-cmd getstate to 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

  4. If the vmware-cmd does not work, the next step is to kill the master user world id.
  5. cat /proc/vmware/vm/*/names |grep vmname replace vmname with the name of the virtual machine that has hung. From this list, get the 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.####. The #### numbers are the master user world id.
  8. /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.
  9. If vmkload_app does not help the next thing to try is to crash the virtual machine 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.

*