Should I connect and configure UPS link to pfSense? What would turn it back on?
-
Hi all,
I currently have an APC BackUPS 350 protecting pfSense, Cable modem and a Unifi 8-150w switch. pfSense is running on an old Dell Optiplex 390 with a dual port Intel nic. The BIOS is set to last state. Currently if there was an extended outage, the UPS would keep the equipment up until the battery ran dry. Once power restored, the Dell PC would power on because its last state was on prior to the outage.
Now if I connect the data cable between pfSense and the UPS, I take it that the UPS when low, would instruct pfSense to shut down cleanly. However if it shuts down cleanly and powers off, then the UPS either runs dry or the power returns, the PC is off still because that is the "last state". What tells the PC to turn back on? If its off it can't see what is sent to it over serial or usb right? My desktop computer has the option where the spacebar on the keyboard can power it on (and its wireless to usb), but I'm not sure if APC would send a "Spacebar" or something like that.
Thanks for the input.
-
So configure BIOS for "ON" instead of "LAST STATE."
-
Some computers can be configured for what happens when power is restored. For example, the computer I use for pfSense can be set to a) stay off, b) resume previous state or c) power up. Another option is "Wake on LAN", where something sends a magic packet that wakes up the computer.
-
Amusing thing for me is… my pFsense box boots faster than my cable modem, so when power comes back and powers all, pfsense Readies first and asks modem for an IP, which it ain't yet ready, and then just sits there with a 0.0.0.0. I wasn't patience enough to wait and after 10 minutes having seen the cable modem's green lights, went ahead and manually rebooted pfsense a second time to get the WAN IP. If I had some critical stuff running requiring full auto restore I may not be so happy. This is 2.4.2.
-
Amusing thing for me is… my pFsense box boots faster than my cable modem, so when power comes back and powers all, pfsense Readies first and asks modem for an IP, which it ain't yet ready, and then just sits there with a 0.0.0.0. I wasn't patience enough to wait and after 10 minutes having seen the cable modem's green lights, went ahead and manually rebooted pfsense a second time to get the WAN IP. If I had some critical stuff running requiring full auto restore I may not be so happy. This is 2.4.2.
That must be one slow modem. Regardless, it shouldn't be too hard to write a script that checks the IP address for 0.0.0.0 and then restarts the DHCP client. Perhaps it could run a minute after the client starts and then loops until a valid address is obtained.
-
Thanks everyone. I’m not really sure what the BIOS is set to, but at a minimum it’s on last state because it will turn back on if the power is returned after a loss. It works fine the way it is today but I thought maybe there’s benefits to the UPS connection. It would be nice to see the battery capacity and power load in the pfSense UI if that’s possible.
WOL wouldn’t work since the UPS doesn’t have a lan port to send that out on. But the BIOS option for power on sounds like it would do the trick. So if the PC is shutdown properly due to low UPS battery signaling a true shutdown, the power supply would continue to monitor the AC line? It would watch for a power loss and power return event? Usually these UPS signal safe shutdowns but there’s a few minutes left on them.
I have an Arris SB6183 modem and I don’t think I have the issue where the modem takes longer to boot. Why would your pfSense sit on a 0.0.0.0? I think when the Arris is offline it offers something in the 192.168.100.x range. I guess each modem and each cable company can configure them differently.
-
So if the PC is shutdown properly due to low UPS battery signaling a true shutdown, the power supply would continue to monitor the AC line? It would watch for a power loss and power return event?
When a computer is shut down, it's not fully off. Part of it is still running, watching the power switch, wake on LAN etc.. So, when the power is restored, that small part powers up and can check the configuration, to see whether to power up or not. A computer is only fully powered off when unplugged.
Also, it doesn't have to be a UPS that sends that magic packet. It can be any device, such as another computer. In data centres, there are entire systems to to control & manage the computers.
-
One other thing, the purpose of that UPS cable is to trigger an orderly shutdown. If you don't use it, the computer will experience a sudden power failure and not be able to shut down properly. This might cause disk corruption.
-
Thanks JKnott,
The hard drive is a Samsung Evo SSD 128 GB.
Because there's no moving parts (spinning disk and head actuator), the chance of data corruption should be less, correct? Obviously if there is a partial write to the flash, even though it completes faster, there could be potential where the file allocation tables are not completed, or the write is half written. I'm not sure what kind of resiliency pfSense has over NTFS or FAT32, but I can tell you I'm not running XFS.
I will consider connecting the UPS to the PC and double checking the BIOS setting in the future.
-
Before u get excited, is there a BSD driver that will talk to your particular UPS? Am not sure there is a universal UPS driver.