Posts Tagged ‘virtual machine shudtown’
At some customer sites I have to shutdown all Virtual Machines and all ESX hosts when a power failure occurs, but I didn’t find a place in which collect all informations needed to let all works.
Finally I collect all the information needed and adjust some script find all over the internet and the following is the result.
I’ve tested it on ESX Server 3.5 Update 4 with APC PowerChute Agent v2.2.3 and APC SMART-UPS 5000i UPS
The goal was to :
If a power failure occurs then wait some minutes to check if power come back, and if not :
- try to shutdown all virtual machines running on esx host with a soft shutdown command
- if soft shutdown above fail, shut them down with a hard shutdon command
- wait for virtual machine to shutdown (300 sec).
- if virtual machine is already running then do hard power off
- shutdown esx host























