feat(proxmox): choose which stopped guests are reported, per-guest settings, and a setup script #50

Manually merged
jfro merged 7 commits from feat/43-44-proxmox into main 2026-11-10 22:01:12 +00:00
Owner

Closes #43, closes #44.

#44: sleeping VMs, and which guests get which reports

Source-wide (D3): a new Report stopped guests setting on Proxmox sources:

  • All set to start at boot (default, today's behavior)
  • Only crashes and failed starts: leaves out guests stopped, shut down, or hibernated through Proxmox
  • Never (also skips fetching guest tasks)

Per guest (D5/D6, D8-D10): a Rules for single guests section in the source's form. Only guests with a rule get a row; you add one by searching the live guest list in a dropdown picker and remove it with ×. Each rule offers: Ignore, May be stopped (never reported stopped, paused, or hibernated; io-error and HA errors still report), Skip backup check (left out of backup coverage only), and Severity.

  • Proxmox tags keep working and apply too. Tagged guests show their tags; a lamplighter-ignore tag shows as a checked, locked Ignore, and the severity select says what the tag sets. A severity set here beats a severity tag.
  • Only overrides are stored (settings.guests, keyed by vmid, with a name snapshot). Guests with only Proxmox tags are listed in one line under the picker. Guests gone from Proxmox keep their rule, marked Not found in Proxmox, until removed by hand. If the list can't load, stored settings are shown and saved back unchanged.
  • The edit page loads guests on open; a new source loads them after a working Test connection (or Load guests). As with Test connection, loading after the URL changed never sends the stored token to the new address.
  • Guests that may be stopped get no config or task fetches each poll.

Hibernation (F1): qmsuspend/vzsuspend now count as stop tasks ("root@pam hibernated it …"), and a config locked suspended counts as stopped on purpose, so a hibernated VM is no longer blamed on a crash.

No new env vars or dependencies. New stored settings are stopped_guests and guests on Proxmox sources.

#43: setup script

The setup guide now starts with a single script to paste on a node as root. It creates the read-only user and token, then prints the token ID, the secret, and the cluster's CA certificate. Update and syslog access are opt-in (UPDATES=yes / SYSLOG=yes at the top). The commands it runs are still listed for doing it by hand. A test runs it against a fake pveum, and pveum ... --output-format json gives the secret.

Screenshots (example data, fake Proxmox API)

Guest rules, desktop: two sleeping Fortysix VMs set to May be stopped, nextcloud set to Serious, k3s nodes skip backup, one guest not found in Proxmox, and the tagged guests listed under the picker:

Adding a rule: typing in the picker, desktop and 390px:

Guest rules, 390px:

Report stopped guests, desktop and 390px:

Setup guide with the script, desktop and 390px:

Checks

mix precommit is clean (840 tests). New tests cover policy merging (tag and setting), may-stop and its skipped fetches, the three stopped-guests modes, stop_kind including the hibernation lock, the setting normalizer and its round trip (clearing the last guest really clears it), and the form: load, the search picker (filtering, adding, Escape), save, error, removal, and no token sent to a changed URL.

Closes #43, closes #44. ## #44: sleeping VMs, and which guests get which reports **Source-wide (D3):** a new **Report stopped guests** setting on Proxmox sources: - *All set to start at boot* (default, today's behavior) - *Only crashes and failed starts*: leaves out guests stopped, shut down, or hibernated through Proxmox - *Never* (also skips fetching guest tasks) **Per guest (D5/D6, D8-D10):** a *Rules for single guests* section in the source's form. Only guests with a rule get a row; you add one by searching the live guest list in a dropdown picker and remove it with ×. Each rule offers: **Ignore**, **May be stopped** (never reported stopped, paused, or hibernated; io-error and HA errors still report), **Skip backup check** (left out of backup coverage only), and **Severity**. - Proxmox tags keep working and apply too. Tagged guests show their tags; a `lamplighter-ignore` tag shows as a checked, locked Ignore, and the severity select says what the tag sets. A severity set here beats a severity tag. - Only overrides are stored (`settings.guests`, keyed by vmid, with a name snapshot). Guests with only Proxmox tags are listed in one line under the picker. Guests gone from Proxmox keep their rule, marked *Not found in Proxmox*, until removed by hand. If the list can't load, stored settings are shown and saved back unchanged. - The edit page loads guests on open; a new source loads them after a working **Test connection** (or **Load guests**). As with Test connection, loading after the URL changed never sends the stored token to the new address. - Guests that may be stopped get no config or task fetches each poll. **Hibernation (F1):** `qmsuspend`/`vzsuspend` now count as stop tasks ("root@pam hibernated it …"), and a config locked `suspended` counts as stopped on purpose, so a hibernated VM is no longer blamed on a crash. No new env vars or dependencies. New stored settings are `stopped_guests` and `guests` on Proxmox sources. ## #43: setup script The setup guide now starts with a single script to paste on a node as root. It creates the read-only user and token, then prints the token ID, the secret, and the cluster's CA certificate. Update and syslog access are opt-in (`UPDATES=yes` / `SYSLOG=yes` at the top). The commands it runs are still listed for doing it by hand. A test runs it against a fake `pveum`, and `pveum ... --output-format json` gives the secret. ## Screenshots (example data, fake Proxmox API) Guest rules, desktop: two sleeping Fortysix VMs set to *May be stopped*, nextcloud set to Serious, k3s nodes skip backup, one guest not found in Proxmox, and the tagged guests listed under the picker: <img src="https://git.knope.dev/attachments/7d43e0c9-3527-453a-a0c6-ddad70777e8a" width="640"> Adding a rule: typing in the picker, desktop and 390px: <img src="https://git.knope.dev/attachments/37547313-9190-42a4-ba67-764933374c08" width="640"> <img src="https://git.knope.dev/attachments/fbf38b23-35ac-4ff8-ad2a-7b49b8eb2105" width="300"> Guest rules, 390px: <img src="https://git.knope.dev/attachments/18580f7f-66c0-493a-9ef4-7bd69158263e" width="300"> Report stopped guests, desktop and 390px: <img src="https://git.knope.dev/attachments/fce71098-6c06-430e-909c-7cb73429fa17" width="640"> <img src="https://git.knope.dev/attachments/8aea8b28-ffa4-4096-9d4d-c5a4534a902b" width="300"> Setup guide with the script, desktop and 390px: <img src="https://git.knope.dev/attachments/3e84f330-3a28-4679-b2f5-cde8a1e47d17" width="640"> <img src="https://git.knope.dev/attachments/5248cb8b-9f22-48de-a512-c76d87fe6708" width="300"> ## Checks `mix precommit` is clean (840 tests). New tests cover policy merging (tag and setting), may-stop and its skipped fetches, the three stopped-guests modes, `stop_kind` including the hibernation lock, the setting normalizer and its round trip (clearing the last guest really clears it), and the form: load, the search picker (filtering, adding, Escape), save, error, removal, and no token sent to a changed URL.
A "Report stopped guests" setting picks all guests set to start at boot (as
before), only crashes and failed starts, or none. Per-guest settings (ignore,
may be stopped, skip backup check, severity) apply alongside Proxmox tags.
Hibernated guests (qmsuspend/vzsuspend, or a config locked "suspended")
count as stopped on purpose instead of blamed on a crash.

Refs #44
The setup guide now starts with a script that creates the read-only user and
API token and prints the token ID, its secret, and the cluster's CA
certificate. Update and syslog access are opt-in at its top. The commands it
runs stay listed for doing it step by step.

Closes #43
feat(proxmox): per-guest settings in the source's form
All checks were successful
CI / test (pull_request) Successful in 1m13s
4405d839e2
A new item_settings field type lists what a source loads live (Proxmox's
guests) with settings for each: ignore, may be stopped, skip backup check,
and severity. Tags set on a guest show next to it. Guests gone from Proxmox
keep their settings, listed apart, until removed; a list that can't load
keeps the stored settings as they are. Loading guests after the address
changed never sends the stored token to the new address.

Closes #44
fix(proxmox): count resumes as starts so a resumed guest's crash isn't hibernation
All checks were successful
CI / test (pull_request) Successful in 1m13s
188aee26f1
feat(proxmox): add guest rules from a search picker instead of listing every guest
All checks were successful
CI / test (pull_request) Successful in 1m14s
2971e5ea1b
Only guests with a rule get a row. A search box finds a guest to add one,
guests set by Proxmox tags are listed in one line, and every rule can be
removed.
fix(proxmox): label an untagged guest's default severity 'Default (critical)'
All checks were successful
CI / test (pull_request) Successful in 1m14s
c9c703435f
fix(proxmox): Enter picks the top guest and Escape closes the add-a-rule picker
All checks were successful
CI / test (pull_request) Successful in 1m14s
2b4a0f2b64
Enter in the search box submitted (and saved) the whole source form, and
Escape cleared the type=search input, which the form saw as new search text
and reopened the list. An ItemPicker hook now handles both keys.
jfro manually merged commit d5ac10bcb6 into main 2026-11-10 22:01:12 +00:00
Sign in to join this conversation.
No description provided.