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.

  • brownmustardminion@lemmy.mlOP
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    Due to my understanding of it, I was hesitant to use AC recovery in the case that the power goes down more than once in a short period. It could drain the UPS to the point that it might not be able to sustain enough runtime for a proper shutdown. But I’m also a bit confused about the setup here. If the server is sent a signal to shutdown due to a grid outage, who is telling it the grid was restored? The server would always detect power because of the battery backup, so I don’t think AC Power Recovery would work in this case, no? I believe I have the UPS comm server (probably apcupsd) installed on the server itself, so there’s no way for it to know to wake up unless from an outside source.

    Maybe you have some further incite into how to make that setup work properly.

    I’m brainstorming here, but would it be possible/feasible to have the Unifi Dream Machine execute a script everytime it turns on telling the server idrac to power up. I’d have to see if the UDM has that ability as well. The UDM turning on would only really happen if power was restored from an outage. Otherwise I could send a command manually once I have access to the network.

    • 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.