Script to shutdown ESXi host
Posted on 2010-09-21
I'm looking for a script that will shutdown the ESXi host that I can tie to my UPS agent from a Windows VM. I found some command line tools that will allow me to do what I want, but here lies the dilemma:
vmcontrol.pl lets me cleanly shutdown the VM's, but has no way to shut the host down
vicfg-hostops lets me shutdown the host, but only gives me an option to either power off or suspend the VMs
I can't really use one after the other because after issuing vmcontrol, my VM will probably be shutdown before it can issue the host shutdown from vicfg-hostops
At the end of the day, I just need command that I can issue to the host that will cleanly shutdown the guests, then power off the host. Any advice on how you guys are doing this?