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
- Connect the USB cable
- 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)
- 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.
- 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 MachineOperating SystemVMware ESXi 6.7/VMware ESXi 6.5/VMware ESXi 6.0File TypeSoftware & UtilityVersion4.0LanguageEnglishMD569102C5C6DEED585853033E19C974FC2File Size1.10 GBDescriptionLocal 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 MachineOperating SystemVMware ESXi 6.7/VMware ESXi 6.5/VMware ESXi 6.0File TypeSoftware & UtilityVersion4.0LanguageEnglishMD57B22D1B8889776D397AC117AEEF5418BFile Size1.12 GBDescriptionRemote 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)
- 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
“) - 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:
Select “Create/Register VM”
Choose “Deploy a virtual machine from an OVF or OVA file”
Press “Next”
select the appropriate files:
Enter the name of the new VM, and press “Next”
Choose the data store and press “Next”
Choose “Tick” and press “Next”
Press “Finish” to start the import process
Configure the VM to get IP address and add USB device
- Find the Virtual machine and especially network addresss
Network address is under “General Information”
- Ensure the CyperPower USB device is added to the VM:
-
- Ensure the VM auto-starts as very first (no more option “Start earlier”) when ESXi starts:
“Actions” -> “Autostart” -> “Enable”
“Actions” -> “Autostart” -> “Start earlier”
No more “Start earlier”, so it is the first
Configure the PowerPanel security settings
- Embed the the IP address you noted above within “
http://
” and “:3052/local
“, so192.168.168.71.48
becomeshttp://192.168.71.48:3052/local
- 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
- Logon (default credentials are user
admin
and passwordadmin
, both lowercase) - Change the password
- Optionally change HTTPS settings
Configure PowerPAnel to shut down the VMware ESXi server when power is lost
-
Browse to that address: http://192.168.71.48:3052/local
-
Logon (use the above changed credentials)
Go to “Settings” -> “Shutdown Events”
Configure the “Utility power failure” event as an example
Press the “Apply” button to save the changes, then wait for
Click the little white triangle right of “Local Host Shutdown Requirements”
Setup the “ESXi” information (“Account” could be root”, ensure you have the right “Password”)
-
First hit “Verify” to check the credentials:
-
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:
- 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.
- 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:
- [WayBack] Solved: Add USB Device grayed out in ESXi 6.7 |VMware Communities
- [WayBack] Solved: ESXI 6.5 Im not able to enable my usb d… |VMware Communities
- [WayBack] Solved: ESXi 6 – Unable to connect USB Device t… |VMware Communities
- [WayBack] USB eToken – ESXi 6.5 – not working |VMware Communities
- [WayBack] See if USB drive is connected |VMware Communities
- [WayBack] USB Configuration from an ESXi Host to a Virtual Machine
- [WayBack] Add USB Devices from an ESXi Host to a Virtual Machine
–jeroen
Leave a Reply