APC UPS Data Center & Enterprise Solutions Forum
Schneider, APC support forum to share knowledge about installation and configuration for Data Center and Business Power UPSs, Accessories, Software, Services.
Posted: 2021-07-01 03:19 AM . Last Modified: 2024-03-05 10:55 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:19 AM . Last Modified: 2024-03-05 10:55 PM
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:
Essentially I create a shell script with the following:
#!/bin/sh
#
ssh root@192.168.150.20 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!!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
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.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
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.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
Here's the output of my sshd_config file on the ESX
/etc/ssh # cat sshd_config
# running from inetd
# Port 2200
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation no
SyslogFacility auth
LogLevel info
PermitRootLogin yes
PrintMotd yes
PrintLastLog no
TCPKeepAlive yes
X11Forwarding no
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc
MACs hmac-sha1,hmac-sha1-96
UsePAM yes
# only use PAM challenge-response (keyboard-interactive)
PasswordAuthentication no
Banner /etc/issue
Subsystem sftp /usr/lib/vmware/openssh/bin/sftp-server
AuthorizedKeysFile /etc/ssh/keys-%u/authorized_keys
# 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
# unresponsive.
ClientAliveInterval 200
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
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.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
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?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:20 AM . Last Modified: 2024-03-05 10:55 PM
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.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.