From ff3de4b4d4fcc0137e626e2d53b9e59e513db69b Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:29:11 -0600 Subject: [PATCH 1/4] docs: Propose commissioning and sellable registered capacity Add DeviceCommissioning with approved, pinned plans, wire capacity status to evidence, and resolve the registration stage-2 blockers so registered capacity can be enabled. Co-Authored-By: Claude Opus 5.5 --- docs/README.md | 1 + .../device-commissioning/README.md | 525 ++++++++++++++++++ .../diagrams/sellable-path.svg | 34 ++ 3 files changed, 560 insertions(+) create mode 100644 docs/enhancements/device-commissioning/README.md create mode 100644 docs/enhancements/device-commissioning/diagrams/sellable-path.svg diff --git a/docs/README.md b/docs/README.md index bf31f1c5..4612167b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -73,6 +73,7 @@ Each topic folder has a `README.md` entry point: | [Development](development/README.md) | Implementation status, local commands, and roadmap | | [Enhancements](enhancements/machine-lifecycle/README.md) | Focused machine lifecycle contracts and acceptance requirements | | [Device operations](enhancements/device-operations/README.md) | Proposed custody and operations for every physical action on a server | +| [Device commissioning](enhancements/device-commissioning/README.md) | Proposed commissioning, capacity status, and enabling registered capacity | | [Proposals](proposals/fleet-management/README.md) | Broader service proposals, examples, diagrams, and provenance | ## Read implementation and design separately diff --git a/docs/enhancements/device-commissioning/README.md b/docs/enhancements/device-commissioning/README.md new file mode 100644 index 00000000..70bf3ee4 --- /dev/null +++ b/docs/enhancements/device-commissioning/README.md @@ -0,0 +1,525 @@ +--- +status: provisional +stage: alpha +--- + +# Device commissioning and sellable capacity + +[Documentation overview](../../README.md) ยท [Device operations](../device-operations/README.md) + +- [Summary](#summary) +- [Motivation](#motivation) +- [Proposal](#proposal) +- [Design details](#design-details) + - [Commissioning plans](#commissioning-plans) + - [DeviceCommissioning](#devicecommissioning) + - [Capacity status](#capacity-status) + - [Enabling registered capacity](#enabling-registered-capacity) + - [Duplicate identity](#duplicate-identity) + - [Removing orphaned capacity](#removing-orphaned-capacity) + - [Authenticating the registration webhook's caller](#authenticating-the-registration-webhooks-caller) + - [Write order and crash recovery](#write-order-and-crash-recovery) + - [Acceptance tests](#acceptance-tests) +- [Decisions for a person](#decisions-for-a-person) +- [Production readiness review questionnaire](#production-readiness-review-questionnaire) +- [Implementation history](#implementation-history) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure needed](#infrastructure-needed) + +## Summary + +A registered server stays `Disabled` today, and nothing can make it +allocatable. This enhancement adds the path from a registered server to +capacity a customer can be given: + +1. Staff commission the server with a `DeviceCommissioning` operation. It runs + an approved, pinned plan: inspection, a firmware baseline check, and + burn-in. +2. The capacity projector derives `Prepared`, `Healthy` and `Available` from + commissioning, discovery and custody evidence. It is the only writer of + those conditions. +3. Staff enable the capacity, naming a cleaning policy and a capacity pool. + +This enhancement is a proposal. Nothing in it is implemented. + +## Motivation + +The [device operations](../device-operations/README.md) design requires a +succeeded commissioning under the current plan before capacity is `Prepared`. +No commissioning kind exists, so no real server can become `Prepared`. +Registration keeps registered capacity `Disabled` until three gaps close: a +duplicate identity race, capacity orphaned by a deleted Device, and an +unauthenticated webhook caller. Test fixtures write capacity conditions +directly, so those conditions prove nothing. + +### Goals + +- Staff commission a server through custody, like every other physical action. +- A plan is qualified only after a second person approves its exact content. +- Capacity conditions come only from evidence. Editing status cannot make a + server allocatable. +- Registered capacity can move from `Disabled` to `Enabled` under checks that + hold for real hardware. +- The same rules apply in every mode, including test modes. + +### Non-goals + +- Updating firmware. Commissioning checks firmware and refuses a server that + does not meet the baseline. Updating firmware is a separate operation. +- Cleaning policy content and how a cleaning policy is resolved. Another + workstream owns the cleaning policy kind. +- Burn-in test content. The plan pins a burn-in image; what it tests is + operator policy. +- Rack, cabling and network checks. + +## Proposal + +![A registered server becomes allocatable](diagrams/sellable-path.svg) + +1. Staff register a Device. Its capacity is created `Disabled`, as today. +2. A plan author writes a commissioning plan. A different person approves it. +3. A commissioning operator creates a `DeviceCommissioning` for the Device + with a copy of the approved plan. Custody admits it from holder `None` + and sets holder `Service`. +4. The site worker inspects the server, checks firmware, runs burn-in, and + returns evidence. Custody returns to `None`. +5. The capacity projector sets `Prepared` and `Healthy`, and records the + inspected hardware on the capacity. +6. A capacity operator enables the capacity with a cleaning policy and a pool + label. The projector sets `Available`, and the pool's MachineClass can + allocate it. + +### User stories + +- A staff member commissions a new server, enables it, and a customer gets it. +- A hardware team qualifies a new plan for a server model. Servers of that + model stop being `Prepared` until they are commissioned under it. +- Burn-in finds a faulty memory module. The server stays unprepared. +- A Device is deleted while its capacity exists. A staff member removes the + capacity. + +### Relationship to other proposals + +- **[Device operations](../device-operations/README.md):** adds the + `DeviceCommissioning` row of the operations table and settles its open + decision on what makes a commissioning plan qualified. It refines + [capacity status](../device-operations/README.md#capacity-status) without + relaxing it. +- **Inventory-backed capacity registration:** this is registration stage 2. + It resolves the three stage-2 blockers and decides who sets the pool label. +- **Cleaning policy:** this enhancement consumes a cleaning policy by name and + digest only. See [Enabling registered + capacity](#enabling-registered-capacity). + +## Design details + +All new kinds are in `fleet.datumapis.com` and live in the provider project. +Names are provisional. Examples use synthetic data. + +### Commissioning plans + +A `DeviceCommissioningPlan` says what commissioning must prove for a set of +Devices. Its spec is immutable. To change a plan, write a new one. + +```yaml +apiVersion: fleet.datumapis.com/v1alpha1 +kind: DeviceCommissioningPlan +metadata: + name: example-2u-v3 + namespace: default +spec: + creator: {username: plan-author@example.com, uid: 3c1e0b6a-0000-4000-8000-000000000001} + deviceSelector: + matchLabels: {fleet.datumapis.com/hardware-model: example-2u} + supersedes: [example-2u-v2] + inspection: + cpu: {architecture: amd64, cores: 32} + memory: {capacity: 256Gi} + disks: {count: 2, minCapacity: 960Gi} + interfaces: {count: 2} + firmware: + - {component: BMC, version: "5.10.00"} + - {component: BIOS, version: "2.19.1"} + burnIn: + image: {name: burn-in, digest: "sha256:4be1c1a5d0e7..."} + duration: 4h + evidenceLifetime: 2160h +``` + +| Field | Meaning | +| --- | --- | +| `deviceSelector` | The Devices the plan applies to, by Device labels. | +| `supersedes` | Plans that stop being current once this plan is qualified. | +| `inspection` | The CPU and memory the server must report exactly, and the minimum disks and interfaces. Every reported component must be healthy. | +| `firmware` | The exact version each named firmware component must report. | +| `burnIn` | A burn-in image pinned by digest and how long it runs, from 1 minute to 24 hours. | +| `evidenceLifetime` | How long a commissioning stays current, from 1 hour to 365 days. | + +The creator must be the authenticated caller, as for operations. + +#### Qualification + +A plan is **qualified** when a `DeviceCommissioningPlanApproval` with the +plan's name exists and all of these hold: + +- The approval names the plan's UID and the digest of its spec. +- The approval's creator is not the plan's creator. +- The approval's creator held the commissioning plan approver role when the + approval was created. IAM checks this on create. + +```yaml +apiVersion: fleet.datumapis.com/v1alpha1 +kind: DeviceCommissioningPlanApproval +metadata: + name: example-2u-v3 # the plan's name, so a plan has at most one approval + namespace: default +spec: + creator: {username: approver@example.com, uid: 3c1e0b6a-0000-4000-8000-000000000002} + planRef: {name: example-2u-v3, uid: 9a7d..., digest: "sha256:77ce..."} +``` + +An approval is immutable. Deleting it revokes qualification. A plan deleted +and created again has a new UID, so an old approval cannot qualify it. + +#### The current plan + +A Device's **current plan** is the one qualified plan whose selector matches +the Device's labels and that no qualified plan supersedes. If none matches, +the Device has no current plan. If more than one matches, the Device has no +current plan, and its capacity reports `PlanAmbiguous`. + +Qualifying a plan that supersedes another changes the current plan of every +Device it matches at once. Those Devices stop being `Prepared` until they are +commissioned under the new plan. + +### DeviceCommissioning + +| Creator | Authority | Required holder | Inputs | +| --- | --- | --- | --- | +| Staff commissioning operator | `serviceRequest` | `None`, or `Service` under a commissioning hold | The plan's name, UID and digest, and a copy of its spec | + +```yaml +apiVersion: fleet.datumapis.com/v1alpha1 +kind: DeviceCommissioning +metadata: + generateName: server-example-001-commission- + namespace: default +spec: + creator: {username: operator@example.com, uid: 3c1e0b6a-0000-4000-8000-000000000003} + deviceRef: {name: server-example-001, uid: 6f1c0b52-1d7e-4a35-9e0b-2c41f7a0d9e3} + authority: + serviceRequest: {reason: New server intake} + plan: + name: example-2u-v3 + uid: 9a7d... + digest: "sha256:77ce..." + spec: {} # an exact copy of the plan's spec +``` + +The operation carries a copy of the plan, so the site runs exactly the plan +that admission checked, and the record keeps it after the plan is deleted. + +#### Admission + +The shared admission rules apply. The kind adds these checks: + +| Reason | Refused when | +| --- | --- | +| `PlanNotQualified` | The named plan does not exist, has another UID, or is not qualified. | +| `PlanNotCurrent` | The plan is not the Device's current plan. | +| `PlanMismatch` | The copied spec's digest is not the named digest, or not the plan's digest. | +| `DeviceNotActive` | The Device's inventory lifecycle is not `Active`. | + +Like every staff operation, a commissioning never queues. Its deadline is the +plan's burn-in duration plus one hour for inspection and boots. The +coordinator sets it at admission. + +#### Site execution + +The worker uses the Redfish path and the site framework from device +operations: the fence, journal, per-Device credential, pinned TLS key and +identity checks. It runs three phases in order: + +1. **Inspect.** Read the system's identity, processors, memory, storage and + network interfaces. The serial number and system UUID must equal the + Device's, and the hardware must meet the plan. Nothing is sent to the + server. +2. **Check firmware.** Read the firmware inventory. Each named component must + report the plan's version. Nothing is sent to the server. +3. **Burn in.** Power the server off, arm a one-time network boot, and power + it on once. The boot server serves the plan's burn-in image only while + the operation's boot admission is open and at the Device's stored fence. + The image runs for the plan's duration and reports one console receipt + with its result. The worker then waits for the server to power off and + reads its health again. + +A mismatch in phase 1 or 2 ends the operation `Failed` with +`InspectionMismatch` or `FirmwareBaselineNotMet`, and nothing was sent. A +burn-in that reports failure ends `Failed` with `BurnInFailed`. That outcome +is proven: the server ran the image, reported, and powered off. So it sets no +recovery hold, and the server is left off. Any outcome the worker cannot +prove, such as a missing receipt at the deadline, ends `OutcomeUnknown`. + +#### Evidence + +A succeeded commissioning records, within 16 KiB: + +- the serial number and system UUID the BMC reported, and the BMC key digest; +- the inspected CPU, memory, disks and interfaces, in the shape of + MachineCapacity hardware; +- each firmware component and its version; +- the burn-in receipt, start and end times, and result; and +- the plan's name, UID and digest. + +Evidence carries no credential and no raw BMC response. + +#### Holds and retention + +A commissioning that ends `OutcomeUnknown` sets a commissioning hold. A later +`DeviceCommissioning` that succeeds settles it, as the device operations +settlement table says. No `Retry` is needed, because staff create the +settling operation directly. + +Fleet keeps each Device's latest succeeded commissioning past the 30-day +retention of finished operations, until a later commissioning succeeds. It is +the evidence `Prepared` and `Healthy` read. + +### Capacity status + +The capacity projector writes `Prepared`, `Healthy`, `Available` and the +hardware of every MachineCapacity. It reads the capacity, its Device, custody, +the Device's latest succeeded commissioning, current plans, the cleaning +policy reference, and every Device in the provider scope. + +| Condition | True when | +| --- | --- | +| `Prepared` | The Device's latest succeeded commissioning used its current plan. | +| `Healthy` | `Prepared`, the commissioning ended within the plan's evidence lifetime, discovery is current, and discovery reports the serial number, system UUID and BMC key digest the commissioning recorded. | +| `Available` | `Healthy`, custody is `Verified` with holder `None`, no active operation and no recovery hold, the allocation policy is `Enabled`, the Device is `Active`, the cleaning policy resolves, and no other Device shares an identity alias. | + +Discovery is current when it matched the Device's identity for its current +generation, read its inventory within twice the discovery interval, and +recorded the BMC key at its current endpoint. Each false condition names the +first check that failed, such as `NotCommissioned`, `PlanChanged`, +`NoCurrentPlan`, `PlanAmbiguous`, `EvidenceExpired`, `DiscoveryNotCurrent`, +`IdentityChanged`, `Held`, `AllocationDisabled`, `CleaningPolicyUnresolved` +or `IdentityConflict`. + +The capacity's hardware is the hardware the latest succeeded commissioning +inspected. Nobody else writes it. + +Editing status cannot make a server allocatable, for two reasons: + +- The allocator evaluates the same projection from live inputs when it + selects capacity. It does not read the conditions. Custody still decides + with a conditional update. +- The registration webhook admits a status write to registered capacity only + from the projector's identity. + +Every mode uses the projector. Test modes commission through their simulated +sites instead of writing conditions. + +### Enabling registered capacity + +The registration webhook keeps registered capacity immutable except for three +fields: the allocation policy, the cleaning policy reference, and the +`fleet.datumapis.com/capacity-pool` label. + +- **While the capacity is `Disabled`**, a capacity operator may change all + three. +- **While it is `Enabled`**, the only permitted change is to `Disabled`. +- **Enabling** requires, at the time of the update: + - the caller may update the capacity; + - the annotated Device exists with the annotated UID and is `Active`; + - no other Device in the provider scope shares an identity alias; + - the cleaning policy reference is set and resolves to a digest; and + - the pool label is set. + +Enabling does not require commissioning. A capacity enabled before +commissioning is not `Available` until it is `Prepared` and `Healthy`. + +**The pool label.** The capacity operator sets the pool label, at registration +or while the capacity is `Disabled`. A MachineClass selects capacity by that +label. Freezing it while the capacity is `Enabled` keeps a class from losing +or gaining capacity without the capacity being disabled first. + +**The cleaning policy.** Fleet consumes a cleaning policy through two values +that the [device operations](../device-operations/README.md) design already +names: the policy's name, on the capacity, and its digest, pinned on each +MachineAllocation. The cleaning policy owner provides one contract: given a +name in the provider project, return the policy's current digest, or report +that it does not resolve. Fleet asks for that digest when a capacity is +enabled, when the projector evaluates `Available`, and when the allocator +pins it. Until the owner provides the contract, no name resolves, and no +registered capacity can be enabled. + +### Duplicate identity + +Registration rejects a Device that shares an identity alias with another +Device: the serial number, the system UUID, or the provider host tuple. The +stage-1 design leaves open that Device B can be created with Device A's serial +after A was checked. The question is whether A can then be offered while its +identity is ambiguous. Three rules answer it: + +1. **One capacity per alias.** Registration lists Devices with quorum reads. + A's registration happens after A exists. B's registration happens after B + exists. At least one of the two lists sees both Devices, so at least one + registration is denied. Two capacities never share an alias. +2. **The BMC proves the identity.** Commissioning reads the serial number and + system UUID from the BMC and fails if they differ from A's. Admission + already refuses a BMC key that another Device records. A capacity is + `Prepared` only if the server behind A's BMC is A. +3. **Every offer checks again.** `Available` and the allocator both require + that no other Device shares an alias, at each evaluation. Once B appears, + A is not offered until a person resolves the conflict. + +Rule 3 does not end an allocation that already holds A. That server's +identity is still proven by its BMC, and B can never get capacity. No object +can make a Device create and another Device's registration atomic, so Fleet +checks at the point where it acts. + +### Removing orphaned capacity + +The registration webhook admits the delete of registered capacity when all of +these hold: + +- the capacity is `Disabled`; +- its annotated Device is missing, has a different UID, or is `Retired`; +- no MachineAllocation that has not been released names the capacity; and +- the caller may delete the capacity. + +The webhook reads the Device and allocations with quorum reads. Removing the +capacity removes nothing else. If the Device was deleted, its identity has +already left the duplicate check. + +### Authenticating the registration webhook's caller + +Today any holder of a certificate from the webhook's client CA can send the +webhook a review and read the verdict. The webhook will also require that the +client certificate's subject be one of the configured API server webhook +client identities. It rejects any other certificate during the TLS handshake, +before reading a request. The environment configures those identities and +issues them only to the API servers that call the webhook. + +### Write order and crash recovery + +| Change | Order | After a crash between the writes | +| --- | --- | --- | +| Qualify a plan | Plan, then approval | The plan stays unqualified until the approval exists. | +| Revoke a plan | Delete the approval | One write. Devices stop being `Prepared` when the projector next runs. | +| Commission a server | Custody, then operation status | As for every operation. | +| Project capacity | Read every input, then one status update | The projector derives the status again from the same inputs. | +| Enable or disable capacity | One capacity update | One write. | +| Remove orphaned capacity | One delete with UID and resourceVersion preconditions | One write. | + +### Acceptance tests + +- A registered server is commissioned over Redfish in the lab, becomes + `Prepared`, `Healthy` and `Available` after it is enabled, and is allocated. +- A plan approved by its own author does not qualify, and admission refuses a + commissioning under it. +- A commissioning whose copied plan differs from the approved plan is refused, + and nothing is sent. +- An inspection or firmware mismatch ends `Failed`, and the lab BMC audit + shows no effectful request. +- A burn-in failure ends `Failed`, sets no hold, and leaves the server off. +- A commissioning passes its deadline and ends `OutcomeUnknown`, and a later + commissioning settles the hold. +- A superseding plan is qualified, and every matching capacity stops being + `Prepared`. +- A status edit sets `Available` on unprepared capacity, and the allocator + still refuses it. +- A status write to registered capacity by any identity but the projector is + denied. +- Enabling is denied without a resolving cleaning policy, without a pool + label, with a duplicate Device, or with a Device that is not `Active`. +- An enabled capacity's pool label cannot change until it is disabled. +- A duplicate Device appears after a capacity is enabled, and the capacity + stops being `Available`. +- Capacity whose Device was deleted is removed, and capacity with an + unreleased allocation is not. +- A certificate from the client CA with an unlisted subject is rejected + during the handshake. + +## Decisions for a person + +- **Who approves commissioning plans.** This design requires a second person + with the approver role. A person must decide which team holds that role + and confirm the two-person rule. +- **Firmware is checked, not updated.** A server below the baseline fails + commissioning. A person must confirm that firmware updates stay out of + scope. +- **Plan content per hardware model.** The burn-in image, its duration, and + the evidence lifetime are operator policy. Fleet sets no defaults. +- **A new plan unprepares a whole model.** Qualifying a superseding plan + makes every matching free server unallocatable until it is commissioned + again. +- **The cleaning policy contract.** The cleaning policy owner must provide + name-to-digest resolution. Until then no registered capacity can be + enabled. +- **The webhook client identities.** Each environment names the API server + identities and keeps their issuer dedicated to them. + +## Production readiness review questionnaire + +These controls are proposed, not implemented. + +### How do operators enable or disable the feature? + +Register the kinds, roles and webhook rules, then run the projector with the +coordinator. To stop new commissioning, revoke plan approvals. To stop new +allocations, disable capacity. + +### Does enabling the feature change any default behavior? + +Yes. Capacity conditions come from the projector. Capacity that a fixture +marked `Available` stops being `Available` until it is commissioned. + +### What must operators monitor? + +Commissioning failures by reason, commissioning holds, capacity reporting +`PlanAmbiguous` or `IdentityConflict`, expiring evidence, and webhook TLS +rejections. + +### What does the feature depend on? + +Device custody and site execution, BMC discovery, the boot server, and the +cleaning policy owner's resolution contract. + +### Does the feature add API types or calls? + +It adds `DeviceCommissioningPlan`, `DeviceCommissioningPlanApproval` and +`DeviceCommissioning`. The projector makes one status write per capacity when +an input changes. + +## Implementation history + +- 2026-11-25: Proposed. + +## Drawbacks + +- Commissioning reboots the server and holds it for the burn-in duration. +- Every free server of a model needs commissioning again after a plan change. +- Enabling registered capacity waits on the cleaning policy contract. + +## Alternatives + +- **A plan reference on each capacity:** Capacity is a Metal object, and plans + are Fleet's. Selecting by Device labels keeps plans with the hardware. +- **Approval as a field on the plan:** The plan author and the approver would + write one object. A separate approval keeps one writer per object. +- **A plan reference instead of a copy in the operation:** The site would need + to read the provider project, and the record would lose the plan when it is + deleted. +- **An identity claim object per alias:** A claim cannot make another + Device's create fail, so it leaves the same window as rule 3 and adds a + kind. +- **Updating firmware during commissioning:** A failed update can leave the + server unbootable, which needs its own recovery design. + +## Infrastructure needed + +The Redfish lab needs a firmware inventory on the lab BMC and a burn-in mode +in the lab boot image. Hardware qualification needs a burn-in image for each +model. diff --git a/docs/enhancements/device-commissioning/diagrams/sellable-path.svg b/docs/enhancements/device-commissioning/diagrams/sellable-path.svg new file mode 100644 index 00000000..c8f07479 --- /dev/null +++ b/docs/enhancements/device-commissioning/diagrams/sellable-path.svg @@ -0,0 +1,34 @@ + +A registered server becomes allocatableA registered server starts with Disabled capacity. Staff commission it under an approved plan. When commissioning succeeds, the projector derives Prepared and Healthy. A capacity operator enables the capacity with a cleaning policy and a pool label. The projector derives Available while custody is free, and the allocator claims custody to allocate it. + + + + +Registered +Capacity Disabled + +Commissioned +Plan ran, evidence kept + +Prepared, Healthy +Projector derives + +Enabled +Cleaning policy, pool + +Available +Custody free + +Allocated +Custody claimed + +Commission + +Succeeds + +Capacity operator enables + +Derives + +Claims + From 78fa827bf3c51b215d19dd8c01c33b8a3c53685f Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:35:15 -0600 Subject: [PATCH 2/4] docs: Prove commissioning verdicts and narrow duplicate claims Record a proven failing server as a succeeded commissioning with a failed result, so a failed re-commission unprepares the server. Scope plan supersession to the Devices a plan selects, state the residual duplicate window and why it is harmless, route capacity status writes through the webhook, and declare the retention and deadline changes to custody. Co-Authored-By: Claude Opus 5.5 --- .../device-commissioning/README.md | 432 ++++++++++-------- 1 file changed, 235 insertions(+), 197 deletions(-) diff --git a/docs/enhancements/device-commissioning/README.md b/docs/enhancements/device-commissioning/README.md index 70bf3ee4..add131bd 100644 --- a/docs/enhancements/device-commissioning/README.md +++ b/docs/enhancements/device-commissioning/README.md @@ -17,7 +17,8 @@ stage: alpha - [Enabling registered capacity](#enabling-registered-capacity) - [Duplicate identity](#duplicate-identity) - [Removing orphaned capacity](#removing-orphaned-capacity) - - [Authenticating the registration webhook's caller](#authenticating-the-registration-webhooks-caller) + - [Who may call the registration webhook](#who-may-call-the-registration-webhook) + - [Changes to device operations](#changes-to-device-operations) - [Write order and crash recovery](#write-order-and-crash-recovery) - [Acceptance tests](#acceptance-tests) - [Decisions for a person](#decisions-for-a-person) @@ -30,24 +31,17 @@ stage: alpha ## Summary A registered server stays `Disabled` today, and nothing can make it -allocatable. This enhancement adds the path from a registered server to -capacity a customer can be given: - -1. Staff commission the server with a `DeviceCommissioning` operation. It runs - an approved, pinned plan: inspection, a firmware baseline check, and - burn-in. -2. The capacity projector derives `Prepared`, `Healthy` and `Available` from - commissioning, discovery and custody evidence. It is the only writer of - those conditions. -3. Staff enable the capacity, naming a cleaning policy and a capacity pool. +allocatable. This enhancement adds the missing path. Staff commission the +server under an approved plan, Fleet derives capacity status only from +evidence, and staff enable the capacity with a cleaning policy and a pool. This enhancement is a proposal. Nothing in it is implemented. ## Motivation The [device operations](../device-operations/README.md) design requires a -succeeded commissioning under the current plan before capacity is `Prepared`. -No commissioning kind exists, so no real server can become `Prepared`. +passed commissioning under the current plan before capacity is `Prepared`. No +commissioning kind exists, so no real server can become `Prepared`. Registration keeps registered capacity `Disabled` until three gaps close: a duplicate identity race, capacity orphaned by a deleted Device, and an unauthenticated webhook caller. Test fixtures write capacity conditions @@ -65,8 +59,10 @@ directly, so those conditions prove nothing. ### Non-goals -- Updating firmware. Commissioning checks firmware and refuses a server that - does not meet the baseline. Updating firmware is a separate operation. +- Updating firmware. Commissioning checks firmware and fails a server below + the baseline. +- Inspecting GPUs. A profile that requires GPUs matches no commissioned + capacity until inspection covers them. - Cleaning policy content and how a cleaning policy is resolved. Another workstream owns the cleaning policy kind. - Burn-in test content. The plan pins a burn-in image; what it tests is @@ -83,8 +79,8 @@ directly, so those conditions prove nothing. with a copy of the approved plan. Custody admits it from holder `None` and sets holder `Service`. 4. The site worker inspects the server, checks firmware, runs burn-in, and - returns evidence. Custody returns to `None`. -5. The capacity projector sets `Prepared` and `Healthy`, and records the + returns a verdict with evidence. Custody returns to `None`. +5. The capacity projector sets `Prepared` and `Healthy` and records the inspected hardware on the capacity. 6. A capacity operator enables the capacity with a cleaning policy and a pool label. The projector sets `Available`, and the pool's MachineClass can @@ -93,24 +89,23 @@ directly, so those conditions prove nothing. ### User stories - A staff member commissions a new server, enables it, and a customer gets it. -- A hardware team qualifies a new plan for a server model. Servers of that - model stop being `Prepared` until they are commissioned under it. -- Burn-in finds a faulty memory module. The server stays unprepared. +- A hardware team qualifies a new plan for a server model, and servers of + that model are commissioned again under it. +- Burn-in finds a faulty memory module. The server stops being offered. - A Device is deleted while its capacity exists. A staff member removes the capacity. ### Relationship to other proposals - **[Device operations](../device-operations/README.md):** adds the - `DeviceCommissioning` row of the operations table and settles its open - decision on what makes a commissioning plan qualified. It refines - [capacity status](../device-operations/README.md#capacity-status) without - relaxing it. -- **Inventory-backed capacity registration:** this is registration stage 2. - It resolves the three stage-2 blockers and decides who sets the pool label. -- **Cleaning policy:** this enhancement consumes a cleaning policy by name and - digest only. See [Enabling registered - capacity](#enabling-registered-capacity). + `DeviceCommissioning` row of the operations table, settles the open decision + on what makes a commissioning plan qualified, and makes three small + [changes](#changes-to-device-operations). +- **Inventory-backed capacity registration:** this is registration stage 2. It + replaces each stage-2 blocker with the rule below, and decides who sets the + pool label. +- **Cleaning policy:** this enhancement uses a cleaning policy only by name + and digest. See [The cleaning policy](#the-cleaning-policy). ## Design details @@ -129,32 +124,33 @@ metadata: name: example-2u-v3 namespace: default spec: - creator: {username: plan-author@example.com, uid: 3c1e0b6a-0000-4000-8000-000000000001} + creator: {username: plan-author@example.com, uid: 00000000-0000-4000-8000-000000000001} deviceSelector: matchLabels: {fleet.datumapis.com/hardware-model: example-2u} supersedes: [example-2u-v2] - inspection: - cpu: {architecture: amd64, cores: 32} - memory: {capacity: 256Gi} - disks: {count: 2, minCapacity: 960Gi} - interfaces: {count: 2} - firmware: - - {component: BMC, version: "5.10.00"} - - {component: BIOS, version: "2.19.1"} - burnIn: - image: {name: burn-in, digest: "sha256:4be1c1a5d0e7..."} - duration: 4h + content: + inspection: + cpu: {architecture: amd64, cores: 32} + memory: {capacity: 256Gi} + disks: {count: 2, minCapacity: 960Gi} + interfaces: {count: 2} + firmware: + - {component: BMC, version: "5.10.00"} + - {component: BIOS, version: "2.19.1"} + burnIn: + image: {name: burn-in, digest: "sha256:1111111111111111111111111111111111111111111111111111111111111111"} + duration: 4h evidenceLifetime: 2160h ``` | Field | Meaning | | --- | --- | -| `deviceSelector` | The Devices the plan applies to, by Device labels. | -| `supersedes` | Plans that stop being current once this plan is qualified. | -| `inspection` | The CPU and memory the server must report exactly, and the minimum disks and interfaces. Every reported component must be healthy. | -| `firmware` | The exact version each named firmware component must report. | -| `burnIn` | A burn-in image pinned by digest and how long it runs, from 1 minute to 24 hours. | -| `evidenceLifetime` | How long a commissioning stays current, from 1 hour to 365 days. | +| `deviceSelector` | The Devices the plan applies to, by Device labels. It must not be empty. Inventory editors set Device labels. | +| `supersedes` | Plans this plan replaces for the Devices it selects. | +| `content.inspection` | The CPU and memory the server must report exactly, and the minimum disks and interfaces. Every reported component must be healthy. | +| `content.firmware` | The exact version each named firmware component must report. | +| `content.burnIn` | A burn-in image pinned by digest and how long it runs, from 1 minute to 24 hours. | +| `evidenceLifetime` | How long a passed commissioning stays current, from 1 hour to 365 days. | The creator must be the authenticated caller, as for operations. @@ -175,8 +171,11 @@ metadata: name: example-2u-v3 # the plan's name, so a plan has at most one approval namespace: default spec: - creator: {username: approver@example.com, uid: 3c1e0b6a-0000-4000-8000-000000000002} - planRef: {name: example-2u-v3, uid: 9a7d..., digest: "sha256:77ce..."} + creator: {username: approver@example.com, uid: 00000000-0000-4000-8000-000000000002} + planRef: + name: example-2u-v3 + uid: 00000000-0000-4000-8000-000000000003 + digest: "sha256:2222222222222222222222222222222222222222222222222222222222222222" ``` An approval is immutable. Deleting it revokes qualification. A plan deleted @@ -184,20 +183,27 @@ and created again has a new UID, so an old approval cannot qualify it. #### The current plan -A Device's **current plan** is the one qualified plan whose selector matches -the Device's labels and that no qualified plan supersedes. If none matches, -the Device has no current plan. If more than one matches, the Device has no -current plan, and its capacity reports `PlanAmbiguous`. +A plan is a Device's **current plan** when it is qualified, its selector +matches the Device, and no other qualified plan that matches the Device +supersedes it. A supersession therefore applies only to the Devices the +superseding plan selects. + +- With no current plan, the capacity reports `NoCurrentPlan`. +- With more than one, including plans that supersede each other, the capacity + reports `PlanAmbiguous`. +- Revoking a superseding plan's approval makes the plan it replaced current + again. A passed commissioning under that plan counts again while it is + within its evidence lifetime. This is the rollback path. -Qualifying a plan that supersedes another changes the current plan of every -Device it matches at once. Those Devices stop being `Prepared` until they are -commissioned under the new plan. +When a superseding plan is qualified, every Device it selects stops being +`Prepared` until it is commissioned under the new plan. A server that a +customer holds is not affected until it is released. ### DeviceCommissioning | Creator | Authority | Required holder | Inputs | | --- | --- | --- | --- | -| Staff commissioning operator | `serviceRequest` | `None`, or `Service` under a commissioning hold | The plan's name, UID and digest, and a copy of its spec | +| Staff commissioning operator | `serviceRequest` | `None`, or `Service` under a commissioning hold | The plan's name, UID and digest, and a copy of its content | ```yaml apiVersion: fleet.datumapis.com/v1alpha1 @@ -206,15 +212,15 @@ metadata: generateName: server-example-001-commission- namespace: default spec: - creator: {username: operator@example.com, uid: 3c1e0b6a-0000-4000-8000-000000000003} - deviceRef: {name: server-example-001, uid: 6f1c0b52-1d7e-4a35-9e0b-2c41f7a0d9e3} + creator: {username: operator@example.com, uid: 00000000-0000-4000-8000-000000000004} + deviceRef: {name: server-example-001, uid: 00000000-0000-4000-8000-000000000005} authority: serviceRequest: {reason: New server intake} plan: name: example-2u-v3 - uid: 9a7d... - digest: "sha256:77ce..." - spec: {} # an exact copy of the plan's spec + uid: 00000000-0000-4000-8000-000000000003 + digest: "sha256:2222222222222222222222222222222222222222222222222222222222222222" + content: {} # an exact copy of the plan's content ``` The operation carries a copy of the plan, so the site runs exactly the plan @@ -228,18 +234,15 @@ The shared admission rules apply. The kind adds these checks: | --- | --- | | `PlanNotQualified` | The named plan does not exist, has another UID, or is not qualified. | | `PlanNotCurrent` | The plan is not the Device's current plan. | -| `PlanMismatch` | The copied spec's digest is not the named digest, or not the plan's digest. | +| `PlanMismatch` | The named digest is not the plan's, or the copied content differs from the plan's. | | `DeviceNotActive` | The Device's inventory lifecycle is not `Active`. | -Like every staff operation, a commissioning never queues. Its deadline is the -plan's burn-in duration plus one hour for inspection and boots. The -coordinator sets it at admission. +Like every staff operation, a commissioning never queues. #### Site execution The worker uses the Redfish path and the site framework from device -operations: the fence, journal, per-Device credential, pinned TLS key and -identity checks. It runs three phases in order: +operations. It runs three phases in order and stops at the first that fails: 1. **Inspect.** Read the system's identity, processors, memory, storage and network interfaces. The serial number and system UUID must equal the @@ -248,74 +251,84 @@ identity checks. It runs three phases in order: 2. **Check firmware.** Read the firmware inventory. Each named component must report the plan's version. Nothing is sent to the server. 3. **Burn in.** Power the server off, arm a one-time network boot, and power - it on once. The boot server serves the plan's burn-in image only while - the operation's boot admission is open and at the Device's stored fence. - The image runs for the plan's duration and reports one console receipt - with its result. The worker then waits for the server to power off and - reads its health again. - -A mismatch in phase 1 or 2 ends the operation `Failed` with -`InspectionMismatch` or `FirmwareBaselineNotMet`, and nothing was sent. A -burn-in that reports failure ends `Failed` with `BurnInFailed`. That outcome -is proven: the server ran the image, reported, and powered off. So it sets no -recovery hold, and the server is left off. Any outcome the worker cannot -prove, such as a missing receipt at the deadline, ends `OutcomeUnknown`. + it on once. The boot server serves the plan's burn-in image only while the + operation's boot admission is open. The image runs for the plan's duration + and reports one result on the console. The worker waits for the server to + power off and reads its health again. + +A commissioning's success test is a proven verdict, not a passing server. When +the worker proves the verdict, the operation ends `Succeeded`, and its +evidence records the result: `Passed`, or `Failed` with the phase that failed +and what it found. A failing server is a proven outcome, so it sets no recovery +hold, and burn-in leaves it powered off. + +The operation ends `Failed` only as #174 defines it: admission refused it, or +the worker refused before sending anything, for example because the BMC +cannot boot from the network. It ends `OutcomeUnknown` when the worker cannot +prove the verdict, such as a missing burn-in result at the deadline. #### Evidence -A succeeded commissioning records, within 16 KiB: +A `Succeeded` commissioning records: +- the result, and for a failure, the phase and what failed; - the serial number and system UUID the BMC reported, and the BMC key digest; - the inspected CPU, memory, disks and interfaces, in the shape of MachineCapacity hardware; - each firmware component and its version; -- the burn-in receipt, start and end times, and result; and +- the burn-in result and its start and end times, if burn-in ran; and - the plan's name, UID and digest. Evidence carries no credential and no raw BMC response. -#### Holds and retention +#### Holds A commissioning that ends `OutcomeUnknown` sets a commissioning hold. A later `DeviceCommissioning` that succeeds settles it, as the device operations settlement table says. No `Retry` is needed, because staff create the settling operation directly. -Fleet keeps each Device's latest succeeded commissioning past the 30-day -retention of finished operations, until a later commissioning succeeds. It is -the evidence `Prepared` and `Healthy` read. - ### Capacity status -The capacity projector writes `Prepared`, `Healthy`, `Available` and the -hardware of every MachineCapacity. It reads the capacity, its Device, custody, -the Device's latest succeeded commissioning, current plans, the cleaning -policy reference, and every Device in the provider scope. +The capacity projector writes the `Prepared`, `Healthy` and `Available` +conditions and the hardware of every MachineCapacity. It reads the +capacity, its Device, custody, the Device's latest succeeded commissioning, +the current plans, the resolved cleaning policy digest, and the identities of +every Device in the provider scope. | Condition | True when | | --- | --- | -| `Prepared` | The Device's latest succeeded commissioning used its current plan. | -| `Healthy` | `Prepared`, the commissioning ended within the plan's evidence lifetime, discovery is current, and discovery reports the serial number, system UUID and BMC key digest the commissioning recorded. | -| `Available` | `Healthy`, custody is `Verified` with holder `None`, no active operation and no recovery hold, the allocation policy is `Enabled`, the Device is `Active`, the cleaning policy resolves, and no other Device shares an identity alias. | +| `Prepared` | The Device's latest succeeded commissioning used its current plan, and its result is `Passed`. | +| `Healthy` | `Prepared`, that commissioning ended within the plan's evidence lifetime, discovery is current, and discovery reports the serial number, system UUID and BMC key digest the commissioning recorded. | +| `Available` | `Healthy`, custody is `Verified` with holder `None`, no active operation and no recovery hold, the allocation policy is `Enabled`, the Device is `Active`, the cleaning policy resolves, and the Device has no [duplicate](#duplicate-identity). | Discovery is current when it matched the Device's identity for its current generation, read its inventory within twice the discovery interval, and -recorded the BMC key at its current endpoint. Each false condition names the -first check that failed, such as `NotCommissioned`, `PlanChanged`, -`NoCurrentPlan`, `PlanAmbiguous`, `EvidenceExpired`, `DiscoveryNotCurrent`, -`IdentityChanged`, `Held`, `AllocationDisabled`, `CleaningPolicyUnresolved` -or `IdentityConflict`. - -The capacity's hardware is the hardware the latest succeeded commissioning -inspected. Nobody else writes it. - -Editing status cannot make a server allocatable, for two reasons: - -- The allocator evaluates the same projection from live inputs when it - selects capacity. It does not read the conditions. Custody still decides - with a conditional update. -- The registration webhook admits a status write to registered capacity only - from the projector's identity. +recorded the BMC key at its current endpoint. + +A false condition names the first check that failed, such as +`NotCommissioned`, `CommissioningFailed`, `PlanChanged`, `NoCurrentPlan`, +`PlanAmbiguous`, `EvidenceExpired`, `DiscoveryNotCurrent`, `IdentityChanged`, +`Held`, `AllocationDisabled`, `CleaningPolicyUnresolved` or +`IdentityConflict`. If the cleaning policy owner cannot be reached, +`Available` is `Unknown`, not `False`. + +The capacity's hardware is what the latest passed commissioning inspected. A +failed commissioning clears it. + +**Editing status cannot make a server allocatable.** The allocator evaluates +the same projection from live inputs, for every capacity it considers, and +does not read the conditions. Custody still decides with a conditional +update. Other readers of the conditions, such as the provider portal and +location matching, display them only. + +**Only the projector writes the status of registered capacity.** The +registration webhook now also receives status writes to registered capacity, +and admits them only from the projector's identity. Like its other routes, it +fails closed. If the webhook is down, the projector cannot update status, and +the conditions go stale. Because the allocator does not read them, stale +conditions never make a server allocatable. Status writes to other capacity +are governed by role permissions alone, as today. Every mode uses the projector. Test modes commission through their simulated sites instead of writing conditions. @@ -329,55 +342,68 @@ fields: the allocation policy, the cleaning policy reference, and the - **While the capacity is `Disabled`**, a capacity operator may change all three. - **While it is `Enabled`**, the only permitted change is to `Disabled`. -- **Enabling** requires, at the time of the update: - - the caller may update the capacity; - - the annotated Device exists with the annotated UID and is `Active`; - - no other Device in the provider scope shares an identity alias; - - the cleaning policy reference is set and resolves to a digest; and - - the pool label is set. - -Enabling does not require commissioning. A capacity enabled before -commissioning is not `Available` until it is `Prepared` and `Healthy`. - -**The pool label.** The capacity operator sets the pool label, at registration -or while the capacity is `Disabled`. A MachineClass selects capacity by that -label. Freezing it while the capacity is `Enabled` keeps a class from losing -or gaining capacity without the capacity being disabled first. - -**The cleaning policy.** Fleet consumes a cleaning policy through two values -that the [device operations](../device-operations/README.md) design already -names: the policy's name, on the capacity, and its digest, pinned on each -MachineAllocation. The cleaning policy owner provides one contract: given a -name in the provider project, return the policy's current digest, or report -that it does not resolve. Fleet asks for that digest when a capacity is -enabled, when the projector evaluates `Available`, and when the allocator -pins it. Until the owner provides the contract, no name resolves, and no +- **Enabling** requires, at the time of the update, that the caller may update + the capacity, the annotated Device exists with the annotated UID and is + `Active`, the Device has no duplicate, the cleaning policy resolves, and the + pool label is set. + +Enabling does not require commissioning. Enabled capacity is not `Available` +until it is `Prepared` and `Healthy`. + +The webhook reads Devices, MachineAllocations and the cleaning policy +resolution, and still writes nothing. Each read for a registration decision +reads the current stored state, not a cache. + +#### The pool label + +The capacity operator sets the pool label, at registration or while the +capacity is `Disabled`. A MachineClass selects capacity by that label. +Freezing it while the capacity is `Enabled` keeps a class from gaining or +losing capacity without the capacity being disabled first. + +#### The cleaning policy + +Fleet uses a cleaning policy through two values that the [device +operations](../device-operations/README.md) design already names: the +policy's name, on the capacity, and its digest, pinned on each +MachineAllocation. Fleet needs one contract from the cleaning policy owner: +given a name in the provider project, return the policy's current digest, +report that the name does not resolve, or report that the owner cannot be +reached. + +Fleet resolves the digest when a capacity is enabled, when the allocator pins +it, and before each projection, which takes the result as an input. Test modes +use a fixed resolver. In production, until the owner provides the contract, no registered capacity can be enabled. ### Duplicate identity -Registration rejects a Device that shares an identity alias with another -Device: the serial number, the system UUID, or the provider host tuple. The -stage-1 design leaves open that Device B can be created with Device A's serial -after A was checked. The question is whether A can then be offered while its -identity is ambiguous. Three rules answer it: - -1. **One capacity per alias.** Registration lists Devices with quorum reads. - A's registration happens after A exists. B's registration happens after B - exists. At least one of the two lists sees both Devices, so at least one - registration is denied. Two capacities never share an alias. -2. **The BMC proves the identity.** Commissioning reads the serial number and - system UUID from the BMC and fails if they differ from A's. Admission - already refuses a BMC key that another Device records. A capacity is - `Prepared` only if the server behind A's BMC is A. -3. **Every offer checks again.** `Available` and the allocator both require - that no other Device shares an alias, at each evaluation. Once B appears, - A is not offered until a person resolves the conflict. - -Rule 3 does not end an allocation that already holds A. That server's -identity is still proven by its BMC, and B can never get capacity. No object -can make a Device create and another Device's registration atomic, so Fleet -checks at the point where it acts. +A Device has a **duplicate** when another Device in the provider scope shares +one of its identity aliases: the serial number, the system UUID, or the +provider host tuple. Retired Devices count until they are deleted, as in +registration stage 1. + +Stage 1 cannot stop Device B from being recorded with Device A's serial after +A was registered. No object can make one Device's create and another +Device's registration atomic, and this design does not try. It makes the +duplicate harmless instead: + +- **The BMC proves the serial number and system UUID.** Commissioning reads + both from A's BMC and fails if they differ from A's record. Admission + already refuses a BMC key that another Device records. So a `Prepared` + server is the server A's record describes. +- **Every offer checks again.** `Available` and the allocator require that A + has no duplicate. Once B appears, A is not offered until a person resolves + the conflict. +- **B can never be registered** while A exists, as in stage 1. + +The window that remains is between the allocator's check and its custody +claim. A duplicate recorded in that window does not change which server the +customer gets: A's BMC proved it. The provider host tuple is not proven by +the BMC. For that alias, the recheck is the only protection. + +To resolve a conflict, a person corrects the wrong record's identity, or +moves it to `Decommissioning`, then `Retired`, and deletes it. ### Removing orphaned capacity @@ -389,29 +415,42 @@ these hold: - no MachineAllocation that has not been released names the capacity; and - the caller may delete the capacity. -The webhook reads the Device and allocations with quorum reads. Removing the -capacity removes nothing else. If the Device was deleted, its identity has -already left the duplicate check. +These facts cannot change between the check and the delete. Enabling requires +an `Active` Device with the annotated UID, so the capacity stays `Disabled`. +Allocation requires `Enabled` capacity, so no new allocation can name it. + +### Who may call the registration webhook + +Today any holder of a certificate from the webhook's client certificate +authority can send the webhook a request and read the verdict. The +environment must give the webhook a certificate authority that issues +certificates only to the API servers that call it. As a second check, the +webhook accepts only the API server identities the environment configures, +and refuses any other caller before reading its request. -### Authenticating the registration webhook's caller +### Changes to device operations -Today any holder of a certificate from the webhook's client CA can send the -webhook a review and read the verdict. The webhook will also require that the -client certificate's subject be one of the configured API server webhook -client identities. It rejects any other certificate during the TLS handshake, -before reading a request. The environment configures those identities and -issues them only to the API servers that call the webhook. +This enhancement changes three rules of the [device +operations](../device-operations/README.md) design: + +- **Retention.** Fleet keeps each Device's latest succeeded commissioning past + the 30-day retention of finished operations, until a later one succeeds. + The projector reads it. +- **Deadlines.** A commissioning's deadline is its plan's burn-in duration + plus one hour, set at admission. Other kinds keep a fixed deadline. A + commissioning can hold a server as `Service` for up to 25 hours. +- **Capacity status.** `Available` also requires an `Active` Device, a + resolving cleaning policy, and no duplicate. ### Write order and crash recovery | Change | Order | After a crash between the writes | | --- | --- | --- | | Qualify a plan | Plan, then approval | The plan stays unqualified until the approval exists. | -| Revoke a plan | Delete the approval | One write. Devices stop being `Prepared` when the projector next runs. | | Commission a server | Custody, then operation status | As for every operation. | -| Project capacity | Read every input, then one status update | The projector derives the status again from the same inputs. | -| Enable or disable capacity | One capacity update | One write. | -| Remove orphaned capacity | One delete with UID and resourceVersion preconditions | One write. | +| Project capacity | Read every input, then write status | The projector derives the status again. | + +Every other change in this enhancement is one write. ### Acceptance tests @@ -421,13 +460,16 @@ issues them only to the API servers that call the webhook. commissioning under it. - A commissioning whose copied plan differs from the approved plan is refused, and nothing is sent. -- An inspection or firmware mismatch ends `Failed`, and the lab BMC audit - shows no effectful request. -- A burn-in failure ends `Failed`, sets no hold, and leaves the server off. +- An inspection or firmware mismatch ends with a `Failed` result, and the lab + BMC audit shows no effectful request. +- A burn-in failure ends with a `Failed` result, sets no hold, and leaves the + server off. +- A `Prepared` server is commissioned again and fails, and stops being + `Available`. - A commissioning passes its deadline and ends `OutcomeUnknown`, and a later commissioning settles the hold. -- A superseding plan is qualified, and every matching capacity stops being - `Prepared`. +- A superseding plan is qualified, and only the capacity it selects stops being + `Prepared`. Revoking it restores the old plan. - A status edit sets `Available` on unprepared capacity, and the allocator still refuses it. - A status write to registered capacity by any identity but the projector is @@ -439,27 +481,24 @@ issues them only to the API servers that call the webhook. stops being `Available`. - Capacity whose Device was deleted is removed, and capacity with an unreleased allocation is not. -- A certificate from the client CA with an unlisted subject is rejected - during the handshake. +- A caller with a certificate from the right authority but an unlisted + identity is refused. ## Decisions for a person - **Who approves commissioning plans.** This design requires a second person with the approver role. A person must decide which team holds that role and confirm the two-person rule. -- **Firmware is checked, not updated.** A server below the baseline fails - commissioning. A person must confirm that firmware updates stay out of - scope. +- **Firmware is checked, not updated.** A person must confirm that firmware + updates stay out of commissioning. - **Plan content per hardware model.** The burn-in image, its duration, and the evidence lifetime are operator policy. Fleet sets no defaults. -- **A new plan unprepares a whole model.** Qualifying a superseding plan - makes every matching free server unallocatable until it is commissioned - again. -- **The cleaning policy contract.** The cleaning policy owner must provide - name-to-digest resolution. Until then no registered capacity can be - enabled. -- **The webhook client identities.** Each environment names the API server - identities and keeps their issuer dedicated to them. +- **[A new plan unprepares its Devices](#the-current-plan).** A person must + accept that free servers of a model leave service until commissioned again. +- **[The cleaning policy contract](#the-cleaning-policy).** The cleaning + policy owner must agree to provide it. +- **[The webhook's certificate authority](#who-may-call-the-registration-webhook).** + Each environment must provide a dedicated one. ## Production readiness review questionnaire @@ -478,20 +517,20 @@ marked `Available` stops being `Available` until it is commissioned. ### What must operators monitor? -Commissioning failures by reason, commissioning holds, capacity reporting -`PlanAmbiguous` or `IdentityConflict`, expiring evidence, and webhook TLS -rejections. +Commissioning results by phase, commissioning holds, capacity reporting +`PlanAmbiguous` or `IdentityConflict`, expiring evidence, stale capacity +status, and refused webhook callers. ### What does the feature depend on? Device custody and site execution, BMC discovery, the boot server, and the -cleaning policy owner's resolution contract. +cleaning policy owner. ### Does the feature add API types or calls? It adds `DeviceCommissioningPlan`, `DeviceCommissioningPlanApproval` and -`DeviceCommissioning`. The projector makes one status write per capacity when -an input changes. +`DeviceCommissioning`. The projector writes a capacity's status when one of +its inputs changes. ## Implementation history @@ -500,8 +539,8 @@ an input changes. ## Drawbacks - Commissioning reboots the server and holds it for the burn-in duration. -- Every free server of a model needs commissioning again after a plan change. -- Enabling registered capacity waits on the cleaning policy contract. +- Enabling registered capacity waits on the cleaning policy owner. +- A webhook outage stops capacity status updates. ## Alternatives @@ -513,8 +552,7 @@ an input changes. to read the provider project, and the record would lose the plan when it is deleted. - **An identity claim object per alias:** A claim cannot make another - Device's create fail, so it leaves the same window as rule 3 and adds a - kind. + Device's create fail, so it leaves the same window and adds a kind. - **Updating firmware during commissioning:** A failed update can leave the server unbootable, which needs its own recovery design. From ff9201e22a137d6553fb4cf6d950ab9ab5a8afd0 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:37:15 -0600 Subject: [PATCH 3/4] docs: Say passes where a verdict is meant Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-commissioning/README.md | 16 ++++++++++------ .../diagrams/sellable-path.svg | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/enhancements/device-commissioning/README.md b/docs/enhancements/device-commissioning/README.md index add131bd..aa61e083 100644 --- a/docs/enhancements/device-commissioning/README.md +++ b/docs/enhancements/device-commissioning/README.md @@ -79,9 +79,9 @@ directly, so those conditions prove nothing. with a copy of the approved plan. Custody admits it from holder `None` and sets holder `Service`. 4. The site worker inspects the server, checks firmware, runs burn-in, and - returns a verdict with evidence. Custody returns to `None`. -5. The capacity projector sets `Prepared` and `Healthy` and records the - inspected hardware on the capacity. + returns a proven verdict with evidence. Custody returns to `None`. +5. If the server passed, the capacity projector sets `Prepared` and + `Healthy` and records the inspected hardware on the capacity. 6. A capacity operator enables the capacity with a cleaning policy and a pool label. The projector sets `Available`, and the pool's MachineClass can allocate it. @@ -284,8 +284,8 @@ Evidence carries no credential and no raw BMC response. #### Holds A commissioning that ends `OutcomeUnknown` sets a commissioning hold. A later -`DeviceCommissioning` that succeeds settles it, as the device operations -settlement table says. No `Retry` is needed, because staff create the +`DeviceCommissioning` that ends `Succeeded`, with either result, settles it, +as the device operations settlement table says. No `Retry` is needed, because staff create the settling operation directly. ### Capacity status @@ -430,9 +430,13 @@ and refuses any other caller before reading its request. ### Changes to device operations -This enhancement changes three rules of the [device +This enhancement changes four rules of the [device operations](../device-operations/README.md) design: +- **Outcome phases.** For a commissioning, `Succeeded` means the verdict is + proven, whether the server passed or failed. The success test is the proof, + not a passing server. + - **Retention.** Fleet keeps each Device's latest succeeded commissioning past the 30-day retention of finished operations, until a later one succeeds. The projector reads it. diff --git a/docs/enhancements/device-commissioning/diagrams/sellable-path.svg b/docs/enhancements/device-commissioning/diagrams/sellable-path.svg index c8f07479..e4d3c159 100644 --- a/docs/enhancements/device-commissioning/diagrams/sellable-path.svg +++ b/docs/enhancements/device-commissioning/diagrams/sellable-path.svg @@ -1,5 +1,5 @@ -A registered server becomes allocatableA registered server starts with Disabled capacity. Staff commission it under an approved plan. When commissioning succeeds, the projector derives Prepared and Healthy. A capacity operator enables the capacity with a cleaning policy and a pool label. The projector derives Available while custody is free, and the allocator claims custody to allocate it. +A registered server becomes allocatableA registered server starts with Disabled capacity. Staff commission it under an approved plan. When the server passes commissioning, the projector derives Prepared and Healthy. A capacity operator enables the capacity with a cleaning policy and a pool label. The projector derives Available while custody is free, and the allocator claims custody to allocate it. @@ -24,7 +24,7 @@ Commission -Succeeds +Passes Capacity operator enables From e2c1e0a3da7d4d01d023ddd95a6e21176e4fd0d2 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 16:28:06 -0600 Subject: [PATCH 4/4] docs(commissioning): Pin plans without object UIDs The design named the plan's UID in approvals, commissionings and evidence. An approval's name is now derived from the plan's UID, and each record names the plan's generation, digest and approval, so a recreated plan inherits nothing. Co-Authored-By: Claude Opus 5.5 --- .../device-commissioning/README.md | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/docs/enhancements/device-commissioning/README.md b/docs/enhancements/device-commissioning/README.md index aa61e083..bd90a91c 100644 --- a/docs/enhancements/device-commissioning/README.md +++ b/docs/enhancements/device-commissioning/README.md @@ -156,10 +156,17 @@ The creator must be the authenticated caller, as for operations. #### Qualification +No spec in this design holds an object UID; the one exception is each +creator, the authenticated caller who created the record. A plan's +incarnation is pinned by its approval's name, and its content by its +generation and the digest of its spec. + A plan is **qualified** when a `DeviceCommissioningPlanApproval` with the -plan's name exists and all of these hold: +plan's approval name exists and all of these hold: -- The approval names the plan's UID and the digest of its spec. +- The approval's name is the plan's name and a suffix derived from the + plan's UID. +- The approval names the plan's generation and the digest of its spec. - The approval's creator is not the plan's creator. - The approval's creator held the commissioning plan approver role when the approval was created. IAM checks this on create. @@ -168,18 +175,22 @@ plan's name exists and all of these hold: apiVersion: fleet.datumapis.com/v1alpha1 kind: DeviceCommissioningPlanApproval metadata: - name: example-2u-v3 # the plan's name, so a plan has at most one approval + # The plan's name and a suffix derived from the plan's UID, so a plan + # incarnation has at most one approval. + name: example-2u-v3-3f9c2a7d1e0b4c58 namespace: default spec: creator: {username: approver@example.com, uid: 00000000-0000-4000-8000-000000000002} planRef: name: example-2u-v3 - uid: 00000000-0000-4000-8000-000000000003 + generation: 1 digest: "sha256:2222222222222222222222222222222222222222222222222222222222222222" ``` An approval is immutable. Deleting it revokes qualification. A plan deleted -and created again has a new UID, so an old approval cannot qualify it. +and created again under the same name has a new UID, and so another approval +name. It inherits no approval, and nothing that names the old approval counts +for it. #### The current plan @@ -203,7 +214,7 @@ customer holds is not affected until it is released. | Creator | Authority | Required holder | Inputs | | --- | --- | --- | --- | -| Staff commissioning operator | `serviceRequest` | `None`, or `Service` under a commissioning hold | The plan's name, UID and digest, and a copy of its content | +| Staff commissioning operator | `serviceRequest` | `None`, or `Service` under a commissioning hold | The plan's name, generation and digest, its approval's name, and a copy of its content | ```yaml apiVersion: fleet.datumapis.com/v1alpha1 @@ -213,18 +224,22 @@ metadata: namespace: default spec: creator: {username: operator@example.com, uid: 00000000-0000-4000-8000-000000000004} - deviceRef: {name: server-example-001, uid: 00000000-0000-4000-8000-000000000005} + deviceRef: {name: server-example-001} authority: serviceRequest: {reason: New server intake} plan: name: example-2u-v3 - uid: 00000000-0000-4000-8000-000000000003 + generation: 1 digest: "sha256:2222222222222222222222222222222222222222222222222222222222222222" + approval: example-2u-v3-3f9c2a7d1e0b4c58 content: {} # an exact copy of the plan's content ``` The operation carries a copy of the plan, so the site runs exactly the plan that admission checked, and the record keeps it after the plan is deleted. +The approval's name pins the plan incarnation. The Device incarnation is +pinned as the [device operations design](../device-operations/README.md) +pins it for every operation. #### Admission @@ -232,9 +247,9 @@ The shared admission rules apply. The kind adds these checks: | Reason | Refused when | | --- | --- | -| `PlanNotQualified` | The named plan does not exist, has another UID, or is not qualified. | +| `PlanNotQualified` | The named plan does not exist, the named approval is not the plan's, or the plan is not qualified. | | `PlanNotCurrent` | The plan is not the Device's current plan. | -| `PlanMismatch` | The named digest is not the plan's, or the copied content differs from the plan's. | +| `PlanMismatch` | The named generation or digest is not the plan's, or the copied content differs from the plan's. | | `DeviceNotActive` | The Device's inventory lifecycle is not `Active`. | Like every staff operation, a commissioning never queues. @@ -277,7 +292,7 @@ A `Succeeded` commissioning records: MachineCapacity hardware; - each firmware component and its version; - the burn-in result and its start and end times, if burn-in ran; and -- the plan's name, UID and digest. +- the plan's name, generation and digest, and its approval's name. Evidence carries no credential and no raw BMC response. @@ -298,7 +313,7 @@ every Device in the provider scope. | Condition | True when | | --- | --- | -| `Prepared` | The Device's latest succeeded commissioning used its current plan, and its result is `Passed`. | +| `Prepared` | The Device's latest succeeded commissioning named its current plan's generation, digest and approval, and its result is `Passed`. | | `Healthy` | `Prepared`, that commissioning ended within the plan's evidence lifetime, discovery is current, and discovery reports the serial number, system UUID and BMC key digest the commissioning recorded. | | `Available` | `Healthy`, custody is `Verified` with holder `None`, no active operation and no recovery hold, the allocation policy is `Enabled`, the Device is `Active`, the cleaning policy resolves, and the Device has no [duplicate](#duplicate-identity). |