Skip to content

fix(site): Time local VM burn-in from image delivery - #249

Merged
scotwells merged 1 commit into
feat/manual-inventory-recordsfrom
fix/vm-burnin-timing
Nov 28, 2026
Merged

scotwells merged 1 commit into
feat/manual-inventory-recordsfrom
fix/vm-burnin-timing

Conversation

@scotwells

@scotwells scotwells commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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-complete lines this timing reads.

Test plan

  • Unit tests: VM slow boot, round-up, restart after an early receipt and missing sighting each fail on the old worker
  • Both failure messages tested in both workers
  • Both multi-plane runs pass on this head

🤖 Generated with Claude Code

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 scotwells added the multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners label Nov 28, 2026
@scotwells scotwells changed the title Time local VM burn-in from image delivery, not VM start fix(site): Time local VM burn-in from image delivery Nov 28, 2026
@scotwells
scotwells marked this pull request as ready for review November 28, 2026 20:37
@scotwells
scotwells requested a review from a team as a code owner November 28, 2026 20:37
@scotwells
scotwells requested review from ecv and kevwilliams and removed request for a team November 28, 2026 20:37

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.go complete), so it can only be earlier, never later. Never lengthening a burn-in holds.
  • Tamper checks bite: dropping Exact: true fails TestABurnInShorterThanThePlanFails, TestASlowBootDoesNotLengthenTheBurnIn and the watched-restart case; dropping the one-second round-up fails TestBurnInStartsTheSecondAfterTheLastDelivery and TestDeliveryIsRoundedUpToTheNextSecond.
  • 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 Measure clamps to zero and fails as Restarted. 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.Measure and the new !k.PXE refusal in vmwork.Commissioning.Check. The VM boot log path (Key(work.Key())) matches the directory vmwork/boot.go writes, and the 4-field write-complete format matches.
  • Making the burn-in stage unconditionally network-booted removes the k.PXE branches in burnIn; the multi-plane VM site already sets PXE: true, and direct.PXE = false is 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-complete line (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.
  • waitBurnIn now polls the console every k.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.

@scotwells
scotwells merged commit 8948787 into feat/manual-inventory-records Nov 28, 2026
20 checks passed
@scotwells
scotwells deleted the fix/vm-burnin-timing branch November 28, 2026 20:54

@kevwilliams kevwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both workers now share one burnin package, so start comes from image delivery, end from the last receipt-free sighting, and missing records fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants