4

I've got NUT configured on a few systems in the following way: One host is connected to four UPSes via USB. That host is plugged into two of the four UPSes. Two other hosts are on the same rack, each plugged into one of the remaining UPSes. upsmon on the master only monitors the two UPSes relevant to powering that host, even though upsd is configured to communicate with all of them. upsmon on each of the slaves monitors the appropriate UPS attached to the master. I cannot have each slave directly attached to its UPS. (Those two hosts are VMware ESXis and the only NUT package I've found for them only contains upsmon.) (I also have another rack whose UPS configuration is sufficiently complicated that while I could have a setup where each UPS was directly attached to a host it powered, it makes for simpler cabling to have them all connected to a single host even if it doesn't draw power from all of them.)

My question is this: if the power goes out and one of the slaves' UPSes goes into low battery state, what is the best way to have the master power off the UPS as soon as the slave attached to it has shut down? I don't want to just wait for the master to shut down, because that leaves a window of time where the power might return but, because the slave's UPS never powered off, the slave's system will not see a power cycle and, thus, will not turn itself back on.

asciiphil
  • 3,036
  • 3
  • 26
  • 52
  • What is NUT? Is this common? – ewwhite May 26 '13 at 00:31
  • 3
    [Network UPS Tools](http://www.networkupstools.org/), free software (GPL) which supports a wide range of UPS models in an uniform way. The only comparable opensource alternative is [apcupsd](http://www.apcupsd.com/), but it supports mostly APC branded UPS models (only SNMP and dumb drivers could work with non-APC models). – Sergey Vlasov May 26 '13 at 07:53

2 Answers2

1

Sorry to answer your question with another question but... what about "Wake On Lan"? You could wake up your slaves from mater when power is back to normal.

Chris
  • 633
  • 6
  • 11
  • That would require some custom scripts monitoring the UPSes outside of NUT's `upsmon` with their own logic for when to send the WoL packets. It'd be doable, but it would add a lot of complexity and special cases to my setup, both of which are things I'd prefer to minimize. – asciiphil May 26 '13 at 16:37
1

In my opinion the easiest way to handle this is to connect each UPS to its own host, then pass the USB through to a VM on that host which is a NUT master, and which has access to shut down the ESXi host through the VM APIs. That way there's no need to shut down the slaves from the master.

Paul Gear
  • 3,938
  • 15
  • 36
  • I really like the simplicity of having all of the UPSes monitored by a single host (I have short USB cables running from the UPSes to a USB hub and then just one cable running up to the monitoring host), but this approach would certainly manage the systems' power properly. I'm using HA, but I can just disable it for the VMs with USB passthrough. – asciiphil May 26 '13 at 16:32