Hey all I'm back again!
Please reference http://forums.apc.com/thread/14127 for my previous thread related to this.
We have an HP Proliant ML350P Gen 8 with an ESX 5.1 installed on it. We will eventually be converting a Windows Server 2003 VM on it and we need to add a graceful shutdown option to the server. We bought a SmartUPS 1500 to manage the power for the server. I then followed the instructions found here in the link below to install vMA and set up PowerChute Business Edition:
The server is connected to the UPS via a Serial to RJ-45 cable and we are using PCBE 9.1.0 as the UPS manager program. I get everything installed and configured the shutdown order of the machines on the vSphere. I am now creating the shutdown script through the instructions shown on this link:
Setting up an APC UPS in ESXi
Essentially I create a shell script with the following:
ssh email@example.com halt
(192.168.150.20 is the ESX host address). It should also be noted that we have shared keys that allow root login without a password to the ESX host (I know this is a security risk but I can find no other way to get this to work). I save this as 'ServerShutdown.sh' in the PCBE directory (/opt/APC/PowerChuteBusinessEdition/Agent/cmdfiles) and then use sudo chmod +x ServerShutdown.sh to add the permissions for executing it. Once I do so it shows up in the list of command files in the web browser session for PCBE as expected (Under Shutdown settings). However when I apply the changes and try to test a shutdown nothing happens. I unplug the UPS from the wall and it doesn't perform a graceful shutdown. The strange thing is that when I run the shell from the command line without using the sudo prefix it works (I just type 'sh ServerShutdown.sh'). Is there some special permission we have to set to allow the script to run from the PCBE agent?
I hope I didn't drone on too long I just want to make sure you have enough details to solve the problem without having to ask for more info! Thanks in advance for the help!!
As an update, I tried adding chmod 777 to the ServerShutdown.sh document to see if that would help, but no luck. Strange this is I had this thing working before I lost communications with the UPS as shown in my referenced article above. So thinking that I may have done something weird to the config I recreated a test vma machine and tested it that way. Still no luck. Maybe there's some configuration I have to do on the ESX itself? Just throwing out more ideas that may help clarify the situation.
Here's the output of my sshd_config file on the ESX
/etc/ssh # cat sshd_config
# running from inetd
# Port 2200
# only use PAM challenge-response (keyboard-interactive)
Subsystem sftp /usr/lib/vmware/openssh/bin/sftp-server
# Timeout value of 10 mins. The default value of ClientAliveCountMax is 3.
# Hence, we get a 3 * 200 = 600 seconds timeout if the client has been
Why are you writing the script? PowerChute runs on the vMA and shuts down the host via RCLI. There is no need to script the shutdown yourself.
Bill, thank you for the reply. Before I put on the script I tried unplugging the UPS to test the graceful shutdown and it did not work. I can try again but are there any other settings I need to have?
Did PowerChute record the loss of AC power in the event log? If it did then depending on your configuration the Host should have been notified to power down. Are you running a licensed version of ESXi or are you running the free version? PowerChute communicates to the host via RCLI and VMware disables RCLI in the free version of ESXi.
Choose a location