The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,418 other followers

Automatically shutting down an ESXi 6.7+ server from a CyberPower UPS using the PowerPanel Business Edition 4.x

Posted by jpluimers on 2021/07/09

Unlike the name PowerPanel Business Edition, this is a free tool. It allows you to manage your CyberPower UPS and to shutdown various systems, including an ESXi host.

It took CyberPower from version 3.3 to version 4.0 of the PowerPanel software to support ESXi 6.7. Reason was that VMware ESXi 6.5 was the latest version supporting vMA:

Below the steps to get PowerPanel 4.x up and running on ESXi 6.7+.

First of all, you have to ensure your CyberPower is connected to ESXi via USB.

Then you need to download and install the CyberPower virtual appliance “PowerPanel Business”

When the appliance runs, you have to virtually plugin the USB.

Finally configure the virtual appliance.

Ensuring the CyberPower UPS is listed as USB device

  1. Connect the USB cable
  2. Verify from the ESXi console it is available:
    [root@ESXi-X9SRI-3F:~] esxcli hardware usb passthrough device list
    Bus  Dev  VendorId  ProductId  Enabled  Can Connect to VM          Name
    ---  ---  --------  ---------  -------  -------------------------  -----------------------------------------------------------------------
    2    3    21c4      8005         false  no (passthrough disabled)  Intenso Intenso Micro Line
    [root@ESXi-X9SRI-3F:~] lsusb
    Bus 002 Device 004: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
    Bus 002 Device 003: ID 21c4:8005  
    Bus 001 Device 003: ID 0557:2221 ATEN International Co., Ltd Winbond Hermon
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 001: ID 0e0f:8002 VMware, Inc. Root Hub
    Bus 001 Device 001: ID 0e0f:8002 VMware, Inc. Root Hub
    [root@ESXi-X9SRI-3F:~] 

 

Downloading the virtual appliance

Perform the download on a Windows or MacOS machine (you cannot deploy the OVF from a datastore, despite ESXi wget now understanding the https protocol)

  1. Download from [WayBack] PowerPanel® Business for Virtual Machine | CyberPower after reading the explanation on what you need (Local and Remote might seem contrary to what you need):
    • Use Local (Agent) if you connect the computer to the UPS with a USB or Serial cable. Local (Agent), which is the primary means of communication for a basic setup between a computer and the UPS, supports a limitless number of clients.
    • Use Remote (Client) if you connect the computer via your network to the RMCARD installed in the UPS or on a secondary computer connected to the UPS, with a Local (Agent) computer already connected. The RMCARD manages as many as 50 clients.
    • Use Management (Center) when you want to monitor and manage all the CyberPower power protection products on your network. The Management (Center) role supports a limitless number of devices.
  2. Click on “Download” under “PowerPanel® Business Local for Virtual Machine” for version “4.0”, which at the time of writing was www.cyberpower.com/global/en/File/GetLargeFileByPath?docId=SU-19010001-07 (redirecting to www.cyberpower.com/global/en/File/GetLargeFileByPath?docId=SU-19010001-07)
    File NamePowerPanel® Business Local for Virtual Machine
    Operating SystemVMware ESXi 6.7/VMware ESXi 6.5/VMware ESXi 6.0
    File TypeSoftware & Utility
    Version4.0
    LanguageEnglish
    MD569102C5C6DEED585853033E19C974FC2
    File Size1.10 GB
    DescriptionLocal module.
    VMware vSphere ESXi VM requirements: CPU: 1; Memory: 2G; Disk: 20G; Virtual Appliance OS: CentOS; OS Username/Password: admin/admin; PowerPanel® Software Username/Password: admin/admin.
    • Note this is different from “Download” under “PowerPanel® Business Remote for Virtual Machine” for version “4.0”, which at the time of writing was www.cyberpower.com/global/en/File/GetImageByDocId/SU-19010001-08 (redirecting to www.cyberpower.com/global/en/File/GetLargeFileByPath?docId=SU-19010001-08)
      File NamePowerPanel® Business Remote for Virtual Machine
      Operating SystemVMware ESXi 6.7/VMware ESXi 6.5/VMware ESXi 6.0
      File TypeSoftware & Utility
      Version4.0
      LanguageEnglish
      MD57B22D1B8889776D397AC117AEEF5418B
      File Size1.12 GB
      DescriptionRemote module.
      VMware vSphere ESXi VM requirements: CPU: 1; Memory: 2G; Disk: 20G; Virtual Appliance OS: CentOS; OS Username/Password: admin/admin; PowerPanel® Software Username/Password: admin/admin
  3. The download should get “PPB Local_Virtual Machine_v4.0.zip” (if it is a different name, rename it to “PPB Local_Virtual Machine_v4.0.zip“)
  4. Recursively unzip "PPB Local_Virtual Machine_v4.0.zip", which will get you these files:
    ppb400-local-disk1.vmdk
    ppb400-local.mf
    ppb400-local.ovf
    

Install the OVF template (from a Windows or MacOS machine)

Install the OVF from the unzipped files:

  1.     Select “Create/Register VM”
  2.      Choose “Deploy a virtual machine from an OVF or OVA file”
  3.      Press “Next”
  4.       select the appropriate files:
  5.      Enter the name of the new VM, and press “Next”
  6.     Choose the data store and press “Next”
  7.      Choose “Tick” and press “Next”
  8.      Press “Finish” to start the import process

Configure the VM to get IP address and add USB device

  1. Find the Virtual machine and especially network addresss
    1.     Network address is under “General Information”
  2. Ensure the CyperPower USB device is added to the VM:
    1.  
  3. Ensure the VM auto-starts as very first (no more option “Start earlier”) when ESXi starts:
    1.     “Actions” -> “Autostart” -> “Enable”
    2.     “Actions” -> “Autostart” -> “Start earlier”
    3.     No more “Start earlier”, so it is the first

Configure the PowerPanel security settings

  1. Embed the the IP address you noted above within “http://”  and “:3052/local“, so 192.168.168.71.48 becomes  http://192.168.71.48:3052/local
  2. Browse to that address: http://192.168.71.48:3052/local
    • Note that loading this page the first time can take quite a while: the VM needs to do some warm-up
  3. Logon (default credentials are user admin and password admin, both lowercase)
  4. Change the password
  5. Optionally change HTTPS settings

Configure PowerPAnel to shut down the VMware ESXi server when power is lost

  1. Browse to that address: http://192.168.71.48:3052/local

  2. Logon (use the above changed credentials)


  3. Go to “Settings” -> “Shutdown Events”


  4. Configure the “Utility power failure” event as an example


  5. Press the “Apply” button to save the changes, then wait for


  6. Click the little white triangle right of “Local Host Shutdown Requirements”


  7. Setup the “ESXi” information (“Account” could be root”, ensure you have the right “Password”)

  8. First hit “Verify” to check the credentials:

  9. Finally hit apply “Apply” to save:

    (oops: took the screenshot too late <g>)

More power events

See the [WayBack] PowerPanel® Business for Virtual Machine | CyberPower documentation download WayBack] UM_PPBE for ATS_ig_en_v5.pdf and [WayBack] PPBE+User’s+Manual+-+English.pdf for more power events.

I have set these:

  • Utility power failure
    • 40 minutes (as I know the battery has enough capacity for the load to safely sustain this period)
  • Available runtime is insufficient
    • Instant (I want to shut down really soon because it means something went very wrong with my calculated run-time estimates)
  • Remaining runtime will be exhausted
    • 30 seconds (I want to shutdown less soon here, as my calculations might be wrong)

If you forgot to plug in the USB cable

There are two occasions where the “USB device” is greyed out:

  1. When there is no USB cable plugged in, you cannot plug in the virtual USB device.
    • To resolve this, plug in the USB cable, and retry adding the USB device to the VM.
  2. Sometimes you cannot plug in the virtual USB device, even though the cable is plugged in.
    • To resolve this, pull the USB cable, and plug it in a different USB socket.

References

Below are some links on where I got the information on the commands to list the USB devices, and how to enable devices that cannot be passed through by default:

–jeroen

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: