Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Redundant UPS?

Exhorder

Member
Joined
Jul 12, 2019
Messages
41
Hi,

I want to add redundant UPS to my FreeNAS server. Actually the UPS is already there, but of course I also want to shutdown FreeNAS (and other connected servers) when battery is low.

Overview:
redundant-ups.png


There are two UPS, each connected to it's own RCD. The UPS are powering several servers, each with redundant PSU. So maybe server X runs FreeNAS, server Y runs some Linux and server Z runs whatever else.
My idea was adding SNMP cards to both UPS and let all servers query battery state over network. If battery runs low, all servers should shut down. Will this work or am I missing something?
 

sretalla

Wizened Sage
Joined
Jan 1, 2016
Messages
4,084
Will this work or am I missing something?
Which battery? if you have low battery on UPS 1 and full battery on UPS 2, do you want your servers shutting down?

You may find you can use USB from each of the UPS units to a server and then use NUT to publish the UPS state to the network from the connected server(s). I use that method with success, but don't connect 2 UPS to the same server.
 

Exhorder

Member
Joined
Jul 12, 2019
Messages
41
The perfect solution of course would be to shutdown only if both batteries are low. But that's not possible with the settings in FreeNAS web interface. It may be possible with running NUT in a jail or VM though. Any info about this would be appreciated.
EDIT: NUT can handle this: https://networkupstools.org/features.html "upsmon won’t initiate a shutdown until the total power situation across all source UPSes becomes critical (on battery and low battery). "

But also watching UPS 1 only would not be a huge problem:
* In the event when the whole site has a power outage (UPS 1 & 2 run on battery), the battery drain on both UPS will be roughly the same.
* In the case of mainteance or failure on UPS 1 of course it would be nice to have unlimited time while running on UPS 2.

How do others take care of this? Redundant PSUs are not that unlikely in a FreeNAS.
 
Last edited:

sretalla

Wizened Sage
Joined
Jan 1, 2016
Messages
4,084
It may be possible with running NUT in a jail or VM though. Any info about this would be appreciated.
I run it in a jail.

I think it was as simple as pkg install nut or something like that, then just editing the config files. Happy to provide a bit more help if needed.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,360
I run it in a jail.

I think it was as simple as pkg install nut or something like that, then just editing the config files. Happy to provide a bit more help if needed.
Can nut actually monitor a USB device and shutdown the server from inside a jail?
 

sretalla

Wizened Sage
Joined
Jan 1, 2016
Messages
4,084
Can nut actually monitor a USB device and shutdown the server from inside a jail?
I'm actually not using it that way, rather with USB on other boxes and NUT querying those.

The theory goes that with the right devfs_ruleset, you can pass the USB through to a jail, so I would be doing that if I had the need.
 

sretalla

Wizened Sage
Joined
Jan 1, 2016
Messages
4,084
and shutdown the server from inside a jail?
Just understood that part of the question... actually what you do is have the FreeNAS host configured as a slave to look at NUT on the Jail IP and NUT port, then it's FreeNAS (UPS service) that does the shutting down on its own.
 

Exhorder

Member
Joined
Jul 12, 2019
Messages
41
Just understood that part of the question... actually what you do is have the FreeNAS host configured as a slave to look at NUT on the Jail IP and NUT port, then it's FreeNAS (UPS service) that does the shutting down on its own.
I can set up a VM that monitors both UPS and using upsmon inside the VM it can shutdown itself when both UPS are on low battery. But how can I do this in the FreeNAS web interface? There I can still just monitor a single UPS as slave.

Seems the only way to do it is if the VM issues the shutdown command to the FreeNAS host via ssh.
 

sretalla

Wizened Sage
Joined
Jan 1, 2016
Messages
4,084

It may take a little doing with some scripts on your NUT server to set the condition that you want for the dummy based on the overall status, but FreeNAS would look only at the dummy.
 

Exhorder

Member
Joined
Jul 12, 2019
Messages
41
Well, next question: If i chose "Slave" in FreeNAS:
2020-04-02 16_50_28-FreeNAS - 10.0.60.60.png


"Remote Host" and "Remot Port" is connection to the NUT master server.
But what about "Driver" and "Port"? My impression was that I should just enter the UPS name on the NUT server?
 

sretalla

Wizened Sage
Joined
Jan 1, 2016
Messages
4,084
It's s strange thing... on a server where I have no UPS config, if I enter the config page and select slave, driver disappears.

On another server that has been configured before as master, when changing to slave, the driver option remains.

I'm not exactly sure what to do about that... It seems to work as expected on the new config.
 

Exhorder

Member
Joined
Jul 12, 2019
Messages
41
So you just get: Identifier (name of the UPS on the NUT server), Remote Host (NUT Server) and Remote Port? This is what I would have expected, too.
 

sretalla

Wizened Sage
Joined
Jan 1, 2016
Messages
4,084
Looks like there was a fix for the "not disappearing driver field" which was delivered in 11.3-U2 yesterday. Perhaps it's a good time to try it out.
 

Dieter Toews

Junior Member
Joined
Jul 21, 2016
Messages
21
Hi all,

did anybody ever get a setup working with the jail approach? i have dual ups's with network card and I tried something a few years ago by directly the nut config files (it didn't work due, i think, to the complicated way the gui reads and writes config files in freenas...)

anyway - having never setup a jail before I'm a little gun shy.

 
Top