How to shutdown ESX/ESXi from APCUPDS using VI Perl Toolkit

VERSION 3 Published

Created on: Feb 19, 2009 1:47 AM by Steve Chambers - Last Modified:  Feb 19, 2009 2:40 AM by Steve Chambers

Introduction

 

This document is syndicated from lamw over on VMware Communities.

 

Original document ESX/ESXi APC/APCUPSD Host Shutdown VI Perl Toolkit Script

 

Many parties have looked for the possibility of monitoring power continuity and subsequently reacting to power outages with information supplied by a UPS agent installed in a virtual machine running on a free version of ESXi. Currently, one free solution How to configure ESXi to shutdown using an APC SmartUPS created by Joseph Holland facilitates shutdown/suspend procedures for online virtual machines in the event of a power outage given that there is some type of physical UPS system in place to provide backup power to the ESXi server. Joseph’s solution utilizes VMware VIMA and the open source utility apcupsd however, one needs to enable the unsupported SSH console in ESXi and setup paired SSH keys between VIMA and host to utilize it. Enabling the unsupported SSH console may not be the preferred method for some end users with respect to their support contracts held with VMware.

 

The following solution outlined in this document is similar to Joseph’s work although it will not necessitate enabling the unsupported SSH console on the ESXi hosts. This is made possible by utilizing the VI Perl Toolkit to communicate with the ESXi hosts. The only possible drawback however is that next revision of ESXi may disallow write operations and require that the user purchase ESXi license(s) to make full use of the VI API (read/write).

 

It must be pointed out that this implementation is built on top of initial findings made by Joseph Holland (APC VIOPS documentation) and Andrew Sullivan (VMware VIMA VI Fastpass disection). Please do visit Andrew’s blog at get-admin. Thanks to Duncan Epping for nudging the challenge via Twitter ;)...

 

Note: Please ensure proper testing has been performed in a staging or development environment prior to implementing this solution in a production environment.

 

Intended Audience

 

VMware Certified Professionals (VCP) and datacenter administrators.

 

Outline

This the outline of the original doc ESX/ESXi APC/APCUPSD Host Shutdown VI Perl Toolkit Script

 

  1. Requirements

  2. Usage

  3. Overview of the scripts

  4. Scenario

  5. Setup

  6. Sample output

  7. Attached scripts - upsVIShutdown.pl and ghettoShutdown.pl

 

Resources

 

 

Author

lamw, Production Support Engineer, http://engineering.ucsb.edu/~duonglt/vmware/

 

 

 

Average User Rating
(0 ratings)




There are no comments on this document

More Like This

  • Retrieving data ...