I posted this to an existing discussion on the same subject. Though the topic was about ESXi 4, it was actually in the 3.5 section.
I've been looking at options for shutting down an ESXi 4 (Update 1, free) host after power failure. APC does have a version for ESXi 4 now, but APC 's compatibility chart notes that it does NOT support the free version of ESXi.
I've got a UPS with a network management card, and it's currently configured to power off all the VMs. But there's nothing set up to power down the ESXi 4 (Update 1, free) host.
As far as I can tell, there is no officially-supported way of shutting down the ESXi 4 (Update 1, free) host via anything other than direct access to the console.
I've read through the documentation for the remote CLI here ( http://www.vmware.com/pdf/vsphere4/r40/vsp_40_vcli.pdf ) and there is no mention of any commands related to controlling the host's power state.
I'm currently looking at this page http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1013193 .
At the bottom, there's a block thatrefers to shutting down an ESXi 4.0 host via the vMA or vCLI.
To shut down ESX 4.0 or ESXi 4.0 hosts, run the following command from vMA or vCLI console screen:
/usr/lib/vmware-vicli/apps/host/hostops.pl --target_host <ESX-Host> --operation shutdown --url
I've installed the VMware vSphere CLI 4.0 U1, which does in fact include a hostops.pl (in .....\VMware vSphere CLI\Perl\apps\host\ ).
A quicklook through hostops.pl shows that issuing a shutdown command through hostops.pl appears to attempt to suspend all VMs on the host and then shutdown the host itself. I can plop in the IP for the ESXi 4 host into the URL listed in the --url parameter, and there is a vimService.wsdl file accessible there. It looks like it's just a small (~12 lines total) XML file that defines a few things.
What I need to know is whether or not the VMware vSphere CLI 4.0 U1 can in fact use the hostops.pl file that it comes with in order to shutdown
a ESXi 4.0 (Update 1, free) host. I see that hostops.pl doesn't provide any of thst standard connection options. If hostops.pl is indeed supported in VMware vSphere CLI 4.0 U1, then I assume it must be necessary to include them (otherwise anyone could shut down your hosts!). Is the example given assuming the command is being run from vMA (and thus doesn't need the --user and --password parameters)? Would I need to specify --server as well, or is it made redundant by --target_host?
According to the documentation I've read, I should be able to open up a command prompt and fire off
hosts.pl --server IP --user user --password pw --target_host IP --operation shutdown --url https://IP/sdk/vimservice.dll
I've seen nothing obvious in the documentation stating that the above would not work with ESXi 4 (Update 1, free) and VMware vSphere CLI 4.0 U1.
If this works, then I can simply use any one of the existing APC PowerChute Network Shutdown installations to run the above command.
Though given all the questions about ESXi and UPS-triggered shutdowns, I simply can't believe the solution would be so simple.
If there is a licensing or configuration restriction that would prevent this from working, it certainly isn't clearly or obviously stated in any of the documentation.
So, after all that, will it work?
I'm not willing to blindly test it on our production boxes if it's not supported, if the hosts.pl I have is differet, etc.