Skip to content

docs(ups): the card's low-battery window is two minutes, which the shutdown sequence overruns, so raising it becomes step zero - #594

Merged
Gerrrt merged 2 commits into
mainfrom
gerrrt/ups-lb-threshold-first
Sep 21, 2026
Merged

Gerrrt merged 2 commits into
mainfrom
gerrrt/ups-lb-threshold-first

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Refs #574. A correctness fix to the runbook #586 added, found by reading the card before working from it.

The finding

scripts/snmp-walk.sh --device mjolnir 1.3.6.1.4.1.318.1.1.1.5.2, on 2026-09-21:

.1.3.6.1.4.1.318.1.1.1.5.2.8.0   0:0:02:00.00

upsAdvConfigLowBatteryRunTime is two minutes — APC's factory default, never changed on this card. That is when the card raises LB, which is the starting gun for every subscriber. Everything has to finish inside it or the hosts lose power part-way through the shutdown.

It does not fit. The runbook's own timings overrun it before a single guest is counted:

Seconds
HOSTSYNC — primary waits for secondaries 120
FINALDELAY — primary then waits before halting 30
Before the firewall begins halting at all 150
Window the card gives 120

Built against the factory value, this estate would have spent a maintenance window installing a shutdown sequence that still ends in the unclean stop it exists to prevent.

What changes

A new §0, before everything, raising the threshold to 8 minutes at the card's web interface — the one place in this repository that writes to the card rather than reads it. Eight is chosen to be safely too large, not right: at 21 % load and ~47 claimed minutes it is about a sixth of the pack, spent buying margin on a sequence nobody has timed. §5 times the sequence, §6 measures what a minute of pack is worth, and §6.5 now sets the final value downward from those two readings instead of being where the problem is discovered.

§1's guest count was wrong. Saruman runs two, alexander (140) and phoenix (170), both QEMU, read from homelab_guest_running — not the four the prose assumed. So the primary's wait is generous rather than tight, and §5 brings it down.

A new troubleshooting entry for the failure this design acquires with age: a pack that has weakened until the sequence no longer fits its window. SmartDriveUnsafeShutdownsGrowing is the only thing that would report it, which is exactly the rule ADR-0049 put there.

Not changed

ADR-0049 is unamended, deliberately. It says the low-battery point is the card's, read rather than chosen, and that the measurement is what says whether it is enough. This is that reading arriving before the build instead of after it — the decision is unchanged, so there is nothing to supersede.

Verification

🤖 Generated with Claude Code

Gerrrt and others added 2 commits September 21, 2026 04:51
…utdown sequence overruns, so raising it becomes step zero

Read off mjolnir on 2026-09-21: upsAdvConfigLowBatteryRunTime is 0:0:02:00,
APC's factory default and never changed. That is the moment the card raises
LB, and LB is the starting gun — every subscriber begins halting there and
has to finish before the pack is empty.

It does not fit. HOSTSYNC 120 and FINALDELAY 30 are 150 seconds before the
firewall begins halting at all, against a 120-second window, before two
guests and a pool export are counted. Built against the factory value the
hosts would lose power part-way through the shutdown that exists to prevent
exactly that.

So the runbook gains a §0 that raises it to 8 minutes before anything else,
chosen to be safely too large rather than right: §5 times the sequence, §6
measures what a minute of pack is worth, and §6.5 now sets the final value
downward from those two readings instead of discovering the problem there.

Two smaller corrections from the same reading. Saruman runs two guests,
alexander (140) and phoenix (170), not the four §1 assumed, so the primary's
wait is generous rather than tight and §5 will bring it down. And the
troubleshooting list gains the failure this creates years from now: a pack
that has aged until the sequence no longer fits, which shows up as
SmartDriveUnsafeShutdownsGrowing and nothing else.

ADR-0049 is unamended. It said the threshold is the card's, read rather than
chosen, and that the measurement says whether it is enough — this is that
reading arriving earlier than expected, not a different decision.

scripts/validate.sh passes, 94 checks, no failures.

Refs #574.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit d9a6f1e into main Sep 21, 2026
3 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/ups-lb-threshold-first branch September 21, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant