openmediavault-nut - shutdown the server, but keep the UPS running

  • When I set the plugin to shutdown the server after 60 seconds of working on battery, shortly after the shutdown finishes the UPS also powers off.

    Is there a way to alter this behavior so the UPS does not power-off and instead keeps running on battery? I'm using an APC Back-UPS CS 350 with the usbhid-ups driver.

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

    • Official Post

    When I set the plugin to shutdown the server after 60 seconds of working on battery, shortly after the shutdown finishes the UPS also powers off.

    Is there a way to alter this behavior so the UPS does not power-off and instead keeps running on battery?

    I haven't consulted the NUT documentation, but that behavior could be interpreted as desirable in 100% of cases. Can I ask the reason for wanting different behavior and not having the UPS shut down?

    • Official Post

    I haven't consulted the NUT documentation, but that behavior could be interpreted as desirable in 100% of cases. Can I ask the reason for wanting different behavior and not having the UPS shut down?

    That's also my thought. If the system has been brought down, the job of the UPS has been done and could be powered off. I think this is the default behaviour of the network UPS tools. So please check the NUT documentation if this behaviour can be configured. If so, there are several ways to get this config applied in the OMV plugin.

  • I haven't consulted the NUT documentation, but that behavior could be interpreted as desirable in 100% of cases. Can I ask the reason for wanting different behavior and not having the UPS shut down?

    I also have my router connected to the UPS. Since I seldom need to have the server up and running on battery, my idea is to have the server gracefully shutdown after 60 seconds and let the router run for much longer than it would have ran if the server was still on. Once the power is back on for good but UPS battery hasn't been drained, I'd use Wake-on-LAN to boot the server back up.

    That's also my thought. If the system has been brought down, the job of the UPS has been done and could be powered off. I think this is the default behaviour of the network UPS tools. So please check the NUT documentation if this behaviour can be configured. If so, there are several ways to get this config applied in the OMV plugin.

    I've had a look at the NUT docs, but I struggled to find something that would help me with this. In chapter 6.3, point 8, it says:
    "init then runs your shutdown script. This checks for the POWERDOWNFLAG, finds it, and tells the UPS driver(s) to power off the load by sending commands to the connected UPS device(s) they manage."

    I was unable to find out if there's a way to alter which commands are being sent to the UPS.

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

    • Official Post

    I also have my router connected to the UPS. Since I seldom need to have the server up and running on battery, my idea is to have the server gracefully shutdown after 60 seconds and let the router run for much longer than it would have ran if the server was still on. Once the power is back on for good but UPS battery hasn't been drained, I'd use Wake-on-LAN to boot the server back up.

    I guess it depends on each person's circumstances. In my case the UPS turns off once the server has been shut down cleanly. When the power comes back on the UPS turns itself on (maybe this depends on your UPS brand and model, I don't know). At that moment the server receives power again. In the server bios I set the Always On power options. That means when it receives power from the UPS again it turns on automatically.

    Result. When there is a power outage, the system completely shuts down cleanly. When power is restored, the system starts completely without human intervention.

    Just a caution. If after power restoration there is a second power outage immediately, the UPS should still have enough battery charge to perform the process again. If you have completely consumed the battery in the first power outage, you could have problems in the second power outage. To avoid this I configure the server shutdown 3 minutes after the power outage, that way I guarantee that the UPS has enough battery no matter what happens next.

    In my opinion this is the most comfortable and safe configuration, but your circumstances may be different.

  • I guess it depends on each person's circumstances. In my case the UPS turns off once the server has been shut down cleanly. When the power comes back on the UPS turns itself on (maybe this depends on your UPS brand and model, I don't know). At that moment the server receives power again. In the server bios I set the Always On power options. That means when it receives power from the UPS again it turns on automatically.

    Result. When there is a power outage, the system turns off completely. When power is restored, the system starts completely without human intervention.

    Just a caution. If after power restoration there is a second power outage immediately, the UPS should still have enough battery charge to perform the process again. If you have completely consumed the battery in the first power outage, you could have problems in the second power outage. To avoid this I configure the server shutdown 3 minutes after the power outage, that way I guarantee that the UPS has enough battery no matter what happens next.

    In my opinion this is the most comfortable and safe configuration, but your circumstances may be different.

    That's exactly the UPS configuration I've been using for a long while, except I had the server set to shutdown when there's 30% of battery left. Haven't had an issue with that setup, but if I had consecutive power outages in a way you described (happened maybe once this year), that could be a problem. I'll apply your advice and make it shutdown after 3 minutes regardless.

    This configuration works, but I've realized it's not the most optimal setup for me. I'd rather trade server uptime for extra time I can use the internet for on my laptop/phone. If the server goes down due to the power outage while I'm home, I don't mind having to power it on manually, especially since it's as simple as running a desktop shortcut that runs a WoL program. The only important thing I could potentially lose is remote access to my server and PC through Zerotier if my server happens to be down after a power outage, but perhaps I could switch between two UPS configurations - "power off after 60s and leave the UPS on" and "power off after 3 minutes and power off the UPS" - depending on the time of day? Sounds unnecessarily complicated, but potentially the most optimal for me. :S

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

    • Official Post

    perhaps I could switch between two UPS configurations - "power off after 60s and leave the UPS on" and "power off after 3 minutes and power off the UPS" - depending on the time of day? Sounds unnecessarily complicated, but potentially the most optimal for me. :S

    We are making it more and more complicated. LOL

    I was skimming through the NUT documentation and didn't find anything that could help you, maybe there is a way to do it.

  • I also have my router connected to the UPS. Since I seldom need to have the server up and running on battery, my idea is to have the server gracefully shutdown after 60 seconds and let the router run for much longer than it would have ran if the server was still on. Once the power is back on for good but UPS battery hasn't been drained, I'd use Wake-on-LAN to boot the server back up.


    My use case is very similar to this. I'm now thinking about having a pi monitor the UPS (Type C configuration from typical setup documentation) and orchestrate power on/off events for my OMV server (in a Type B configuration).


    Since I'm having trouble with the NUT plugin in OMV 7.x (thread on issue) anyway, maybe I'll try something like this.

  • my idea is to have the server gracefully shutdown after 60 seconds and let the router run for much longer than it would have ran if the server was still on.

    I believe this goal is achievable by selecting the shutdown mode UPS goes on battery with setting the shutdown timer to 60 seconds, and adding offdelay = <delay in seconds> to the Driver configuration directives.
    The actual delay time (in seconds) could be big enough to keep UPS running, but shorter than the value you see for the battery.runtime in the UPS diagnostics.
    For example, my UPS has

    battery.runtime = 7020

    battery.runtime.low: 120

    so I added

    offdelay = 6900
    I may need to adjust these values in the future when the UPS load is increased or decreased.

  • First sorry if message does not correspond exactly to the topic, but the configurations and behavior mentionned were actually very similar to mine.


    Hi,

    I guess it depends on each person's circumstances. In my case the UPS turns off once the server has been shut down cleanly. When the power comes back on the UPS turns itself on (maybe this depends on your UPS brand and model, I don't know). At that moment the server receives power again. In the server bios I set the Always On power options. That means when it receives power from the UPS again it turns on automatically.

    Result. When there is a power outage, the system completely shuts down cleanly. When power is restored, the system starts completely without human intervention.

    Just a caution. If after power restoration there is a second power outage immediately, the UPS should still have enough battery charge to perform the process again. If you have completely consumed the battery in the first power outage, you could have problems in the second power outage. To avoid this I configure the server shutdown 3 minutes after the power outage, that way I guarantee that the UPS has enough battery no matter what happens next.

    In my opinion this is the most comfortable and safe configuration, but your circumstances may be different.

    I would like to achieve the very same behavior as chente. I have OMV6 running on a J5040 ITX in a CM Elite 110 case, and a Eaton power station 800 UPS.

    I performed some tests few days ago without success: the behavior of the shutdown sequence is good (clean shutdown of the server after 120s power outage, then UPS shutdown as well). But when I plug on again the UPS, the server won't automatically restart. I carefully turned on the "autostart on power on" setting in BIOS.


    Do you have any clue or idea to test what could be the issue?

    Thanks a lot.

    • Official Post

    Do you have any clue or idea to test what could be the issue?

    You will have to study the Bios manual of your motherboard. Normally there will be an option somewhere in the Bios for the server to start by itself when it receives power again. But that motherboard may not have that option.

  • You will have to study the Bios manual of your motherboard. Normally there will be an option somewhere in the Bios for the server to start by itself when it receives power again. But that motherboard may not have that option.

    Yes, I've already activated this option with the following parameter on the BIOS:

    Restore on AC/Power Loss

    Select the power state after a power failure. If [Power Off] is selected, the power will

    remain off when the power recovers. If [Power On] is selected, the system will start

    to boot up when the power recovers.


    But it didn't change the behavior of the server once powered again.

    • Official Post

    It's strange, it should work. This is completely independent of the operating system and, of course, OMV.

    What brand and model of motherboard is it?

  • Yes I agree with you. I was wondering if it could come from an hardware configuration of the motherboard or the cabling of the power button of the case.

    It is an ASRock J5040-ITX, Cooler master Elite 110 case and Eaton Power station 800 UPS.

    • Official Post

    Restore on AC/Power Loss

    Select the power state after a power failure. If [Power Off] is selected, the power will

    remain off when the power recovers. If [Power On] is selected, the system will start

    to boot up when the power recovers.

    I've been looking through the manual for that board a bit and came to the same conclusion, that is the option that should work.

    The only thing I can think of is that you try to update the Bios if there is a version later than yours. Be careful with that, it's dangerous as you probably already know.

  • The other possibility is that the UPS itself isn't able to power cycle.


    The hits I got with the name of the UPS shows this type:

    Eaton Power station 800 UPS at DuckDuckGo


    61082 | Eaton Protection Station UPS | Eaton



    I can't find much info on it regarding functionalities other than it has 1min autonomy under full load.


    Better off using a PRO UPS that has the proper functions, namely "power cycle".

    I use a APC BR900-GR and it worked OOB flawless back in 2021

    • Official Post

    I use this one: Eaton 5E850IUSBDIN and that UPS seems to be the evolution of mine. It works for me without problems.

  • Anyway I don't think that the trouble comes from UPS: it effectively shuts down the server properly when power outage, and when it gets power again other equipment are effectively power up again (lights, laptop charger ... only for purpose tests). Just the server don't start until i manually start it.

  • when it gets power again other equipment are effectively power up again

    This is the "power cycle" I'm talking about so, as you say, it is something from the board.


    I recall some boards, require a jumper to activate the "power-on-after-power-failure"

    Maybe your has something like it?!?

Participate now!

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