Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
What is NUT? Is this common? –  ewwhite May 26 '13 at 0:31
3  
Network UPS Tools, free software (GPL) which supports a wide range of UPS models in an uniform way. The only comparable opensource alternative is apcupsd, 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 7:53

2 Answers 2

up vote 1 down vote accepted
+50

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.

share|improve this answer
    
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

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.