I’ve been waiting for APC to create a VIMA ready package of their PowerChute Network Shutdown software for a while now. It’s supposed to be released soon but I haven’t heard a release date yet.
For everyone that can’t wait VMTN User “jholland” created this PDF “How to configure ESXi to shutdown using an APC SmartUPS“. It’s a great creative solution that shuts down your vm’s and host when a power failure occurs keep in mind you need a UPS with network management capabilities. In short:
- add a script to your ESXi box and enable ssh with public key authentication
- add a debian VM
- install APC UPS daemon
- edit the APC UPS daemon config file which calls the script(1.) via ssh/public key
I guess the APC solution will work in a similar way by the way, but the APC solution will be full supported and this solution clearly isn’t cause you would need to alter ESXi. (The APC solution will use the RCLI/Perl toolkit probably)
I can imagine you would want to use it anyway. Thanks to jholland for creating this PDF, it’s his first post I hope there’s more to come! (By the way, it isn’t that difficult to apply this information on VIMA. I might test it out this week and update you guys)
Darlin says
We have a small VM with Debian + Network UPS Tools.
The shutdown is done by a Perl Script over the Perl API.
Works great.
John van der Sluis says
I’ve designed a similar setup for a customer in 2006 on vmware 2.5.3 and a APC Symmetra 40K. I had to setup a Red Hat 9 helper vm for the purpose of PowerChute Network deployment on ESX. The most diffucult part was configuring the InfrastruXure Manager and the specific UPS shutdown parameters like the Return Battery Capacity, Low-Battery Duration and Shutdown Delay values. You have to think about which situation you want a shutdown of your machines. In the event of a power outage you dont want to shutdown machines right away if you have a UPS that can sustain a 5 minute power outage.
The result was a fully controlled shutdown of VMs in a specific order and the ESX hosts in the event of a 10 minute power outage. Sadly we couldnt fully test it.
John.
Tom says
Please do consider working on this in VIMA as you suggest you may do. It would help a lot of people, as would any clarifications you can provide about the 2.2.3 version which everyone has had to pay for.
Eric van der Meer says
Because of the slow response from APC and their software we now only sell HP UPS in combination with VMware ESX and HP EVA.
I really don’t understand why APC don’t release a new version of the VMware ESX agents for the APC PowerChute Network Shutdown.
Thanks for the share though!
jholland says
@Tom – I am currently re-writing the tutorial for upload to http://viops.vmware.com, I am including how to install the apcupsd software within VIMA. About the 2.2.3 version of PCNS, I don’t use it in this tutorial. The abilty of the SmartUPS to send PCNS shutdown commands is there in the UPS regardless of whether you buy a license to install PCNS on Windows/Linux/whatever. Also because we are sending a shutdown command from the host itself to shutdown the VMs, you don’t need PCNS installed on the guests, just the VMTools so the host can shut the guests down gracefully.
Thanks Duncan for sharing this with everyone.
matrix_a123 says
To all,
I was testing the ESXi’s VIMA server, which is a cut-down version of Red Hat Ent linux, also used the APC’s PCNS for VIMA and had to give it up as my client’s sites don’t all contain APC UPS devices. So my recommendation was move into using the Network UPS Tools (or NUT V2.0.3) software, it works! I have scripts to monitor each UPS, a few modified perl toolkit scripts to shutdown VMs, iSCSI SAN and the hosts/cluster.
Rob.C.
Simone says
matrix_a123: can you share the NUT scripts / istructions ?
VMSysProg for over 30 years says
Too often VMware and APC were at odds with versions of ESX and ESXi and whether the APC support via client or API was compatible. I’ll list the solution (just focusing on ESXi for obvious reasons now).
Our vCenter Server groups all the ESXi servers as individual “folders” which can be addressed by scripts in order of priority. Example folders names are below.
– Production
– Accept and Development
– Web and DMZ
– Infrastructure
– Recovery
Because of the folders, we can shutdown every VM in the order of priority just using Shutdown-VM on every VM on an ESXi hosts within its folder, and also the VM as long as the managing vCenter Server and the “Control-VM” Windows server with the script on it doesn’t exist on the ESXi server.
For almost 5 years we look approach as follows:
1. Maintain two vCenters controlling our ESXi v.next and ESXi v.current environments. Each has its folders setup so the most important VMs are shutdown in case due to some strange fate, the UPS system gets enough power to start but eventually not enough power in its batteries to stay up long enough for all VMs to be shutdown gracefully.
2. Under each VMware ESXi Farm, maintain a single Windows VM, with the correct PCNS agent that will get signal from UPS (in our case, we have locations with Symmetra 80K and Smart-UPS X 3000).
3. Upon power loss, the UPS sends out the signal to the APC agent in the Windows VM
4. In our case, without generator at either location, we just shut down if power is out for 2 minutes — as it rarely returns if out for more than 90 seconds.
5. We use PowerShell / PowerCLI to per shutdown
On each Windows VM we have a batch file and PowerShell script ready to run under a predefined dedicated Active Directory account with admin priveleges.
The APC agent run a Windows batch file that launches PowerShell with all the normal settings including full path to PowerShell script
The PowerShell script uses folders as mentioned about.
We are in the process of presenting the scripts at a NY area user group and then posting them (in April). I’ll post the location once it is agreed to.
Larry Timmins
(@ g ma il)
VMSysProg for over 30 years says
Quick edit:
Because of the folders, we can shutdown every VM in the order of priority just using Shutdown-VM on every VM on an ESXi hosts within its folder, and also [each ESXi server in that folder] as long as the managing vCenter Server [VM] and the “Control-VM” Windows server [VM] with the script on it doesn’t exist on the ESXi server.