[Nut-upsuser] issue SHUTDOWNCMD from a slave

Charles Lepple clepple at gmail.com
Tue Nov 30 02:21:25 GMT 2021

On Nov 29, 2021, at 11:58 AM, Ken Brubacher wrote:
> Is it possible to issue a SHUTDOWNCMD command from a slave or only from a master?
> The scenario is a Dell R740 hypervisor, and I’d like NUT server to run as a virtual machine on it, and shut down the host from the virtual machine NUT server. So the NUT server VM would issue a shut down command to the slave installed on the Dell hypervisor DOM0. I want SHUTDOWNCMD on the Dell slave hypervisor to issue the shutdown command to the UPS, as the NUT server master will have been shut down by the host slave by then.  The other option would be to install NUT server in DOM0 on the hypervisor which I’m not excited about.

Slight clarification, SHUTDOWNCMD can shut down either a master or a slave system, but in all of the cases I can think of, only the master system has the connection to the UPS (that is, the connection to tell the UPS to cut power to the outlets), and you're right that it is typically triggered by the SHUTDOWNCMD.

Think of the NUT master system (the one running the driver) as being a multiplexor for single-user UPS hardware. This makes more sense when the UPS has a single USB or serial port for control, but it also helps if you have a network card (running SNMP, for instance). In the case of a network connection, you might be able to have a non-master system shut down the UPS after the master system is down, but if you are doing this from NUT, you would need to be sure that the non-master driver configuration is only used at shutdown time ($DRIVER -k). Most of the NUT example configurations are written assuming the master stays up longer than the slaves, in order to keep that hardware connection to the UPS to request the power to be removed.

I have heard of people doing something similar with ESXi, and having NUT master/slave running on one of the guests. The key is probably having the master guest VM request a delayed shutdown of both the hypervisor and the UPS. You will want to make sure your UPS supports the delay values needed to make this work (for instance, CyberPower UPSes round down to the nearest minute: https://github.com/networkupstools/nut/issues/432 ), and that the UPS doesn't have a race condition if the power comes back in the middle of a delayed shutdown (see NUT FAQ).
> I’m very aware this is a non standard setup. Is there other better ways to accomplish this without running something like a Raspberry PI as the NUT server master?
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

More information about the Nut-upsuser mailing list