NUT Client for VMWare ESXi

VMWare ESXi

NUT is some great software for managing a UPS and notifiying all your client s to shutdown properly.  This document describes how to install a NUT client into ESXi 5 or 6 and have it shut down properly when there is a critical power outage.  The NUT client is integrated into the ESXi hypervisor and can be configured from the vSphere Client

 

This client and documentation was put together by Rene (in french here) and is not offically supported but I use it on my ESXi 5.1 hosts and it works very will. This install is not offically supported by VMWare and only works on the standalone hypervisors so if you want to install it on a production system at work, take note, this may voide your warranty.

 

Installation:

Enable SSH access to your ESXi host if it is not already enabled. This is done from the vSphere client or the console. In the Inventory selection for the ESXi host click on the Configure tab and then choose safety profile.  In the services section, click on properties and start up SSH.

Services

SSH into the server.  We are going to copy the NUT client install file into the /tmp directory.  I am going to use wget but any way you want to copy the file into that directory will work.  You can find the install file here.

# cd /tmp
# wget http://rene.margar.fr/1483/NutClient-ESXi-2.1.1.i386.tar.gz

The next step is to unpack the file and run the install script.

# cd /tmp
# tar -xzf NutClient-ESXi-2.1.1.i386.tar.gz
# sh upsmon-install.sh
Result Installation
Message: Operation finished successfully.
Reboot Required: false
VIBS Installed: Margar_bootbank_upsmon_2.7.4-2.1.1
VIBS Removed:
VIBS Skipped:

You do not need to repoot to start using the NUT client however you will need to configure it.

Configuration:

Login to your ESXi host using the ESXi vSphere client.  Click on the Manage menu option under the Host in the menu.  Select the System tab and then the advanced setting. Once the advanced setting window pops up then select UserVars on the left hand side and scroll down until you see the NUT variables.

uservars.jpb

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

Service Lauch

Using the vSphere client, go to the host configuration tab for the ESXi host and select security profiles and then properties.  Find the properties for the Network UPS Tools Client and start it up.  You can also set it to start all the time.

NUT Startup

tips

Use the ESXi host configuration tab in the vSphere Client to decide the starting order and stopping (or suspension) of virtual machines. This order will be respected by the shutdown of UPS alert.

The clean shutdown of OS in virtual machines is only possible if the vmware tools are installed.

To uninstall the NUT client, use the upsmon-remove script located in the file that you downloaded:

# cd /tmp
# sh-remove upsmon

To estimate the time required for the server to turn off alert on UPS type the command “fsd upsmon -c” on the ESXi host (ssh or console). The shutdown procedure is launched immediately.

 

Leave a Comment

Your email address will not be published. Required fields are marked *