[SOLVED] UPS-Nut Plugin - AutoRestart after Safe Shutdown

  • Hi!


    I have an ups connected via usb with my omv-server. I have installed the NUT-Plugin and it's great! I have set that in case ups goes on battery mode the nas is safely shutdown in 15 seconds.


    I would like that the omv-server also automatically-restart when (and only when) power is restored (ups return in normal mode). How can I do that?


    Browsing the internet I've read that I should set the Power Restart Option in the BIOS on "Always On". Is the correct way? I suspect that if I set "Always On" in case of power failure the omv-server is safely shut down after 15 seconds but if the power outage is persistent with this option the server is restarted with the ups still in battery mode and I don't want it.


    Thanks

  • I have a similar issue/need, which I only noticed yesterday when a black-out occurred.


    I am using the nut plugin as you do and wakealarm to regularly wake up the server (I turn It off every night, then turn it on in the morning).


    When a safe shutdown occurs, the wakealarm plugin does not wake the system at the next schedule, but I think I'll have to open another thread.


    Does your UPS power cycle when the electricity is back? My APC Back-UPS does. If it's the same for you, just go to the BIOS and enable an option called "Turn the system on when power is restored" or something similar.


    EDIT: I didn't fully read your post, you already enabled this option. Well, you don't have to worry about this. The system will safely shut down via the NUT plugin, and the UPS will keep providing energy, so the system won't do anything until the UPS restarts. In this case the server will detect energy was gone, but only because the UPS restarted, interrupting energy for a second or so.

    OMV BUILD - MY NAS KILLER - OMV 5.x + omvextrasorg


    Core i3-8300 - ASRock H370M-ITX/ac - 8GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker), 3x4TB HDD (Data) - Fractal Design Node 304 - Be quiet! Pure Power 11 350W

  • I think this is no problem of the OMV settings. It depends on the capabilities of the UPS. Some UPS`s shut itself down when a power outage occures. After sending the shutdown command to the connected system, the UPS still waites a while, e.g. some minutes. If the power outage continuous the UPS switches itself off to avoid a complete discharge of its batteries.

    If the power comes back the UPS switches on and starts charging the batteries. But the power output connected to the load (e.g. OMV system) keeps switched off. The power supply to the load must be manually activated. At least thats the case with my HP UPS (I have to double check this).


    In your case the UPS must be configurered to supply the load automatically when the power comes back. Then with the correct BIOS / UEFI settings the OMV PC should boot automatically, like explained in the post above.

    OMV 3.0.99 (Gray style)
    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1)- Fractal Design Node 304

    Edited once, last by cabrio_leo ().

  • Thank you both for the answers. Effectively the problem was that my ups was setted by default to no switches itself off after a power outage. I resolved the problem by connect the ups to my PC and by modify this option via the software provided by the manufacturer. Then I set the restore power policy on the BIOS to "Always ON" and everything work as I want.


    Furthermore, after doing some test and inspecting the parameters visible by the OMV-Web-UI I found that the behaviour of the system is regulated by 3 parameters (see attachments below) and is like this:


    1) Power Outage occures --> the UPS safely shutdown the server after "ShutdownTimer" seconds (in my case 30) and switches itself of after "ups.delay.shutdown" seconds (in my case 30) after the shutdown of the server.


    2) After Power is Restored the UPS come back on (only if a minumum of "ups.delay.start" seconds (in my case 180) have passed) and the omv-server restart.


    The only editable parameter seems the ShutdownTimer . The other two (visible via the services tab of the OMV-Web-UI) seems not editable


    So, problem Solved. Thank's again.

  • CarlB

    Changed the title of the thread from “UPS-Nut Plugin - AutoRestart after Safe Shutdown” to “[SOLVED] UPS-Nut Plugin - AutoRestart after Safe Shutdown”.
  • Hello guys


    I have the same kind of problem, but with a twist.
    The twist is that my APC UPS needs to shutdown the OMV server (which it does) but it needs to stay ON to continue providing power to other devices (a router and a smartthings hub).

    In order to do this, I edited /etc/nut/upsmon.conf and deleted the line POWERDOWNFLAG /etc/killpower, which does the job

    But I also need for the OMV server to restart itself upon power return.

    So is there a way to do this? I think one idea is to force the UPS to restart itself when the power returns, which will inform the OMV server that it also needs to restart. But I have no idea whether that is possible and if yes, how to do it.

    thank you

  • On many BIOS´s there is an option to power on automatically when power returns.

    That's what I ended up using on my server. To be frank I think it's on all BIOS's, obviously with a different name.

    I've tested it because there were many power outages last month and the server turned on every time the power came back because the UPS does a power cycle.

    It's working beautifully and I'm so thankful I've bought a UPS just in time.

    OMV BUILD - MY NAS KILLER - OMV 5.x + omvextrasorg


    Core i3-8300 - ASRock H370M-ITX/ac - 8GB RAM - Sandisk Ultra Flair 32GB (OMV), 256GB NVME SSD (Docker), 3x4TB HDD (Data) - Fractal Design Node 304 - Be quiet! Pure Power 11 350W

  • Hi guys

    Yes I know about the bios setting but please note that in my application the UPS does not shutdown and restart upon power return as it needs to power other devices during the outage.


    So if the power outage is short, which most are in my case, the OMV server does not see the power being cut and then returned so as to power itself up (because the UPS does not do a power cycle).

  • it's pretty weak (about 1 hour with the server + router + Smartthings Hub plugged in) and I would have liked to keep the router and ST powered for as long as possible (security reasons).


    but yes, apparently there is no other solution than to configure the NUT pluging to shutdown OMV when the battery is running low and not immediately after a power failure.


    this ensures that if the outage is long enough, the UPS will shut itself down and so the OMV will restart on power resume.

    the downside is that the router and ST Hub will not stay powered for as long as I'd like them to.


    there is maybe a solution but it does not involve just the UPS and the server.
    I could put a smart plug between the UPS and the server


    on power failure, the Home Assistant running on OMV server will inform ST that it needs to turn off the plug after a delay


    then the OMV will shutdown as instructed by NUT and then the smart plug will shutdown, cutting power to the server


    I haven't figured out yet how to automatically turn on the smart plug when power returns; I guess I could turn it on manually, or maybe use a smart bulb that is always off as a trigger (smart bulbs power ON after a power failure)

    so, pretty complicated but it could work :-))

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!