Skip to content

feat(site): Commission a server over Redfish - #196

Merged
scotwells merged 3 commits into
feat/manual-inventory-recordsfrom
feat/device-commissioning-redfish
Nov 28, 2026
Merged

scotwells merged 3 commits into
feat/manual-inventory-recordsfrom
feat/device-commissioning-redfish

Conversation

@scotwells

@scotwells scotwells commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Related to #185. Stacked on #195.

A site can commission a server over Redfish. It checks hardware and firmware with reads only, boots the plan's burn-in image once, and reports a proven pass or fail. A BMC that reports another serial or system UUID gets no verdict: the operation is refused before anything is sent. Every member of each hardware and firmware collection is read, following Redfish paging, and a collection that reaches 1,024 members or 64 pages fails the inspection. Burn-in is timed from when the boot server delivered the image to the last time a worker saw no receipt, so neither a slow firmware start nor a worker restart after an early report can make a short burn-in pass. A firmware baseline matches the inventory entry with its Id, and a Name two entries share matches neither. No site registers the worker until #200.

Landing

The capacity stack lands first: #182, #219, #208 and #232 (all merged), then #195, #196, #200 and #201. Overlapping PRs on other stacks (cleaning #193, #202, #205, #206 and #207, power #190, NSO and IPAM #198 and #225, virtual media #229) rebase onto it, and #205 adds its NVMe lab drive on top of the lab model in #196.

What the lab now proves

The lab emulator reports each target's serial, its one real disk and a firmware inventory. The worker reads disks from the simpler storage listing when the newer one lists none. In the multi-plane Redfish runs on the top of the stack, the site commissions lab target A through the emulator. Hardware and firmware match the plan, the server boots once over the network, its one burn-in receipt says passed, and target B receives nothing.

Test plan

  • Tests pass with the race detector, including a resumed worker, two burn-in receipts, a short burn-in, a slow network boot, a twice-linked drive, an empty storage listing, disabled memory, and burn-in timed from the second after the last delivered file
  • A faulty memory module past the 64th is found across pages, a collection at the member or page bound fails, a stalled GET fails at the client's per-request timeout, a worker killed after an early receipt still fails the too-short check, and a previous firmware version listed first does not match
  • A hardware or firmware mismatch, or a burn-in image the site does not serve, sends no effect to the BMC stub
  • The lab adapter self-test reads the serial, the one disk and the firmware inventory, and both Redfish acceptance shards commission against it on the top of the stack
  • Manifest, Milo packaging, overlay isolation and harness checks pass

🤖 Generated with Claude Code

@scotwells
scotwells requested review from ecv and kevwilliams November 25, 2026 16:24
@scotwells
scotwells force-pushed the feat/device-commissioning-kind branch from c456ba3 to 02825ef Compare November 25, 2026 18:23
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch from c982b26 to 0f5e486 Compare November 25, 2026 18:23
@scotwells
scotwells force-pushed the feat/device-commissioning-kind branch from 02825ef to c147372 Compare November 25, 2026 21:36
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch 3 times, most recently from ee30ce8 to 4ff43c3 Compare November 25, 2026 22:51
@scotwells
scotwells force-pushed the feat/device-commissioning-kind branch from 407ca0a to 998d6b7 Compare November 28, 2026 01:23
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch from 4ff43c3 to c3c3e51 Compare November 28, 2026 01:25
@scotwells
scotwells force-pushed the feat/device-commissioning-kind branch from 998d6b7 to 2bcf71a Compare November 28, 2026 02:43
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch from c3c3e51 to 3888640 Compare November 28, 2026 02:43
@scotwells
scotwells force-pushed the feat/device-commissioning-kind branch from 2bcf71a to a7c1973 Compare November 28, 2026 03:10
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch from 3888640 to 4edbd10 Compare November 28, 2026 03:10
@scotwells
scotwells force-pushed the feat/device-commissioning-kind branch from a7c1973 to 87b08a6 Compare November 28, 2026 03:55
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch from 4edbd10 to 402c071 Compare November 28, 2026 03:55
@scotwells
scotwells force-pushed the feat/device-commissioning-kind branch from 87b08a6 to 6a28951 Compare November 28, 2026 16:30
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch from 49ccca5 to b7ceaad Compare November 28, 2026 16:30
@scotwells
scotwells marked this pull request as ready for review November 28, 2026 17:13
@scotwells
scotwells requested a review from a team as a code owner November 28, 2026 17:13
@scotwells
scotwells removed the request for review from a team November 28, 2026 17:13

@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.

Hold: inspection can report a wrong answer on large servers or after a worker restart.

  • members() stops silently at 64, so a server with more DIMM slots or firmware entries is undercounted, and a faulty DIMM past slot 64 is never health-checked. Fail when the cap is reached.
  • Burn-in end time is when the worker journals the verdict, not when the image reported it. A restart after an early report passes the too-short check. Time the end from the receipt.
  • checkFirmware takes the first inventory entry matching Name, so a previous version listed first can match the baseline while newer firmware runs. Prefer Id, or reject a name that matches more than one entry.

@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.

Request changes.

The worker only reads hardware and runs one network-booted burn-in, and it never flashes firmware. But the burn-in duration check can pass a run that was too short, and a pass makes the server allocatable.

  • Agree with kevwilliams on the burn-in end time: Run in internal/site/redfishwork/commissioning.go takes the end from work.JournaledAt("burnin-verified"), which is when the worker journaled the verdict, not when the image reported. A worker that restarts after an early report journals late, so completed.Sub(started) < duration passes. Time the end from the receipt or console log, not the journal.
  • Agree with kevwilliams on members() in internal/redfish/hardware.go: it stops silently at 64, so a server with more components is undercounted and a faulty one past slot 64 is never health-checked. Return an error when the cap is reached instead of truncating.
  • Agree with kevwilliams on checkFirmware: it takes the first inventory entry matching Name, so an old version listed first can satisfy the baseline while newer firmware runs. Match by Id, or reject a name that matches more than one entry.
  • Effects on the server are limited to power-off, a one-time PXE boot override and power-on, through the same journaled step machinery as wipe and install. Power-off and arm are marked Idempotent, power-on is sent once and observed after a crash (no sign of boot leaves the outcome unknown), and a stopped-at-deadline worker closes boot admission. Inspection and firmware evidence are stored before the first effect and reused on resume.
  • The worker does not itself check for an approved plan. It relies on coordinator admission from #195 (Pins and the qualified-approval check), so the plan gate is only as strong as that code.

Follow-ups:

  • Add a test that kills the worker between the receipt and the journal write and asserts the too-short check still fails.
  • Confirm each new Redfish GET has its own timeout, or state where the limit comes from; I found none in hardware.go beyond the caller's context.

scotwells and others added 3 commits November 28, 2026 11:28
Add the DeviceCommissioning worker. It inspects the server and checks its
firmware with GETs only, stores that passing evidence, then boots the
plan's burn-in image once over the network and reads its one result
receipt. A resumed worker reuses the stored inspection, so nothing read
after an effect becomes an inspection verdict. A mismatch, a failed or
short burn-in, or an unhealthy server after burn-in is a proven Failed
verdict. A plan whose burn-in image the site does not serve is refused
before anything is sent.

Burn-in is timed from the boot server's delivery of the image, not from
power-on, so a slow firmware start or network boot cannot make an
early-reporting image long enough.

The Redfish client reads processors, memory, storage, network interfaces
and the firmware inventory. Absent and Disabled memory does not count.
Drives come from Storage, counted once however often they are linked, or
from SimpleStorage when Storage yields no disk. The boot server passes the
burn-in duration to the image, and the lab boot image gains a burn-in
mode. Evidence names the approved plan reference, not a UID.

The lab adapter reports each target's serial, no longer links the
emulator's sample Storage drives, and serves a read-only firmware
inventory, so a commissioning can pass against the lab.

No site registers the worker yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The boot log records whole seconds, so burn-in is timed from the second
after the last delivered file. Nothing tested that round-up: timing from
the logged second passed every test. Pin it with a log whose files finish
out of order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three ways the Redfish commissioning worker could report a wrong answer:

- Hardware collections stopped silently at 64 members, so a server with
  more DIMM slots or firmware entries was undercounted and a faulty
  module past the 64th never checked. Inspection now follows every
  Members@odata.nextLink page and fails at 1,024 members or 64 pages.
- Burn-in ended when the worker journaled it, so a worker restarted
  after an early report passed the too-short check. It now ends at the
  last time a worker saw no receipt, stored as burn-in runs.
- A firmware baseline took the first entry matching Name. It now takes
  the entry with that Id, and refuses a Name two entries share.

A BMC reporting another serial or UUID is now refused instead of getting
a Failed verdict, which custody no longer accepts without the identity.
Each GET's limit is the client's per-request timeout, now documented and
pinned by a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells
scotwells force-pushed the feat/device-commissioning-redfish branch from b7ceaad to 54d9276 Compare November 28, 2026 17:59
@scotwells

Copy link
Copy Markdown
Contributor Author

Thanks, both. Every point is fixed at 54d9276, and each new test fails when its fix is removed.

  1. 64-member cap. The worker follows Members@odata.nextLink. A collection that reaches 1,024 members, 64 pages or 1,024 drives fails the inspection instead of being truncated. Tests read 96 DIMMs with the last one faulty, and check that a collection at the bound fails. A nextLink outside the collection, or an absolute URL, also fails.
  2. Burn-in end time. Burn-in now ends at the last time a worker saw the console without a receipt. The worker stores that time at least every 30s, and exactly when it first sees the receipt. A restart can therefore only shorten the measured run, never lengthen it. TestARestartAfterAnEarlyReceiptStillFailsTooShort is Evan's kill-between-receipt-and-journal case. The trade-off fails closed: a restart or a coarse poll can fail a run that really was long enough, and staff then commission again. With no stored record the measured run is zero, and the CRD requires at least one minute, so it always fails.
  3. Firmware match. A baseline matches by Id first. A Name shared by two inventory entries matches neither.
  4. Per-request timeout. Every GET, including paged reads, goes through the pinned client's http.Client with a 30s timeout. That is now documented and pinned by a test.
  5. Identity. With feat(custody): Add the commissioning kinds #195's change, a BMC that reports another serial or UUID is refused with DeviceIdentityMismatch before any effect.

@scotwells
scotwells requested review from ecv and kevwilliams November 28, 2026 18:57

@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.

Component reads now fail at the member cap, burn-in ends at the last receipt-free sighting, and a firmware name matching several entries is a mismatch.

@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.

All three findings are fixed with tests, and the one new behavior (a mismatched BMC identity is refused instead of getting a Failed verdict) is consistent with #195. I compared the PR's own commits (cc047e3, 38e85c8, 54d9276); the old head is gone after the rebase.

  • Agree with kevwilliams on the 64 cap, fixed: allMembers follows Members@odata.nextLink and returns ErrTooManyMembers at 1,024 members or 64 pages instead of truncating, and the disk paths fail at the bound too. TestHardwareFailsACollectionAtTheBound and TestHardwareReadsEveryMemoryModule pin it.
  • Agree with kevwilliams on the burn-in end, fixed: the end is now the last time any worker saw no receipt, stored through PutRecord at most every 30s and at the moment the receipt first appears. A restart can only shorten the recorded burn-in, never lengthen it. With nothing stored the zero time fails the check. TestARestartAfterAnEarlyReceiptStillFailsTooShort is the test I asked for.
  • Agree with kevwilliams on checkFirmware, fixed: it matches by Id first, falls back to Name only when exactly one entry has it, and reports a mismatch for a Name two entries share. TestFirmwareMatchesByIdAndRefusesAnAmbiguousName covers it.
  • Per-GET timeout, fixed: the comment now says each GET is bounded by the client's per-request timeout and the whole read by the operation deadline, and TestHardwareBoundsEachRequest stalls a read to prove it.
  • New code checked: preflight refuses a BMC reporting another serial or UUID before anything is sent, so no verdict names a server nobody admitted. The 30s persistence interval also means a worker restarted after the receipt could record a burn-in up to 30s short of the plan and fail a legitimately long run. That fails closed and a retry fixes it.

Follow-ups:

  • A burn-in failed only because of a restart looks the same as a real too-short one; consider a distinct message.
  • This PR is based on feat/device-commissioning-kind, so it merges only after #195 does.

Base automatically changed from feat/device-commissioning-kind to feat/manual-inventory-records November 28, 2026 19:12
@scotwells
scotwells merged commit 67d9ccc into feat/manual-inventory-records Nov 28, 2026
15 checks passed
@scotwells
scotwells deleted the feat/device-commissioning-redfish branch November 28, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants