Loading ...

| UPS Management Devices & PowerChute Software

Home » Spaces » UPS Management Devices & PowerChute Software » discussion » General » ESX 5.1 shutdown script on vMA

ESX 5.1 shutdown script on vMA

Discussion in UPS Management Devices & PowerChute Software started by Truman , 5/31/2013 12:45 AM
Login to follow, share, and participate in this space.
Not a member?Join now
Announcement 

Please review Schneider Electric Knowledge Base articles for assistance with most technical support questions.  http://www.apc.com/us/en/faqs

Posted in: General

ESX 5.1 shutdown script on vMA

Subscribe to RSS
  • tj500

    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:

    http://www2.schneider-electric.com/resources/sites/SCHNEIDER_ELECTRIC/content/live/FAQS/165000/FA165747/en_US/Configuring%20ESXi.pdf

    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:

    #!/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!!

  • tj500

    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.

  • tj500

    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

  • wpasquil

    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.

  • tj500

    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?

  • wpasquil

    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.

Page 1 of 1 (6 items)
Choose your language:  
powered by Communifire
Version 8.0.7598.8416