configure esxi shutdown in case of power loss (HP UPS)

These steps are necessary to implement a graceful shutdown of an vSphere environment. For this scenario you need supportet HP UPSs for HP Power Protector.

Preparation

  • First: think about timing
    • how many seconds/minutes after power loss the hosts should start to shutdown?
    • how long do a host to shut down? This question is about how long does the slowest VM needs to shutdown.
  • Download HP Power Protector Agent for Linux here. Current version: 1.02.31
  • Download VMware Management Assistant (vMA) suitable for your vSphere environment here for 5.5
  • IP addresses for UPS management module und each vMA

Installation

  • Assign IP address to HP management module installed in HP UPS
    either the module gets an DHCP address or you need to connect by use of serial connector
  • A vMA has to be deployed on every host that should do a graceful shutdown in case of power loss.
  • Install HP Power Protector Agent for Linux in vMA
    • copy agent onto vMA
    • install agent: sudo rpm -i hppp-linux-1.02.031-1.x86_64.rpm
      respectively current version number
    • login: http://IP-vMA:4679/ or https://IP-vMA:4680/ (user: admin/admin)
    • choose Client Installation
    • Default installation path: /usr/local/HP/PowerProtector
    • RPM-Package name: hppp-linux-1.02.031-1 respectively current version number

 Configuration

  • Automatic discovery of administrator (module) and client (linux agent) normally works fine. If not, scan for administrator in client.
  • If the UPS is discovered and show with status not managed, right-click the UPS and configure Power Sorce. The status has to be OK.
  • UPS Network Module should show the discovered devices as Notified Applications.
  • HP Power Protector Agent
    • copy script (in my case: ShudownESXi.sh) to shut down all VMs running on that host to /usr/local/HP/PowerProtector/bin/virt-tools
      [ShutdownESXi.sh is s very simple script to shut down all VMs, but the vMA itself, and the host afterwards. You can’t use cluster-settings to shut down VMs on an cluster with HA enabled. If you don’t have an own script to do this task, leave a command and I will email the script]
    • configure Event Actions as necessary (SMTP)
    • configure Shutdown Parameters
      • time settings as considered
      • Shutdown type: script
      • Shutdown script/bin/su - vi-admin -c "/usr/local/HP/PowerProtector/bin/virt_tools/ShutdownESXi.sh vMA_ESXi_IP"
    • Test Shutdown

Upgrading Power Protector Agent

  • upgrade agent: sudo rpm -U hppp-linux-1.03.041-1

Uninstallation of Power Protector Agent

  • uninstall agent: sudo rpm -e hppp-linux-1.02.031-1
  • because of a known issue, uninstalling the packate does not remove the software completely. Therefore remove also all files within /usr/local/HP
Advertisements
configure esxi shutdown in case of power loss (HP UPS)

85 thoughts on “configure esxi shutdown in case of power loss (HP UPS)

  1. Angelo Vtr says:

    Hi
    thanks for your useful post, could you send me script please?
    could you use vicfg command or something similar?
    I note this for vMA:
    vicfg-hostops.pl –server ip_address –username root –password password –operation shutdown

    but you need to sent the “enter” command before to put host in maintenance mode, it is not a useful mode because when host came up again won’t start VMs automatically because of mant. mode status.

    Like

    1. Angelo Vtr says:

      Hi guys,
      after several research i found a useful script into this path of vMA
      /usr/local/HP/PowerProtector/bin/virt_tools/shutdownESXi.pl
      I had to go on the top of the montain to get back to level ground 🙂 🙂

      I used this script into HPP web console shutdown parameters
      perl /usr/local/HP/PowerProtector/bin/virt_tools/shutdownESXi.pl –server xxxxxxxx –username root –password xxxxxxxx

      Adding “perl” at the beginning it worked perfectly for my environment (no Cluster, No HA) you have to try with HA enabled.
      here a useful link too
      http://h20564.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c03600516&sp4ts.oid=5106149

      Thanks again to Wolfgaung to pointing me on the right way

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

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