Put hosts with unloaded CPU microcode updates in reboot
CI / tests (Python 3.10) (pull_request) Successful in 40s
CI / tests (Python 3.11) (pull_request) Successful in 39s
CI / tests (Python 3.12) (pull_request) Successful in 38s
CI / tests (Python 3.13) (pull_request) Successful in 38s
CI / lint (pull_request) Failing after 3s

On bare metal, needrestart -b reports NEEDRESTART-UCSTA: 2 when the
installed intel-microcode/amd64-microcode is newer than what the CPU
loaded at boot, which only a reboot fixes. The agent dropped those
lines. It now reports needrestart_ucsta, _uccur and _ucexp, and the
server puts the host in reboot with both revisions. Livepatch doesn't
cover it. needrestart skips the check in VMs, so only physical hosts
(debian-homelab today) report it; the host page gets a "CPU microcode"
row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-11-01 15:25:57 -05:00
1 parent 4676942108
commit 8174f1df81
8 files changed
+79 -1

No files matched your search

+7
View File
@@ -30,6 +30,8 @@ LIVEPATCH_HEALTHY_STATES = ("applied", "nothing-to-apply")
KSTA_CURRENT = 1
KSTA_ABI_UPGRADE = 2
KSTA_VERSION_UPGRADE = 3
# needrestart's NEEDRESTART-UCSTA: a newer CPU microcode is installed but not loaded.
UCSTA_OBSOLETE = 2
@dataclass
@@ -309,6 +311,11 @@ def evaluate(received_at: int | None, report: dict[str, Any] | None, now: float,
status.raise_to("reboot", f"/run/reboot-required{detail}")
if livepatch_note and not covered:
status.note(livepatch_note)
# Microcode loads at boot; Livepatch doesn't cover it.
if report.get("needrestart_ucsta") == UCSTA_OBSOLETE:
cur, exp = report.get("needrestart_uccur"), report.get("needrestart_ucexp")
detail = f" ({cur} → {exp})" if cur and exp else ""
status.raise_to("reboot", f"CPU microcode update installed but not loaded{detail}")
# An agent whose apt simulation failed sends no update counts, so "no security
# updates" would be a guess. Agents before 0.5.0 don't send the field.