Power Outage Notification

Status
Not open for further replies.

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I have another question, if I install no UPS, can I loss data in case of power outage? Please note my drives don't have any RAID, they are set each as single disks. The backups are maid once a week on external HDDs.
Yes, like on any practical storage system ever made.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
The data already on the disks can be loss or only data who is being writed on the disks?

Worst case, you can lose everything. It's unlikely, but it could happen.
 
Joined
Nov 24, 2013
Messages
214
I think the best is lets my UPS run out of power for assure the NAS will be powered on when the power come back...
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I think the best is lets my UPS run out of power for assure the NAS will be powered on when the power come back...

That's precisely my opinion....
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
They don't know how to control their own ups?

No, they have no idea what "killpower" is on some random platform. The usual problem with any tech support organization is that they're primarily familiar with their own product.
 
Joined
Nov 24, 2013
Messages
214
There was a way to make my FreeNAS box to powered up automaticly when the power come back? I set the power state in the BIOS to if power loss the machine will be powerd on when the power comeback but my problem is, the UPS can provide power for about 8 hours after the server is shutted down, so if the power outage last 1 hour, the FreeNAS box will never start automaticly. This is a big issue for me. Also, I prefer to set a timer for when the server should be shutdown instead to he wait for the UPS battery is out of power, deep dicharge is not good for UPS batteries. I just need the server start automaticly when the power goes on.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
There was a way to make my FreeNAS box to powered up automaticly when the power come back? I set the power state in the BIOS to if power loss the machine will be powerd on when the power comeback but my problem is, the UPS can provide power for about 8 hours after the server is shutted down, so if the power outage last 1 hour, the FreeNAS box will never start automaticly. This is a big issue for me. Also, I prefer to set a timer for when the server should be shutdown instead to he wait for the UPS battery is out of power, deep dicharge is not good for UPS batteries. I just need the server start automaticly when the power goes on.

The problem with this is that the computer has no way of knowing what the status of the pre-UPS AC line power is. Typically, a UPS will have features that allow it to cooperatively manage the state of the computer. Merely allowing the UPS to run out of power is not sufficient. What happens if the power comes back on when the UPS has not yet powered off but the computer has already powered off? There are a whole bunch of interrelated problems that effectively mean that you need a UPS that can provide what are known as load management functions. This is really not a FreeNAS issue so much as it is an issue of whether or not your UPS supports these features and has been correctly configured for them.
 
Joined
Jan 9, 2015
Messages
430
There was a way to make my FreeNAS box to powered up automaticly when the power come back? I set the power state in the BIOS to if power loss the machine will be powerd on when the power comeback but my problem is, the UPS can provide power for about 8 hours after the server is shutted down, so if the power outage last 1 hour, the FreeNAS box will never start automaticly. This is a big issue for me. Also, I prefer to set a timer for when the server should be shutdown instead to he wait for the UPS battery is out of power, deep dicharge is not good for UPS batteries. I just need the server start automaticly when the power goes on.
Maybe a backup generator would help.
 
Joined
Jan 9, 2015
Messages
430
Excuse me, you're sittin' in my seat. I'm the resident smartass. Back off, man!

:)
I didn't realize that there was assigned seating here. I think that there is room for one more around here. I'll just move back a row of seats. Rock on. :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I didn't realize that there was assigned seating here. I think that there is room for one more around here. I'll just move back a row of seats. Rock on. :)

This row is for the impatient jerks in the forum.. Sorry, but this whole row is mine.. Move back one more!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Both of you are the embodiment of the Unix philosophy of doing one thing and doing it well. :p

Glad to know I'm carrying on the tradition so well. Only been using *nix for about 3 years too. :D
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
No, they have no idea what "killpower" is on some random platform. The usual problem with any tech support organization is that they're primarily familiar with their own product.

NUT, the software FreeNAS uses to communicate with the UPS, is perfectly capable of shutting down the UPS, with an appropriate delay using a reasonable UPS. And if it does so, the UPS can come back on when line power is restored. If the BIOS of the FreeNAS machine is set appropriately, then this power cycle will switch the server back on.

However, the FreeNAS developers have decided not to implement the part of NUT that switches off the UPS. It apparently worries them in some non-specific, fear-of-hardware related way. See bug 4134. Sorry, forgotten how to do links.


Edit: The simple workaround is to control the UPS from another machine on the network running NUT properly configured and get NUT on FreeNAS to act as a slave to that first machine's instance of NUT. Then it all works. Clearly it is only safe after the power comes back on if the other machine is powered either by the same UPS or another UPS with similar behaviour.
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Personally, I agree with the devs on this. From my personal experience with the UPS switching off, it makes LOTS of problems. Namely:

1. If line power is restored before the UPS turns off, but after it's been sent the command, the UPS will *still* turn off. Don't like this behavior? Buy the enterprise UPS.
2. The time frame from when the UPS is asked to turn off and when it actually powers off is not the same across the board. Even with a 60 second delay (which one person said their UPS used) I've worked on several machines that would pass that delay by 2 or 3 fold, some maybe even 5 fold.
3. Once the UPS is turned off, they generally won't turn back on when power is restored later. So you must physically touch the hardware to restore power. Not necessarily the "best" thing for someone that wants lots of uptime and the ability to restore the server to service remotely via things such as IPMI.

If you want to have that kind of control of power and such, buy the management UPS hardware and software. In the big picture, the gains (UPS battery power is saved) is not worth the potential downsides (;pss of power suddenly in the middle of the shutdown sequence which for some people could be rather nasty for their server). Remember, the whole reason people want UPSes are to absorb those short power outages and allow for the server to perform a clean shutdown. Clean shutdowns are brought into *serious* question by sending a command to the UPS to shut itself down. I'd bet you don't retest your shutdown times every time you do something like add a jail or add more disks. But both of those have a significant affect on the shutdown time of the server.

I added the underline because the UPS companies *know* this is very important. It's also specifically why they've added this feature (many of them do it automatically and you can't even turn it off for home UPSes). The reason why the home UPSes behave different is because they *want* you to buy that more expensive Enterprise UPS. Sure, the less expensive home UPS might have been sufficient for your home server, but the profit margins for those enterprise UPSes is much higher and they are all about maximizing profits. So any way they can push you to buy that more expensive product is a win for them.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Taking the APC Smart-UPS as an example of decent affordable one-up-from cheapest UPSs, which the other makes tend to follow in their offerings, all these objections are answered:

1. You *do* want the UPS to power cycle even if the line power is restored: otherwise your FreeNAS server, which has powered off by this time, will not switch back on.

2. The default delay of switching off is I think six minutes, and it can be set in multiples of this. The trick is to set it much longer than you might need. (Careless advocacy might suggest that the Sysvinit/apcupsd system of switching off the UPS in software that runs *after* all user programs are shutdown and the filesystem mounted read-only would enable you to use even a simple UPS, but I recognise that that is irrelevant, especially with ZFS.)

3. Not only will the UPS mentioned switch back on when line power is restored, but you can set a further minimum delay for this function to prevent various race conditions.

Next para: switching off the UPS is not to save battery power, but to save battery life, as they really don't like being deeply discharged. This increases reliability, of course. (And the other function of power cycling the server to turn it back on is also relevant.)

Your last para, on the perfidy of UPS makers, is absolutely correct, and I gather the more recent mid-range APC models are deliberately crippled compared with the older ones. But if one does the research and selects the right make and model shutting down the UPS definitely adds to data security.


Edit: if you're going to say that proper UPS control shouldn't be available because people might buy cheap, inappropriate hardware and this might lead to data loss, then you might as well say that FreeNAS shouldn't be available for the same reason.
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
3. Not only will the UPS mentioned switch back on when line power is restored, but you can set a further minimum delay for this function to prevent various race conditions.

I believe that the SmartUPS actually won't just switch back on when line power is restored, but instead will switch back on when the batteries are sufficiently recharged to provide some runtime. I believe that threshold is somewhat configurable.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
I believe that the SmartUPS actually won't just switch back on when line power is restored, but instead will switch back on when the batteries are sufficiently recharged to provide some runtime. I believe that threshold is somewhat configurable.
Yes, battery sufficiently charged AND specified delay completed since power returned.

Edit: annoyingly, NUT can configure the latter but not the former. The proprietary Powerchute can configure the minimum battery charge, and the default, ISTR, is a bit low.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Taking the APC Smart-UPS as an example of decent affordable one-up-from cheapest UPSs, which the other makes tend to follow in their offerings, all these objections are answered:

1. You *do* want the UPS to power cycle even if the line power is restored: otherwise your FreeNAS server, which has powered off by this time, will not switch back on.

Well, the 2 APC SMART-UPSes I have, once powered off will not power back on under any circumstances. You must physically touch them.

2. The default delay of switching off is I think six minutes, and it can be set in multiples of this. The trick is to set it much longer than you might need. (Careless advocacy might suggest that the Sysvinit/apcupsd system of switching off the UPS in software that runs *after* all user programs are shutdown and the filesystem mounted read-only would enable you to use even a simple UPS, but I recognise that that is irrelevant, especially with ZFS.)

The 6-minute thing changes depending on brand, model, and even hardware revision. See how fast the waters get muddy?

3. Not only will the UPS mentioned switch back on when line power is restored, but you can set a further minimum delay for this function to prevent various race conditions.

Like I said above.. mine never come back on.

Next para: switching off the UPS is not to save battery power, but to save battery life, as they really don't like being deeply discharged. This increases reliability, of course. (And the other function of power cycling the server to turn it back on is also relevant.)

Sorry, as someone with a background in battery technology I made the assumption that saving on battery discharge power meant increasing life as a natural result. I probably should have been more explicit with the link. BUT, this statement is not 100% true. Some battery designs actually prefer to be fully discharged before charging again (for these designs, if you take more than 5-10% out of the battery, you should fully discharge it before charging it again). Unfortunately the companies are very hush-hush on which is and which aren't. As a general rule, unless you are fully discharging your battery at very regular intervals (for example, once a week) then you should not have a problem with battery discharges shortening the battery life. Considering the fact that if you are losing power once a week a UPS is not sufficient for your problems (you should have some kind of backup diesel if your servers are that important). This problem is compounded by the fact that they typically offer 3 year battery lives, and unless there is a battery defect, no amount of reasonable discharging will cause the battery to have a life shorter than 3 years, which means you *will* be buying more product from them (the battery) and they are 100% for that situation. Between 2008 and 2011 I'd literally lose power if a storm was within 100 miles of me. Being in IL it happened 2-3 times a week. It wasn't until the substation exploded and had to be replaced that I finally had stable and reliable power. I had 4 UPSes during that time and none of them had lifespans shorter than 4 years that I owned during that time.

Edit: if you're going to say that proper UPS control shouldn't be available because people might buy cheap, inappropriate hardware and this might lead to data loss, then you might as well say that FreeNAS shouldn't be available for the same reason.

I'm not. I was trying to convey that FreeNAS needs to be able to handle it's own little UPS that is shoved in a corner for small implementations and be able to receive information from monitoring hardware through NUT as master/slave for very large implementations. At some point UPSes aren't the answer for long power outages... backup diesel generators are. In those situations, this becomes a mute argument because you shouldn't be without power for more than about 60 seconds or so.

Remember, FreeNAS can't and shouldn't make every single setting available. The reason why FreeNAS is so great for the masses is because of its appliance-like nature. Deviate from that too much and you end up with an OS that has WAY too many settings that are confusing and make no sense. For people that need more control than FreeNAS offers, there is FreeBSD. You can do as much or as little as you want in FreeBSD. ;)

I have personal hatred of setting up NUT. The first time I tried to set up NUT myself in a FreeBSD implementation it took almost 2 solid days of working on NUT exclusively to get the darn thing to work right how I wanted it. I had 3 different UPSes to set up, and every single one behaved slightly differently (especially with relation to the auto-poweroff feature). If we are going to have that level of sophistication in FreeNAS' implementation, then NUT would be pretty useless to me. Mostly because I'd be forced to run LOTS of tests just to validate that what I'm wanting to do will actually be what happens. ;)

Heck, if you really want to you can be hacky and edit the python code in FreeNAS to do exactly what you want. :P Knowledge is power (UPS power.. haha).
 
Status
Not open for further replies.
Top