From e462cdc16ae1fde8b0454fadffbae00a18e15d0e Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Tue, 24 Nov 2026 09:07:41 -0800 Subject: [PATCH 1/2] fix(observability): exclude the range host's resting state from host alerts Onboarding gandalf to monitoring (#1651) added the agent and range.rules.yaml but not the two exclusions the estate already has for a host whose guests are meant to be stopped. HypervisorGuestStopped fired on the three targets and ragnarok; SmartDriveBadSectors on the range SSD's known 8 reallocated sectors. Tag the range guests (disposable on the targets, on-demand on ragnarok -- done on the box, ADR-0071/0079) and record the SSD baseline in render-smart-baselines.sh. build-the-playground.md's Monitoring section now lists both as onboarding steps. Co-Authored-By: Claude Opus 4.8 --- docs/changelog.md | 12 ++++++++++++ docs/runbooks/build-the-playground.md | 17 +++++++++++++++++ scripts/render-smart-baselines.sh | 7 +++++++ 3 files changed, 36 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index d095d7a07..ff0dccd48 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,18 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-24 +- **Five warnings on `gandalf` were the estate's general host rules firing on the + range host's resting state — the exclusions the estate already has were missing + from the `#1651` monitoring onboarding.** `HypervisorGuestStopped` paged on the + three targets and `ragnarok`, all stopped by design, and `SmartDriveBadSectors` + on the range SSD's known 8 reallocated sectors. The targets are now tagged + `disposable` and `ragnarok` `on-demand` ([ADR-0071](adr/0071-run-disposable-investigations-on-a-guest-that-is-destroyed.md), + [ADR-0079](adr/0079-tag-on-demand-guests-and-leave-them-out-of-the-stopped-guest-alert.md)), + which `HypervisorGuestStopped` excludes, and the SSD's 8 — stable since + 2026-11-13, overall assessment passing, ~90% endurance left — is recorded in + `render-smart-baselines.sh`, so `SmartDriveBadSectors` accepts it and still + pages if it grows. `build-the-playground.md`'s *Monitoring the host* now lists + both as onboarding steps. - **`heimdall` runs every step of `build-heimdall.md` and has rebooted onto them.** This completes the entry "An audit of `heimdall` found that its browser never updated by itself", which left the sudo file in place and the diff --git a/docs/runbooks/build-the-playground.md b/docs/runbooks/build-the-playground.md index b622c6deb..9e992fa02 100644 --- a/docs/runbooks/build-the-playground.md +++ b/docs/runbooks/build-the-playground.md @@ -1509,6 +1509,23 @@ healthy. `DisposableGuestOutlived` also begins covering any `disposable`-tagged guest here. Host uptime is deliberately not alerted: an always-on host has no "up too long" fault (ADR-0126). +**Tag the range guests, and baseline the range SSD — or the general host rules +fire on `gandalf`'s resting state.** `HypervisorGuestStopped` in +[`host.rules.yaml`](../../stacks/observability/prometheus/rules/host.rules.yaml) +pages on any guest stopped for an hour unless it is tagged `disposable` or +`on-demand`, a template, or mid-clone (ADR-0071, ADR-0079). The range's targets +sit stopped and reverted between sessions, and `ragnarok` is stopped until a +session needs it, so tag them — once, as root on `gandalf`: +`qm set --tags disposable` for each target (100, 101, 102) and +`qm set 130 --tags 'attack;range;on-demand'` for `ragnarok`. And +`SmartDriveBadSectors` pages above a recorded baseline, so a drive with a known +count needs a row in +[`render-smart-baselines.sh`](../../scripts/render-smart-baselines.sh): the +range pool's SSD read 8 reallocated sectors on 2026-11-24 (#1651), stable since +2026-11-13, and now carries that baseline. Both were missed when `gandalf` was +first onboarded, and both surfaced as five warnings the day the guests crossed +the hour. + --- ## 8. Check the four properties diff --git a/scripts/render-smart-baselines.sh b/scripts/render-smart-baselines.sh index 7dc795c81..9da12769b 100755 --- a/scripts/render-smart-baselines.sh +++ b/scripts/render-smart-baselines.sh @@ -90,9 +90,16 @@ PROM="${TEXTFILE_DIR}/smart-baselines.prom" # letter is not stable across reboots, and since #745 the row names # the port: the S3520 is on the chipset AHCI's ata6 (hardware.md). # The count, 4, has not changed since 2026-09-16. +# gandalf Intel SSDSC2BB960G7, the range pool's SATA SSD, ~49,462 power-on +# hours and 8 reallocated sectors when read on 2026-11-24 — stable +# since the audit of 2026-11-13, overall assessment passing, ~90% +# endurance left. The count surfaced only once gandalf began pushing +# metrics (#1651, ADR-0126); its collector emits the slot, so the row +# names the port, the S3510 on the chipset AHCI's ata1. BASELINES=( "oracle /dev/sda 32 2026-09-07 351" "smaug pci-0000:00:17.0-ata-6 4 2026-09-16 483" + "gandalf pci-0000:00:17.0-ata-1 8 2026-11-24 1651" ) die() { printf '\033[0;31merror:\033[0m %s\n' "$*" >&2; exit 1; } From 05ee7465aa4377a76609415bae8f25f2147c5621 Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Tue, 24 Nov 2026 09:17:22 -0800 Subject: [PATCH 2/2] fix(observability): on-demand not disposable for range targets; tofu for ragnarok Review on #1714, both correct: - disposable on the targets would fire DisposableGuestOutlived once they pass fourteen days from creation (host.rules.yaml), since the targets are reverted and kept, not destroyed. All four range guests are on-demand instead. - ragnarok is tofu-managed and the guest module ignores only startup/started, not tags, so a hand-set on-demand is undone on the next apply. Declare it in tofu/guests.tf beside attack and range. Re-tagged 100/101/102 on-demand on the box; runbook and changelog updated. Co-Authored-By: Claude Opus 4.8 --- docs/changelog.md | 11 +++++++---- docs/runbooks/build-the-playground.md | 11 ++++++++--- tofu/guests.tf | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index ff0dccd48..bb6b11d11 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -23,10 +23,13 @@ docstring gives: it is a record, not a claim about now. range host's resting state — the exclusions the estate already has were missing from the `#1651` monitoring onboarding.** `HypervisorGuestStopped` paged on the three targets and `ragnarok`, all stopped by design, and `SmartDriveBadSectors` - on the range SSD's known 8 reallocated sectors. The targets are now tagged - `disposable` and `ragnarok` `on-demand` ([ADR-0071](adr/0071-run-disposable-investigations-on-a-guest-that-is-destroyed.md), - [ADR-0079](adr/0079-tag-on-demand-guests-and-leave-them-out-of-the-stopped-guest-alert.md)), - which `HypervisorGuestStopped` excludes, and the SSD's 8 — stable since + on the range SSD's known 8 reallocated sectors. All four range guests are now + tagged `on-demand` ([ADR-0079](adr/0079-tag-on-demand-guests-and-leave-them-out-of-the-stopped-guest-alert.md)), + which `HypervisorGuestStopped` excludes — not `disposable` + ([ADR-0071](adr/0071-run-disposable-investigations-on-a-guest-that-is-destroyed.md)), + which the targets would outlive, since they are reverted and kept rather than + destroyed. `ragnarok`'s tag is declared in `tofu/guests.tf` so an apply keeps + it; the targets, not in `tofu/`, are tagged by hand. The SSD's 8 — stable since 2026-11-13, overall assessment passing, ~90% endurance left — is recorded in `render-smart-baselines.sh`, so `SmartDriveBadSectors` accepts it and still pages if it grows. `build-the-playground.md`'s *Monitoring the host* now lists diff --git a/docs/runbooks/build-the-playground.md b/docs/runbooks/build-the-playground.md index 9e992fa02..a211d485f 100644 --- a/docs/runbooks/build-the-playground.md +++ b/docs/runbooks/build-the-playground.md @@ -1515,9 +1515,14 @@ fire on `gandalf`'s resting state.** `HypervisorGuestStopped` in pages on any guest stopped for an hour unless it is tagged `disposable` or `on-demand`, a template, or mid-clone (ADR-0071, ADR-0079). The range's targets sit stopped and reverted between sessions, and `ragnarok` is stopped until a -session needs it, so tag them — once, as root on `gandalf`: -`qm set --tags disposable` for each target (100, 101, 102) and -`qm set 130 --tags 'attack;range;on-demand'` for `ragnarok`. And +session needs it, so both are `on-demand` — not `disposable`, which the targets +would outlive: `DisposableGuestOutlived` fires on a `disposable` guest once it +passes fourteen days from creation, stopped or not, and the targets are kept and +reverted, not destroyed. The targets are not in `tofu/`, so tag them by hand, +once as root on `gandalf`: `qm set --tags on-demand` for each (100, 101, +102). `ragnarok` is `tofu`-managed, so its `on-demand` is declared in +[`tofu/guests.tf`](../../tofu/guests.tf) beside `attack` and `range`, not set by +hand — a `qm set` there is undone on the next apply. And `SmartDriveBadSectors` pages above a recorded baseline, so a drive with a known count needs a row in [`render-smart-baselines.sh`](../../scripts/render-smart-baselines.sh): the diff --git a/tofu/guests.tf b/tofu/guests.tf index 25b4116c3..fa8b265cc 100644 --- a/tofu/guests.tf +++ b/tofu/guests.tf @@ -268,7 +268,7 @@ locals { name => merge(g, { mac_address = var.guest_identities[name].mac_address smbios_uuid = var.guest_identities[name].smbios_uuid - tags = ["attack", "range"] + tags = ["attack", "range", "on-demand"] extra_networks = [{ bridge = "vmbr1", ipv4_address = "172.30.30.10/24" }] }) }