Blog

Enable UPS via USB Support on ESXi 5 and 6 and Synology DSM

An updated version for ESXi 6.5 including the Synology side is located here.

This HOWTO is possible thanks to Renes work.

The original story and program is here: http://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/

Additional information: http://lab.piszki.pl/synology-network-ups-nut-and-esxi-5-5/

My setup is:

Synology (xpenology running in a vm on an ESXi 6 host). The Synology has the USB passed from the APC UPS device.

UPS support is enabled on the Synology and the NetUPS feature is exposed and made available to other IPs, such as the ip of the ESXi host itself.

ESXi 6, stand alone edition

Enable UPS on Synology

or applicable Network UPS instance

enable-ups-on-synology.png

Download the binary

Download the vib binary from the author’s site: http://rene.margar.fr/downloads/NutClient-ESXi500-1.3.0.tar.gz

Or use wget from the ESXi host and download directly to the host.

Copy

Copy the file to the /tmp folder or download directly using wget.

copy.png

Extract

tar -xvzf NutClient-ESXi500-1.3.0.tar.gz

You can also download directly to the host using wget (as shown in the screenshot below).

extract.png

Prereqs

Ensure the acceptance level for vibs are set to community

[[email protected]:/tmp] esxcli software acceptance get

esxcli software acceptance set –level=CommunitySupported

prereqs.png

Install the upsmon

Ensure the script is executable

Install upsmon by running the install script: ./upsmon-install.sh which does take some time.

Reboot the server for the variables to become available in the UI

install-the-upsmon.png

Configure upsmon via VMWare UI

Configuration is location at UserVars.Nut[xxyy] keys and can be set via either VMWare clients. Here I’ve used the Web UI client.

  • UserVars.NutUpsName : Inverter name on NUT server (as nom_onduleur @ nom_ou_ip_serveur). Several inverters can be entered separated by a space.There will be no system shutdown until the last still standing inverter will not have given the order to stop.
  • UserVars.NutUser : Name of the login account NUT server
  • UserVars.NutPassword : Password logon account the NUT server
  • UserVars.NutFinalDelay : Seconds that it will be after receiving low battery event to complete system shutdown
  • UserVars.NutSendMail : A set to 1 for the NUT customer sends an email to each important event of the inverter
  • UserVars.NutMailTo e-mail address to which to send the events of the inverter
configure-upsmon-via-vmware-ui.png

Service autostart with host

service-autostart-with-host.png

Firewall

firewall.png

Check configuration

The configuration from the uservars are added to the end of the template content.

MONITOR [email protected] 1 [ups_username] [ups_password] slave

FINALDELAY 30

check-configuration.png

Enable service startup

enable-service-startup.png

Verify connectivity with NUT server

upsc [email protected]

verify-connectivity-with-nut-server.png

Optional: Set default configuration directly from installation script

The installation script sets default values which can be set in order to avoid to have to restart the ESXi host during installation, since the values are not visible in the UI unless the host is rebooted.

optional--set-default-configuration-directly-from-installation-script.png