Ramblings From The Litter Tray of Life

Installing APC Shutdown Agent on ESX 3.5

Posted by graycat on 7 May 2010

If you’ve got a VMware host then you’ll be running it on some kind of UPS …… I hope! Personally we use the various APC offerings and need to make sure the host and virtual machines are all covered in case of a poweroutage.

Handily enough, APC have provided a single server licensed application that you can install on the host and have it deal with the UPS and shutting down / starting the virtual machines back up. Here’s how I did it:

Firstly download the application from APC and upload it onto your VMWare host. I’ve got a folder on the host for iso images so just dropped it in there using the VMWare Infrastructure Client to do so. Once I’d done this I did connected to the host via ssh and located the directory and copied the install tar file over to /downloads
find / -name ISOs
cp /vmfs/volumes/4798efa5-f7531804-98d6-001b789b7576/ISOs/pcns224esx.tar.gz /downloads/

Now that’s all done I had to reset the file permissions
cd /downloads/
chmod 777 pcns224esx.tar.gz

unzip and then untar the tarball as follows
gunzip pcns224esx.tar.gz
tar -xf pcns224esx.tar

You will then have a bunch of files looking like this:

[Admin@vmhost01 downloads]$ ls -la
total 65432
drwxr-xr-x 2 root root 4096 Apr 30 09:52 .
drwxr-xr-x 21 root root 4096 Mar 20 13:32 ..
-rw-r–r– 1 root root 60691 Oct 8 2009 install.htm
-rwxr-xr-x 1 root root 33214 Oct 8 2009 install.sh
-rw-r–r– 1 root root 31451007 Oct 8 2009 jre1.5.0_18_linux.tar.gz
-rwxrwxrwx 1 root root 33454080 Apr 30 09:46 pcns224esx.tar
-rw-r–r– 1 root root 1868101 Apr 30 09:52 pcns224.tar.gz
-rw-r–r– 1 root root 24647 Oct 8 2009 relnotes.htm
-rw-r–r– 1 root root 1132 Oct 8 2009 silentInstall.sample

Run the install script
./install.sh

You’ll then be faced with an EULA to agree to and a bunch of configuration questions which will probably look a bit like this:
Do you agree to the above license terms? [yes or no]
yes

Please enter the PCNS instance number [1|2|3] or press enter to use default value of 1:

1 PCNS instance(s) will be installed.

Please enter the installation directory or press enter to install to the default directory (/opt/APC/owerChute):

Are you sure you want to install PCNS to /opt/APC/PowerChute [Yes|No]?
yes
Creating /opt/APC directory …
PCNS will be installed to /opt/APC/PowerChute
Copying the installation files …
Extracting PCNS files …
PCNS is extracted to /opt/APC/PowerChute

Please enter java directory if you want to use your system java (example:/usr/local/bin/jre/jre1.5.0_8) or press enter to install the bundled Java:

Copying jre to /opt/APC/PowerChute/jre …
Extracting jre to /opt/APC/PowerChute/jre …

java version “1.5.0_18”
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) Client VM (build 1.5.0_18-b02, mixed mode, sharing)

JAVA_DIR=/opt/APC/PowerChute/jre/jre1.5.0_18

Configuring startup files …
Startup script=/etc/rc.d/init.d/PowerChute
Updating Linux symbolic link …
Configuring uninstall script …

Completed.
Please run the PCNSConfig.sh script located within the PCNS installation directory to complete the intallation.

Once you’ve followed that all the way through (it doesn’t take that long, honest!) you’ll be on to installing the PCNS side of things. This is hiding under /opt/APC/PowerChute/group1/PCNSConfig.sh in case you can’t find it. Run that script and follow the wizard to finish the install like this:
[root@vmhost01 group1]# ./PCNSConfig.sh

————————————————–
PowerChute Network Shutdown Configuration Utility
————————————————–

Press Ctrl + C at anytime to abort.

Configuring PowerChute Network Shutdown …

[1]: Configure for a single UPS device
[2]: Configure for a parallel Silcon UPS / Smart-UPS VT / Gala
[3]: Configure for multiple Smart-UPS or Galaxy devices
[4]: Configure for multiple Symmetra devices

Please select the appropriate configuration type (1) [ 1 – 4 ]

Management Card IP: 192.168.48.137
Management Card Port # (80):
Administrator User Name: apc
Administrator Password:
Authentication Phrase (default):

Setting Summary:

Management Card IP: 192.168.48.137
Management Card Port #: 80
Administrator User Name: apc
Administrator Password: [ MASKED ]
Authentication Phrase (default): [ MASKED ]

Do you wish to register these settings [ Yes | No | Abort ]? y

Registering PowerChute Network Shutdown with the management ca
PowerChute Network Shutdown registration completed successfull

Do you wish to start the PowerChute Network Shutdown service [
PowerChute Network Shutdown service started.

Configuration completed.

At this point you’ve just got to configure the VMWare side of things so it can shutdown the hosts properly in case of a power outage. This is actually the easiest bit.

1. Go to the vCenter Server, and for each ESXi host, select “Virtual Machine Startup/Shutdown”.
2. Change the Virtual Machine Shutdown setting from “Turn off” to “Guest Shutdown”.
3. Specify the shutdown order, by arranging guest VMs in “Startup Order”. (Shutdown order is the reverse of startup order).
4. Click OK to accept the changes.
5. Change the “Any Order” option to “Manual Startup” for all the VMs.
6. Change the “Startup” settings to “Disabled” for all the VMs.

And whilst you’re at it you may was well sort the startups out as well:
1. Go to the vCenter Server, and for each ESXi host, select “Virtual Machine Startup/Shutdown”.
2. Move all guest VMs to “Manual Startup” from “Any Order”
3. Change the “Startup” settings to “Disabled” for all VMs.
4. Click OK to accept the changes.

Now just go and unplug the UPS from the mains to test …….. ONLY JOKING!!!!

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: