NUT Configuration: Overview, Thoughts, and Challenges - VincentSaelzler/HomeLab GitHub Wiki
The Final Setup (Overview)
There are two machines involved. The R720xd (FreeNAS), and the R620 (Proxmox).
- The UPS is connected to Proxmox via USB
- Both of them are in slave mode.
- The UPS remains "on" even after both servers shut off, and will the batteries will eventually grind down to 0%, despite not powering anything important.
Overall, I'm not super happy with the setup
HOTSYNC
: The Big Stumbling Block
I would prefer that FreeNAS was the master, and that the UPS actually shut off entirely during a power outage (to prevent it needlessly adding wear-and-tear on the batteries).
The critically important aspect of the setup is to have
- Proxmox shut down first, because it's running the VMs that rely on FreeNAS iSCSI storage
- FreeNAS shut down after Proxmox shuts down.
So why not have FreeNAS as master? Because the HOTSYNC
parameter cannot be configured via the GUI. That parameter dictates how long FreeNAS waits to shut down. In testing, FreeNAS didn't wait long enough.
FreeNAS shut off while Proxmox was mid-shutdown. That's probably the worst case scenario when it comes to making sure the iSCSI shares disconnect cleanly.
USBHID-UPS
Driver: Another Speed Bump
The I might have considered "hacking" FreeNAS and manually forcing the contents of the NUT config files, if there wasn't an additional problem.
As the NUT USB HID Driver Manual indicates, not all UPSs respond to shutdown commands the same way. My UPS simply doesn't turn off when given the command.
It apppears that using a serial connection (an therefore a different driver) could resolve the issue, but I'm not sure.
The Light at the End of the Tunnel
Looks like the ability to edit the HOTSYNC
parameter is coming in FreeNAS 11.3, according to the GitHub commit HOSTSYNC exposed in Upsmon.conf
"This commit exposes the variable 'HOSTSYNC' in upsmon.conf file. It makes sure that the option is exposed in legacy UI as well and is configurable in ups service configuration. Ticket: #43932"
Once that comes along, I'll probably try using a serial connection from FreeNAS to actually shut off the UPS. That's still a ways off though, so for now sticking with the setup as-is.