Back to Engineering Blog
Systems Design 6 min read

Surviving Texas Grid Spikes: Dual-UPS NUT Automation That Actually Shuts Down Cleanly

Designing power resilience across independent electrical circuits with dual Network UPS Tools (NUT) servers, cross-monitoring secondary power supplies, and automated graceful shutdown drills.

Jason NevillBy , Houston, TX
#PowerResilience#NUT#HighAvailability#Proxmox#Automation

Key Architectural Takeaways

  • Dual-circuit power segmentation isolates primary and secondary PSU feeds to protect against localized circuit breaker trips.
  • Network UPS Tools (NUT) netclient/netserver architecture enables deterministic guest shutdown sequences before host cut-power.
  • Staged shutdown sequencing halts write-heavy database containers first to prevent filesystem corruption during power loss.
  • Quarterly automated pull-the-plug drills validate battery health curves under real operating loads.

The Fragility of Single-UPS Setups

In regions prone to severe weather or electrical grid fluctuations, reliable uninterrupted power is mandatory. A common homelab topology connects all hardware to a single consumer battery backup unit (UPS).

While a single UPS handles momentary brownouts, it introduces three fatal failure modes:

  1. Cascading Overload: When high-load compute spikes coincide with utility loss, the sudden draw exceeds the UPS inverter rating, immediately dropping power to all equipment.
  2. Ungraceful Shutdowns: Standard vendor software often fails to coordinate shutdown across multiple hypervisors, causing hard power cuts while database containers are in the middle of active transactions.
  3. Single Circuit Vulnerability: If the branch circuit breaker trips, all battery reserves drain in minutes while other home circuits remain fully powered.

To achieve enterprise-grade power resilience, we decoupled our infrastructure across two independent electrical circuits, deployed dual UPS hardware, and automated graceful shutdown sequencing via Network UPS Tools (NUT).

1. Dual-Circuit Power Distribution

Enterprise servers feature redundant, hot-swappable power supply units (PSU 1 and PSU 2). In our architecture, these redundant supplies are mapped to distinct physical sources:

  • Circuit A (15A Dedicated): Powers UPS 1 (CyberPower 1500VA), which feeds PSU 1 on the primary Dell Precision compute node and core networking hardware.
  • Circuit B (15A Independent): Powers UPS 2 (CyberPower 1500VA), which feeds PSU 2 on the primary node and secondary virtualization hosts.

If either electrical circuit trips or a UPS inverter fails, the remaining supply carries 100% of the load without interrupting running VMs or dropped packets.

2. Distributed NUT Architecture: Master & Satellite Nodes

Coordinating power state across physical hypervisors requires a decoupled client-server model:

  • NUT Primary Daemon (`upsd`): Runs on a dedicated low-power host connected directly to the UPS via USB monitoring interfaces. It reads battery state of charge, load percentages, and utility voltage in real-time.
  • NUT Secondary Daemons (`upsmon`): Run on hypervisors and storage appliances. They listen for broadcast state changes (ONBATT, LOWBATT) over an internal management network.

Preventing False Triggers

Power grid transients often create voltage dips lasting under 5 seconds. To prevent unnecessary shutdown drills, the monitoring daemon enforces a debouncing grace window before declaring a persistent outage.

3. Graceful Shutdown Sequencing

When utility power remains offline and battery capacity drops below 20%, the system initiates an automated shutdown sequence designed to protect data integrity:

  1. Step 1: Drain Ingress & Flush Disks: Edge reverse proxies stop accepting new external connections. Running databases receive sync signals to commit write-ahead logs (WAL) to disk.
  2. Step 2: Guest VMs & Containers: The hypervisors send ACPI shutdown signals to unprivileged LXC containers and VMs in order of priority (workers first, databases second, core DNS last).
  3. Step 3: Storage Dismount: ZFS pools are cleanly exported (zpool export) to ensure zero uncommitted dirty blocks.
  4. Step 4: Hypervisor Poweroff: The physical hosts issue system power-down. Finally, the UPS is instructed to cut output power until utility voltage returns and stabilizes.

4. Routine Testing & Battery Calibration

An unvalidated disaster recovery plan is merely a hypothesis. We schedule monthly automated battery discharge tests during non-working hours to ensure battery runtime curves accurately reflect real hardware degradation over time.

Summary

Decoupling redundant power supplies across independent electrical circuits and orchestrating shutdown via Network UPS Tools transformed unpredictable power interruptions into deterministic, zero-data-loss events.

Some of what's described here is a design that hasn't been fully tested yet; those parts say so in the text.

Follow the build on LinkedIn or by RSS.

All Articles

Follow the build

Questions about the build, or spotted something we got wrong? Find us on LinkedIn and GitHub.