Repository navigation
feat(range): keep gandalf on, stop ragnarok on a timer (ADR-0125) - #1652
Merged
Merged
Conversation
ADR-0125 supersedes ADR-0124. The host stays on. The power-off timer is retargeted at the attack VM: scripts/ragnarok-stop.sh stops VM 130 six hours after it starts, or at the deadline the last range-extend set for that run, with warnings on the host and inside the VM and a dpkg wait asked through the guest agent. Installed and proved on gandalf. The runbook records the audit fixes applied on gandalf the same evening (§2, §4, the reboot read-back and §8 check four), and the current-state docs drop "off between sessions" for the host. Monitoring the host is Refs #1651. Closes #1647. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
A critical shutdown race can stop a replacement VM run using an expired deadline, while unstable deadline calculations can repeat warnings and timer activation can prematurely stop an overdue VM.
3 open issues
What changed in this PR
Implements ADR-0125: keep the range host gandalf running while moving the automatic shutdown deadline to its attack VM, ragnarok.
Changes:
- Replaces host power-off automation with a VM stop timer, per-run extensions, guest warnings and package-install checks.
- Updates installation procedures and records deployed hardening and timer verification.
- Documents the new operating policy and tracks host monitoring separately in #1651.
| File | Description |
|---|---|
systemd/README.md |
Documents the VM stop timer. |
systemd/range/homelab-range-poweroff.service |
Removes the host power-off service. |
systemd/range/homelab-ragnarok-stop.timer |
Retargets minute-by-minute checks to the VM. |
systemd/range/homelab-ragnarok-stop.service |
Adds the VM stop service and writable paths. |
scripts/self-tests.sh |
Updates fixture-suite documentation. |
scripts/README.md |
Describes VM deadlines and extensions. |
scripts/range-poweroff.sh |
Removes host shutdown automation. |
scripts/ragnarok-stop.sh |
Implements VM deadline enforcement and fixtures. |
README.md |
Updates the ADR count to 125. |
docs/runbooks/shut-down-on-the-ups.md |
Reflects the always-on range host. |
docs/runbooks/build-the-playground.md |
Updates timer installation and records deployment checks. |
docs/roadmap.md |
Replaces power-off work with monitoring follow-up. |
docs/network.md |
Updates the range host’s operating policy. |
docs/hardware.md |
Updates the KVM table’s host description. |
docs/diagrams/current/rack-32u.svg |
Removes the off-between-sessions label. |
docs/changelog.md |
Records the policy change and applied audit fixes. |
docs/architecture.md |
Describes the always-on host and VM deadline. |
docs/adr/0125-keep-gandalf-on-and-stop-ragnarok-on-a-timer.md |
Defines the new policy and accepted costs. |
docs/adr/0124-power-gandalf-off-on-a-timer.md |
Marks host power-off policy superseded. |
docs/adr/0017-buy-ifrit-for-iops-and-keep-the-range-disposable.md |
Notes the policy change and monitoring follow-up. |
Review effort: Balanced
…tover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… time Review on #1652: - Read the PID again just before qm shutdown, so a VM restarted during the guest-agent calls is not stopped by the old run's deadline. - Take the start time from /proc/<pid>/stat instead of now minus ps etimes, which could move by a second and repeat a warning. - §7 enables the timer last, after status and a chance to extend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
enabled auto-merge (squash)
November 23, 2026 03:55
5 of 6 tasks
Gerrrt
added a commit
that referenced
this pull request
Nov 23, 2026
…y volume list Review on #1653: - Restore the #1652 audit-fixes changelog entry verbatim and record the leftovers cleanup in a new dated entry that names it, per the changelog's own immutability rule. - The local-lvm removal now lists the data pool's thin volumes and requires none, instead of reading Data% 0.00 (which an unwritten thin volume also shows). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
Policy:
gandalfstays on, and the attack VM stops on a timer. ADR-0125 supersedes ADR-0124 the day it was accepted.scripts/range-poweroff.shbecomesscripts/ragnarok-stop.sh, andsystemd/range/'s units are renamed to match.ragnarok(VMID 130) starts.range-extend Hstill sets it 1 to 12 hours ahead. The extension is stored with the QEMU process's PID, so it never carries into the next start.dpkgwait asks the agent about the VM's lock.qm shutdown --timeout 180 --forceStop 1.ProtectSystem=strictfor explicit writable paths thatqmneeds, and getsTimeoutStartSec=300.gandalf, is opened and replaces Power gandalf off on a timer (ADR-0124) #1647 on the roadmap.build-the-playground.md:-o ControlPath=none.rmfor the residue the first one missed.gandalfnow say it stays on:hardware.md,network.md,architecture.md,shut-down-on-the-ups.md, and the rack diagram with its PNG.scripts/README.md,systemd/README.mdandscripts/self-tests.share updated, and README's ADR count is 125.Why
The owner would rather
gandalfstay on, with Kali off until it's needed. ADR-0124's own Context names the exposure:ragnarokon VLAN 30. A host that powers itself off makes every session start at the rack, because the BIOS powers on only at the button and AMT is disabled.The other findings from the 2026-11-22 audit were applied on the box in the same session, so the runbook now records them as done. The cost ADR-0125 accepts is a host firewall nobody checks while the box is up, until #1651. That's why #1651 is opened now rather than left as an idea.
Closes #1647.
Refs #421, #1651.
Blast radius
gandalfonly. The new timer can stopragnarok, which is the point. It never touches the host or the targets.secrets/*.sops.yamlVerification
make validatepasses. It wasn't run, because this Mac has no docker daemon. What ran:python3 scripts/check_docs.py:docs OK.markdownlint-cli20.24.1 throughnpx:0 issues.shellcheckon the script: clean.bash scripts/ragnarok-stop.sh --self-test: 22 pass on macOS, where the 2 lock interleavings skip with noflock. Ongandalf, all 25 checks pass../scripts/lint.sh: yamllint, ruff, shellcheck and actionlint pass (the last two are local binaries, not the pinned ones). markdownlint, zizmor, packer, tofu and editorconfig-checker were skipped with no docker. ansible-lint FAILED on the same local runner error as docs(range): write gandalf's 2026-11-22 audit fixes into the runbook #1646 (--pip-args contains '-c'). This PR touches no Ansible.gandalfat 19:26, replacing ADR-0124's, and proved at 19:32 with a deadline a few minutes out:deadline … has passed; stopping ragnarok, and theqmshutdowntask endedOKin 2 seconds under the unit's sandbox.statusreadnot running, andrange-extendrefused with exit1.wallreturned 0).sha256sum.🤖 Generated with Claude Code