UPS and graceful shutdown in case of power failure


JohnSnyder

Recommended Posts

What is the best way to connect an unRAID server to a UPS so that the UPS can trigger the unRAID server to stop the array and shutdown properly in case of power failure?  What software would unRAID require?  What is the method of communication between the UPS and the unRAID server?  Is it possible for the UPS to restart the unRAID server when the power is restored?

Link to comment

An APC brand UPS will provide the best compatibility, other brands can often be made to work, but some features may not be available. For sizing, there is a minimum size to run the server, which will often only provide a few minutes of runtime (less than 10), and then there is sizing for a specified time frame. If you need to run for more than about 1/2 hour, the prices will be quite high. The USB connection on an APC is the easiest way to connect it.

 

44 minutes ago, JohnSnyder said:

Is it possible for the UPS to restart the unRAID server when the power is restored?

 

Assuming a fully compatible UPS and the proper settings available in the motherboard's BIOS, yes. Not really recommended however, as many times there will be things that need to be watched as a server comes back up, just to verify that there are no issues that need to be dealt with. Also, there is the issue of battery recharge times. When a backup has been used for a given period of time, it typically requires 20 times that given period or more to fully recharge the batteries. The last thing you want to happen is a failure of the battery backup right in the middle of startup because the power went back out again. Usually you would want to confirm the power is stable with no further chance of interruption for the foreseeable future before you power the server back up.

Link to comment

Thank you for the info, jonathanm.

 

Does unRAID require any additional software to be able to act on whatever signal the APC brand UPS will send to the computer?

 

And if automatic restarting is a possible issue, that's not a big deal.  What I want is a clean shutdown so that the array is preserved and the data is saved.

Link to comment
7 minutes ago, JohnSnyder said:

Does unRAID require any additional software to be able to act on whatever signal the APC brand UPS will send to the computer?

Nope. apcupsd open source APC interface software is built into the unraid system. All that is required is to go into the settings and tell it the particulars of the connection. Many Cyberpower UPS models work for automatic shutdown, but don't play well with the option to shut down the UPS after the server is shut down.

Automatic restart is a complicated issue. If everything is working right and the power stays on after returning, then everything works fine. The issue is when unexpected things happen, it can cause problems. Better to wait and be present to ensure everything is ok.

Link to comment
Just now, JohnSnyder said:

When the UPS shuts down the unRAID system, is this a "clean" shutdown, or does it have to perform the 12 hour parity check on the array?

The shutdown script does its absolute best to get a clean shutdown. However, in some rare cases, it may not be able to successfully kill all the running bits before the battery runs out. The drop dead timeout is adjustable, but not from the GUI AFAIK. Best practice would be to ensure as many services as possible shut themselves down cleanly so unraid doesn't have to force kill them. VM's for instance, can have the apcupsd software running on them as well, and take the cue from the unraid master apcupsd install that the power has failed, and shutdown ASAP, before unraid has to stop them.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.