Some background:

  • have a poweredge r320 on battery backup (basic APC unit)
  • have unifi dream machine
  • poweredge powers down automatically if power goes out

What’s the safest way to allow myself to power on the server in the event it shuts down while I’m not home?

I figure since I have remote access to my UDM, perhaps there’s a command I can execute from there to power it on?

My fear is using a method that provides more than just poweron commands remotely. I want to keep the server attack vectors down.

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    7 months ago

    If the server is sent a signal to shutdown due to a grid outage, who is telling it the grid was restored?

    Ah, I see I forgot to explain a crucial step. When the UPS detects that grid power is lost, it sends a notification to the OS. In your case, it is received by apcupsd. What happens now is a two step process: 1) the UPS is instructed to power down after a fixed time period – one longer than it would take for the OS to shut down, and 2) the OS is instructed to shut down. Here is one example of how someone has configured their machine like this. The UPS will stay off until grid power is restored.

    In this way, the server will indeed lose power, shortly after the OS has already shut down. You should be able to configure the relevant delay parameters in apcupsd to preserve however much battery state you need to survive multiple grid events.

    The reason the UPS is configured with a fixed time limit – as opposed to, say, waiting until power draw drops below some number of watts – is that it’s easy and cheap to implement, and it’s deterministic. Think about what would happen if an NFS mount or something got stuck during shutdown, thereby running down the battery, ending up with the very unexpected power loss the UPS was meant to avoid. Maybe all the local filesystems were properly unmounted in time, but when booting up later and mounting the filesystems, a second grid fault and a depleted battery state could result in data loss. Here, the risk of accidentally cutting off the shutdown procedure is balanced with the risk of another fault on power up.