Repository navigation
fix(site): Time local VM burn-in from image delivery - #249
Merged
Merged
Conversation
The local VM commissioning worker timed burn-in from the guest's start to the journaled verdict, so a slow network boot or a worker restart after an early receipt could make a short burn-in pass. It now uses the Redfish worker's rules through a shared burnin package: burn-in starts the second after the boot server's last delivery and ends at the last stored sighting of the console without the receipt. A site that boots its guest directly has no delivery log, so it refuses commissioning. A short burn-in no worker watched end, because a restart fell inside it, now fails with its own mismatch so staff know a re-run may pass. Related to #196 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
marked this pull request as ready for review
November 28, 2026 20:37
scotwells
requested review from
ecv and
kevwilliams
and removed request for
a team
November 28, 2026 20:37
ecv
approved these changes
Nov 28, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
The shared burn-in timing is correct: the VM worker now measures from one second after the boot server's last write-complete to the last stored sighting without the receipt, and the Redfish measurement is the same code with only a conservative shift. I ran go test ./internal/site/... at 79f6b09 (green) and both multi-plane acceptance runs pass.
- Metal timing is unchanged in substance. The only behavioural delta is that the "no receipt" sighting time is now taken before the console read instead of after (
kinds.gocomplete), so it can only be earlier, never later. Never lengthening a burn-in holds. - Tamper checks bite: dropping
Exact: truefailsTestABurnInShorterThanThePlanFails,TestASlowBootDoesNotLengthenTheBurnInand the watched-restart case; dropping the one-second round-up failsTestBurnInStartsTheSecondAfterTheLastDeliveryandTestDeliveryIsRoundedUpToTheNextSecond. - Restart/resume is sound. A worker restarted after the receipt reads the stored sighting, at most 30s stale, so the result can only be shorter; with no stored sighting
Measureclamps to zero and fails asRestarted. The VM worker lists domains before reading the console, so a guest seen stopped has already written its receipt and the final read cannot be missed. - Doc and code agree: the device-custody.md text (zero with no stored time, two mismatch messages, direct-boot VM site refuses) matches
burnin.Measureand the new!k.PXErefusal invmwork.Commissioning.Check. The VM boot log path (Key(work.Key())) matches the directoryvmwork/boot.gowrites, and the 4-fieldwrite-completeformat matches. - Making the burn-in stage unconditionally network-booted removes the
k.PXEbranches inburnIn; the multi-plane VM site already setsPXE: true, anddirect.PXE = falseis covered by a refusal test.
Follow-ups:
- A worker restart that falls inside a burn-in that really ran long enough still ends
Failed("could not be proven long enough across a worker restart"). That is the intended trade, but nothing tells an operator how to re-run from the message alone; consider naming the re-run step in the evidence or docs. - A VM site that stops delivering a
write-completeline (for example the media path in #229) now fails burn-in with "the boot log does not record when burn-in began". The PR body already says #229 must check this; add a test there that pins the log format. waitBurnInnow polls the console everyk.poll()(default 1s) and writes a store record at most every 30s per worker; a note on store write load for long burn-ins (up to 24h) would help, but nothing breaks.
kevwilliams
approved these changes
Nov 28, 2026
kevwilliams
left a comment
Contributor
There was a problem hiding this comment.
Both workers now share one burnin package, so start comes from image delivery, end from the last receipt-free sighting, and missing records fail.
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.
Related to #196.
The local VM commissioning worker now times burn-in with the same shared rules as the Redfish worker: from the second after the boot server's last delivery to the last stored sighting of the console without the receipt. A slow boot, or a restart after an early receipt, can no longer make a short burn-in pass. A site with no network boot now refuses commissioning. The only VM site config always network-boots. In both workers, a short burn-in that no worker saw end, because a restart fell inside it, fails with its own message so staff know to re-run.
Landing
Land this before the virtual media delivery work (#229, #231) and the other PRs that edit the site workers (#194, #209, #210). Those rebase onto it. #229 must check that its media path still writes the
write-completelines this timing reads.Test plan
🤖 Generated with Claude Code