Performing emergency shut down of VM's on ESX

From VI-Toolkit
Revision as of 13:54, 22 August 2009 by Wila (talk | contribs) (added VMware kb 1007934 Performing an emergency shutdown of all powered-on virtual machines on an ESX host)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Emergency shut down of all VM's on a host

author: VMware

Description

Gives you the possibility to quickly and cleanly shut down all the VMs on your host with only console access.

Script:

Run the following with root privileges:

cat /proc/vmware/vm/*/names | awk -F= '{a=substr($4,$1,length($4)-6); b="vmware-cmd "a" getstate"; print b; system(b); c="vmware-cmd "a" stop"; system(c); } END { print "Number of Machines: "NR;}'

Location

http://kb.vmware.com/kb/1007934