From 39198308413feaa0b31cb8fe69cf683760a57022 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:27:07 -0600 Subject: [PATCH 1/8] docs: Propose cleaning policies for reusing servers Define CleaningPolicy, the erase methods and assurance it may claim, how allocation pins it with the server's drives, and the evidence a release wipe must return before the Cleaning gate closes. Co-Authored-By: Claude Opus 5.5 --- docs/README.md | 1 + docs/enhancements/device-cleaning/README.md | 411 ++++++++++++++++++ .../diagrams/cleaning-flow.svg | 37 ++ 3 files changed, 449 insertions(+) create mode 100644 docs/enhancements/device-cleaning/README.md create mode 100644 docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg diff --git a/docs/README.md b/docs/README.md index bf31f1c5..b4634f97 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 cleaning](enhancements/device-cleaning/README.md) | Proposed cleaning policy and evidence for reusing a server | | [Proposals](proposals/fleet-management/README.md) | Broader service proposals, examples, diagrams, and provenance | ## Read implementation and design separately diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md new file mode 100644 index 00000000..252df033 --- /dev/null +++ b/docs/enhancements/device-cleaning/README.md @@ -0,0 +1,411 @@ +--- +status: provisional +stage: alpha +--- + +# Cleaning servers between customers + +[Documentation overview](../../README.md) ยท [Functionality guide](../../functionality/README.md) + +- [Summary](#summary) +- [Motivation](#motivation) +- [Proposal](#proposal) +- [Design details](#design-details) + - [CleaningPolicy](#cleaningpolicy) + - [Methods and assurance](#methods-and-assurance) + - [Selecting drives](#selecting-drives) + - [Pinning at allocation](#pinning-at-allocation) + - [Planning a release](#planning-a-release) + - [Running a wipe](#running-a-wipe) + - [Evidence and the cleaning gate](#evidence-and-the-cleaning-gate) + - [Capacity status](#capacity-status) + - [What the lab proves](#what-the-lab-proves) + - [Implementation decisions](#implementation-decisions) + - [Acceptance tests](#acceptance-tests) +- [Production readiness review questionnaire](#production-readiness-review-questionnaire) +- [Implementation history](#implementation-history) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure needed](#infrastructure-needed) + +## Summary + +A `CleaningPolicy` says how Fleet cleans each drive of a server before another +customer can use it, what each step must prove, and what assurance the policy +claims. Allocation pins the policy and the server's drives. Release runs a +`DeviceWipe` planned from that pin, and the server leaves release only when the +wipe's evidence meets the policy. + +This enhancement is a proposal. Nothing in it is implemented. + +## Motivation + +MachineCapacity names a cleaning policy that no API defines. Release runs one +lab procedure that zeroes a virtual disk and reads it back. Disk names come from +site enrollment, not from the drives the server reports. Nothing ties what +Fleet erased to what the customer could write. + +### Goals + +- Providers state, per media type, which erase methods Fleet may use and in + which order. +- Every drive the customer could write is cleaned, named by its identity, not + by a guessed device path. +- Each step produces evidence that a reviewer can check against the policy. +- A policy claims only the assurance its methods can give. +- A server whose cleaning is unproven stays out of use. +- Changing a policy never weakens cleaning for servers already allocated. + +### Non-goals + +- Firmware, BMC settings, and credentials. Other release gates own them. +- Physical destruction and disposal. Staff retire the server instead. +- Storage that is not local to the server, such as SAN or NVMe over fabrics. + Capacity with such storage is not offered. +- Standards certification. Assurance names follow NIST SP 800-88 and IEEE + 2883, but Fleet makes no certification claim. + +## Proposal + +![A pinned policy and drive manifest drive each release wipe](diagrams/cleaning-flow.svg) + +### User stories + +- A provider publishes a policy that purges NVMe drives with a cryptographic + erase and falls back to a block erase. +- A customer deletes a Machine, and Fleet erases every drive with the methods + pinned at allocation. +- A drive refuses its first method, and Fleet uses the next method in the + policy. +- A wipe's verification fails, and the server stays in release until staff + retry or retire it. +- A provider adds a drive model to a new policy after it passes hardware + qualification. + +### Relationship to other proposals + +This enhancement fills a non-goal of [Device +operations](../device-operations/README.md): cleaning policy content and +assurance levels. It changes these parts of that design: + +- **[Operations](../device-operations/README.md#operations):** `DeviceWipe` + carries a [cleaning plan](#planning-a-release) instead of a policy digest + and target disks. +- **[Capacity status](../device-operations/README.md#capacity-status):** + `Available` adds the [cleaning check](#capacity-status). + +The [machine lifecycle](../machine-lifecycle/README.md#release-and-project-lifecycle) +release gates are unchanged. This enhancement defines when the `Cleaning` gate +closes. + +It takes the media manifest, the coverage rules, and the limits on +cryptographic erase from [#65][release-reuse-pr], without its relational +ledger. + +## Design details + +### CleaningPolicy + +`CleaningPolicy` is in `fleet.datumapis.com` and lives in the provider +project, in the namespace of the MachineCapacity that references it. Provider +operators own it. Customers cannot read it. Examples use synthetic data. + +```yaml +apiVersion: fleet.datumapis.com/v1alpha1 +kind: CleaningPolicy +metadata: + name: tenant-reuse-v1 + namespace: infra-ops +spec: + # Clear or Purge. Every drive must reach it. + assurance: Purge + # Rules are matched in order. The first rule that matches a drive applies. + rules: + - name: nvme-qualified + match: + protocol: NVMe # NVMe | SATA | SAS + mediaType: SSD # SSD | HDD + # Required for Purge: the drive models and firmware that passed + # hardware qualification for these methods. + models: + - {model: EXAMPLE-NVME-3840, firmware: [EX1.2, EX1.3]} + # Tried in order. A method runs only if the drive supports it. + methods: [CryptographicErase, BlockErase] + verify: {mode: Canary, samples: 64} + - name: sata-hdd + match: {protocol: SATA, mediaType: HDD, + models: [{model: EXAMPLE-HDD-8000, firmware: [EXH4]}]} + methods: [BlockErase] + verify: {mode: Canary, samples: 64} +``` + +The policy's digest is the SHA-256 of its canonical spec. The spec is immutable. To change a policy, a provider creates a new one and +points MachineCapacity at it. Allocations that pinned the old policy keep it. + +Validation rejects a policy when: + +- a rule lists a method that cannot reach the policy's assurance; +- a `Purge` rule lists no qualified models; or +- a method does not apply to the rule's protocol. + +These checks keep a fallback method from lowering the assurance. + +### Methods and assurance + +Each method has a fixed assurance, from IEEE 2883: + +| Method | NVMe | SATA or SAS | Assurance | +| --- | --- | --- | --- | +| `CryptographicErase` | Sanitize with crypto erase | Sanitize with crypto scramble | Purge | +| `BlockErase` | Sanitize with block erase | Sanitize with block erase | Purge | +| `Format` | Format with user data erase | Not applicable | Clear | +| `SecureErase` | Not applicable | Security erase unit | Clear | +| `Overwrite` | Host writes zeros to every block | Same | Clear | + +`Overwrite` covers only the blocks the host can address. It says nothing about +remapped or spare flash, so it never reaches `Purge`. + +`CryptographicErase` counts only when the drive reports that it encrypted user +data before the allocation began. Enabling encryption during release does not +count. + +Each method uses one of two checks: + +| Verify mode | Check | Required by | +| --- | --- | --- | +| `Full` | Read every block back and compare it with the written pattern. | `Overwrite` | +| `Canary` | Before the erase, write a random marker to sampled ranges, including the first and last. After it, read them back. No marker may remain. | Every other method | + +A rule may require `Full` for any method whose result is a fixed pattern. + +### Selecting drives + +BMC discovery reads each server's drives over Redfish and records them in +Device status, next to the rest of its inventory. For each drive it records the +serial number, model, firmware, protocol, media type, capacity, and encryption +status. Discovery stays the only writer of Device status. + +The capacity projector names drives `disk-0`, `disk-1`, and so on, ordered by +protocol and serial number, and publishes them in MachineCapacity status. +Installations target these names. Site enrollment no longer names disks. + +Fleet treats the serial number as an identity claim to match, not as proof. +The wipe environment checks it again on the server itself. + +### Pinning at allocation + +When it creates a MachineAllocation, the allocator copies into it: + +- the policy's name, UID, digest, and spec; and +- the media manifest: each drive's name, identity, capacity, encryption status, + and the rule that matches it. + +Allocation refuses a server whose policy does not resolve, or that has a drive +no rule matches. Later changes to the policy or to discovery do not change the +pin. + +### Planning a release + +The release controller plans the `Cleaning` gate from the pin and current +discovery: + +- Every drive in the manifest gets a step, with its rule's methods and check. +- A drive that discovery reports now and the manifest lacks also gets a step, + planned with the pinned policy. The customer could have written to it. +- A manifest drive that discovery no longer reports blocks the plan, with + reason `DriveMissing`. Replacing a drive does not settle the missing one. +- A new drive that no rule matches blocks the plan, with reason `DriveUncovered`. + +A blocked plan creates no wipe. The `Cleaning` gate stays open, and the +allocation reports why. + +The `DeviceWipe` carries the plan: + +```yaml +apiVersion: fleet.datumapis.com/v1alpha1 +kind: DeviceWipe +metadata: + name: alloc-3b9d61c2-wipe-1 + namespace: default +spec: + creator: system:serviceaccount:fleet-system:release-controller + deviceRef: {name: server-example-001, uid: 6f1c0b52-1d7e-4a35-9e0b-2c41f7a0d9e3} + authority: + allocationRef: {name: alloc-3b9d61c2} + step: 1 + policy: {name: tenant-reuse-v1, uid: 0d6e3b9a-52c1-4f7e-a8d0-3c9b1e5f7a24, + digest: "sha256:5b1e0c7d9a3f..."} + assurance: Purge + drives: + - name: disk-0 + serial: EXAMPLE-SN-0001 + model: EXAMPLE-NVME-3840 + firmware: EX1.3 + protocol: NVMe + capacityBytes: 3840755982336 + rule: nvme-qualified + methods: [CryptographicErase, BlockErase] + verify: {mode: Canary, samples: 64} +``` + +Admission adds one check of its own to the [shared +rules](../device-operations/README.md#admission): the plan must equal the plan +the allocation's pin and current discovery produce. It refuses a mismatch with +reason `PlanMismatch`. + +### Running a wipe + +The site worker uses Redfish to check identity, power the server off, and boot +the pinned wipe environment over the network once, as it does today. The wipe +environment runs every step on the server and prints one receipt. + +Before it changes anything, the wipe environment: + +1. lists every local block device and namespace; +2. matches each to a planned drive by serial number, model, and firmware; +3. checks that each in-band size equals the planned capacity, so a hidden area + fails the plan; and +4. stops with reason `MediaMismatch` if a planned drive is missing or an + unplanned device exists. + +Then, for each drive, it tries the planned methods in order. It skips a method +that the drive reports it does not support, or that a frozen security state +blocks, and records why. It moves to the next method only when the drive +refused a command without starting it. Any other error leaves that drive's +outcome unknown. + +The worker journals each step before it sends it, as every [site +worker](../device-operations/README.md#site-execution) does. Erase commands +are never sent twice. After a crash, the wipe environment reads each drive's +sanitize or erase status instead. + +### Evidence and the cleaning gate + +The wipe returns one entry per planned drive: + +```yaml +evidence: + policyDigest: "sha256:5b1e0c7d9a3f..." + drives: + - name: disk-0 + serial: EXAMPLE-SN-0001 + inBandBytes: 3840755982336 + skipped: [{method: CryptographicErase, reason: Unsupported}] + method: BlockErase + assurance: Purge + completion: {status: Succeeded, deviceStatus: "sanitize completed"} + verify: {mode: Canary, samples: 64, markersFound: 0} + startedAt: "2026-11-24T18:31:02Z" + completedAt: "2026-11-24T18:52:40Z" +``` + +Evidence never carries data read from a drive. + +The coordinator checks the evidence against the admitted plan before it accepts +a `Succeeded` result. Every planned drive must have an entry with the planned +identity, a method from its list, the policy's assurance, a completed erase, and +a passed check. A result that falls short becomes `OutcomeUnknown`, and the +server gets a [recovery hold](../device-operations/README.md#unknown-outcomes). +Staff then retry the wipe or retire the server. + +The `Cleaning` gate closes when a `DeviceWipe` for the allocation succeeds with +accepted evidence. + +### Capacity status + +MachineCapacity is `Available` only when its policy resolves and a rule matches +every drive Device discovery reports. A capacity with an uncovered drive +reports reason `CleaningUncovered`. Commissioning uses the same check before +staff enable capacity. + +### What the lab proves + +The lab runs virtual machines behind a Redfish emulator. It can prove: + +- drive discovery over Redfish, the media manifest, and planning; +- matching drives by serial number and refusing a missing or extra drive; +- `Overwrite` with `Full` verification on a virtual disk; +- `Format` with `Canary` verification on an emulated NVMe drive; +- falling back when an emulated drive does not support a method; and +- journaling, crash recovery, and the evidence check. + +It cannot prove that any method removes data from real media. Emulated drives +have no spare flash, no controller cache, and no encryption keys. The lab cannot +run `CryptographicErase`, `BlockErase`, or `SecureErase`. Each drive model and +firmware must pass hardware qualification before a policy lists it for those +methods. + +### Implementation decisions + +Record these decisions before implementation: + +- Who approves a hardware qualification, and where its results live. +- Whether staff can release a server whose plan is blocked without retiring it. +- Which roles can create a CleaningPolicy. + +### Acceptance tests + +These tests are required and not implemented: + +- A policy with a fallback below its assurance is rejected. +- A policy cannot change after creation, and an allocation keeps its pin after + the policy is deleted. +- Allocation refuses a server with a drive that no rule matches. +- A drive is removed during an allocation, and release blocks with + `DriveMissing`. +- The wipe environment finds an unplanned device and stops before erasing. +- A drive refuses its first method, and the next method's evidence closes the + gate. +- A canary survives an erase, and the server gets a recovery hold. +- A worker crashes after sending an erase, and the resumed worker reads the + drive's status instead of sending it again. + +## Production readiness review questionnaire + +These controls are proposed, not implemented. + +### How do operators enable or disable the feature? + +Register the kind, then create a policy and point MachineCapacity at it. +Capacity without a policy is not `Available`. Releases always use their pins. + +### What must operators monitor? + +Blocked plans, recovery holds from wipes, wipe duration per drive model, and +capacity that is not `Available` because a drive is uncovered. + +### Does the feature add API types or calls? + +It adds `CleaningPolicy` and changes `DeviceWipe`. Discovery adds reads of each +server's drives. + +## Implementation history + +- 2026-11-25: Proposed. + +## Drawbacks + +- Each drive model needs hardware qualification before it can reach `Purge`. +- Copying the policy into every allocation duplicates it. +- Running every step in one network boot makes a long wipe one long operation. + +## Alternatives + +- **Erase over Redfish:** Redfish offers a drive erase action, but its effect + depends on the vendor, and Fleet cannot verify it without booting the server. + Fleet can add it as a method once a vendor's action passes qualification. +- **A policy digest without a copy:** Release would fail if the policy were + deleted. A finalizer would need a writer that tracks every pin. +- **A policy per allocation request:** Customers would choose their cleaning. + Cleaning protects the next customer, so the provider owns it. +- **A relational ledger, as in [#65][release-reuse-pr]:** It adds a database. + The allocation and the operation hold everything release needs. + +## Infrastructure needed + +Testing needs virtual machines with emulated NVMe and virtual disks, and a +Redfish emulator that reports drives. Hardware qualification needs each drive +model and firmware on real servers, and a way to inspect the media after an +erase. + +[release-reuse-pr]: https://github.com/datum-cloud/fleet/pull/65 diff --git a/docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg b/docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg new file mode 100644 index 00000000..292e26c2 --- /dev/null +++ b/docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg @@ -0,0 +1,37 @@ + +A pinned policy and drive manifest drive each release wipeAt allocation, the MachineAllocation pins a copy of the CleaningPolicy and the manifest of drives that Device discovery reports. At release, the release controller plans one step per drive from that pin and creates a DeviceWipe. The site runs each drive's methods in order and verifies them. The coordinator checks the evidence against the plan. Evidence that meets the plan closes the Cleaning gate. Evidence that falls short puts the server under a recovery hold. + + + + +CleaningPolicy +Methods per media + +Device discovery +Drives over Redfish + +MachineAllocation +Pins policy and drives + +DeviceWipe at the site +Methods in order, then verify + +Coordinator +Evidence meets the plan? + +Cleaning gate closes +Release can end + +Recovery hold +Staff retry or retire + + + +Release +plans + + +Yes + +No + From c924af8d7944322474ce00af8cd777feebc4dde6 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:32:23 -0600 Subject: [PATCH 2/8] docs: Close cleaning gaps found in review Ground the lab claims in today's emulator, define how erase steps are journaled and what survives a crash, gate crypto erase on per-method qualification, and require two drive inventories that agree. Pin drive names, let the coordinator own the success test, and add DisposeDrive for a pulled drive. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-cleaning/README.md | 352 ++++++++++-------- .../diagrams/cleaning-flow.svg | 6 +- 2 files changed, 210 insertions(+), 148 deletions(-) diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md index 252df033..7603b9eb 100644 --- a/docs/enhancements/device-cleaning/README.md +++ b/docs/enhancements/device-cleaning/README.md @@ -13,10 +13,11 @@ stage: alpha - [Design details](#design-details) - [CleaningPolicy](#cleaningpolicy) - [Methods and assurance](#methods-and-assurance) - - [Selecting drives](#selecting-drives) + - [Drive inventory](#drive-inventory) - [Pinning at allocation](#pinning-at-allocation) - [Planning a release](#planning-a-release) - [Running a wipe](#running-a-wipe) + - [Crashes and deadlines](#crashes-and-deadlines) - [Evidence and the cleaning gate](#evidence-and-the-cleaning-gate) - [Capacity status](#capacity-status) - [What the lab proves](#what-the-lab-proves) @@ -42,16 +43,16 @@ This enhancement is a proposal. Nothing in it is implemented. MachineCapacity names a cleaning policy that no API defines. Release runs one lab procedure that zeroes a virtual disk and reads it back. Disk names come from -site enrollment, not from the drives the server reports. Nothing ties what -Fleet erased to what the customer could write. +site enrollment, not from the drives the server has. Nothing ties what Fleet +erased to what the customer could write. ### Goals -- Providers state, per media type, which erase methods Fleet may use and in +- Providers state, per drive type, which erase methods Fleet may use and in which order. - Every drive the customer could write is cleaned, named by its identity, not by a guessed device path. -- Each step produces evidence that a reviewer can check against the policy. +- Each step produces evidence that Fleet checks against the policy. - A policy claims only the assurance its methods can give. - A server whose cleaning is unproven stays out of use. - Changing a policy never weakens cleaning for servers already allocated. @@ -59,11 +60,12 @@ Fleet erased to what the customer could write. ### Non-goals - Firmware, BMC settings, and credentials. Other release gates own them. -- Physical destruction and disposal. Staff retire the server instead. -- Storage that is not local to the server, such as SAN or NVMe over fabrics. - Capacity with such storage is not offered. -- Standards certification. Assurance names follow NIST SP 800-88 and IEEE - 2883, but Fleet makes no certification claim. +- Physical destruction. Staff retire the server or record a drive's disposal. +- Storage that is not a local drive the host addresses directly: RAID volumes, + SAN, NVMe over fabrics, and removable media. Capacity with such storage is + not offered. +- Standards certification. Fleet uses the assurance names of NIST SP 800-88 + and IEEE 2883 and makes no certification claim. ## Proposal @@ -75,12 +77,11 @@ Fleet erased to what the customer could write. erase and falls back to a block erase. - A customer deletes a Machine, and Fleet erases every drive with the methods pinned at allocation. -- A drive refuses its first method, and Fleet uses the next method in the - policy. +- A drive refuses its first method, and Fleet uses the next one. - A wipe's verification fails, and the server stays in release until staff - retry or retire it. -- A provider adds a drive model to a new policy after it passes hardware - qualification. + retry the wipe or retire the server. +- A drive fails during an allocation and is pulled. Staff record its + disposal, and release cleans the remaining drives. ### Relationship to other proposals @@ -90,10 +91,15 @@ assurance levels. It changes these parts of that design: - **[Operations](../device-operations/README.md#operations):** `DeviceWipe` carries a [cleaning plan](#planning-a-release) instead of a policy digest - and target disks. + and target disks, and its deadline comes from the plan. +- **[Unknown outcomes](../device-operations/README.md#unknown-outcomes):** + `DeviceRecovery` gains a `DisposeDrive` decision. - **[Capacity status](../device-operations/README.md#capacity-status):** `Available` adds the [cleaning check](#capacity-status). +Commissioning must capture an in-band drive inventory. See [Drive +inventory](#drive-inventory). + The [machine lifecycle](../machine-lifecycle/README.md#release-and-project-lifecycle) release gates are unchanged. This enhancement defines when the `Cleaning` gate closes. @@ -121,103 +127,119 @@ spec: assurance: Purge # Rules are matched in order. The first rule that matches a drive applies. rules: - - name: nvme-qualified - match: - protocol: NVMe # NVMe | SATA | SAS - mediaType: SSD # SSD | HDD - # Required for Purge: the drive models and firmware that passed - # hardware qualification for these methods. - models: - - {model: EXAMPLE-NVME-3840, firmware: [EX1.2, EX1.3]} - # Tried in order. A method runs only if the drive supports it. + - name: nvme-ssd + match: {protocol: NVMe, mediaType: SSD} # NVMe | SATA | SAS, SSD | HDD + # Tried in order. Fleet plans only the methods qualified for the drive. methods: [CryptographicErase, BlockErase] verify: {mode: Canary, samples: 64} + # How long each method may take per TiB of capacity. + timePerTiB: 10m - name: sata-hdd - match: {protocol: SATA, mediaType: HDD, - models: [{model: EXAMPLE-HDD-8000, firmware: [EXH4]}]} - methods: [BlockErase] + match: {protocol: SATA, mediaType: HDD} + methods: [SanitizeOverwrite] verify: {mode: Canary, samples: 64} + timePerTiB: 3h + # The drive models and firmware that passed hardware qualification, and the + # methods each passed. Required for every Purge method. + qualified: + - {model: EXAMPLE-NVME-3840, firmware: [EX1.2, EX1.3], + methods: [CryptographicErase, BlockErase], alwaysEncrypts: true} + - {model: EXAMPLE-HDD-8000, firmware: [EXH4], methods: [SanitizeOverwrite]} ``` -The policy's digest is the SHA-256 of its canonical spec. The spec is immutable. To change a policy, a provider creates a new one and -points MachineCapacity at it. Allocations that pinned the old policy keep it. - -Validation rejects a policy when: +The CRD's validation rules keep the spec immutable. To change a policy, a +provider creates a new one and points MachineCapacity at it. The Fleet +validating webhook that checks operation creators also rejects a policy when: -- a rule lists a method that cannot reach the policy's assurance; -- a `Purge` rule lists no qualified models; or -- a method does not apply to the rule's protocol. - -These checks keep a fallback method from lowering the assurance. +- a rule lists a method that cannot reach the policy's assurance, so a + fallback never lowers it; +- a method does not apply to the rule's protocol; or +- a method's check is not one it allows. ### Methods and assurance -Each method has a fixed assurance, from IEEE 2883: +Fleet takes each method's assurance from IEEE 2883-2022, which NIST SP 800-88 +Rev. 2 refers to. Where guidance differs, Fleet uses the lower level. -| Method | NVMe | SATA or SAS | Assurance | -| --- | --- | --- | --- | -| `CryptographicErase` | Sanitize with crypto erase | Sanitize with crypto scramble | Purge | -| `BlockErase` | Sanitize with block erase | Sanitize with block erase | Purge | -| `Format` | Format with user data erase | Not applicable | Clear | -| `SecureErase` | Not applicable | Security erase unit | Clear | -| `Overwrite` | Host writes zeros to every block | Same | Clear | +| Method | NVMe | SATA | SAS | Assurance | +| --- | --- | --- | --- | --- | +| `CryptographicErase` | Sanitize, crypto erase | Sanitize, crypto scramble | Sanitize, cryptographic erase | Purge | +| `BlockErase` | Sanitize, block erase | Sanitize, block erase | Sanitize, block erase | Purge | +| `SanitizeOverwrite` | Sanitize, overwrite | Sanitize, overwrite | Sanitize, overwrite | Purge | +| `Format` | Format, user data erase | None | Format unit | Clear | +| `SecureErase` | None | Security erase unit | None | Clear | +| `Overwrite` | Host writes zeros to every block | Same | Same | Clear | -`Overwrite` covers only the blocks the host can address. It says nothing about -remapped or spare flash, so it never reaches `Purge`. +Some guidance rates an enhanced security erase as Purge. Fleet rates it Clear, +because its coverage of spare sectors depends on firmware. `Overwrite` covers +only the blocks the host can address. -`CryptographicErase` counts only when the drive reports that it encrypted user -data before the allocation began. Enabling encryption during release does not -count. +A Purge method runs on a drive only when the policy lists the drive's model, +firmware, and that method as qualified. `CryptographicErase` also needs a +qualification that says the model always encrypts user data. Enabling +encryption during release does not count. Each method uses one of two checks: -| Verify mode | Check | Required by | +| Verify mode | Check | Allowed for | | --- | --- | --- | -| `Full` | Read every block back and compare it with the written pattern. | `Overwrite` | -| `Canary` | Before the erase, write a random marker to sampled ranges, including the first and last. After it, read them back. No marker may remain. | Every other method | +| `Full` | Read every block back and compare it with the written pattern. | `Overwrite`, required. Any method that leaves a fixed pattern. | +| `Canary` | Before the erase, write random markers to sampled ranges, including the first and last. After it, read them back. No marker may remain. | Every method except `Overwrite` | -A rule may require `Full` for any method whose result is a fixed pattern. +### Drive inventory -### Selecting drives +Two sources describe a server's drives, and they must agree: -BMC discovery reads each server's drives over Redfish and records them in -Device status, next to the rest of its inventory. For each drive it records the -serial number, model, firmware, protocol, media type, capacity, and encryption -status. Discovery stays the only writer of Device status. +- **BMC discovery** reads each drive over Redfish into Device status: serial + number, model, firmware, protocol, media type, capacity, and controller mode. + Discovery stays the only writer of Device status. +- **Commissioning** boots the server and records every block device the host + sees, including drives Redfish omits, NVMe namespaces, and removable or + virtual media. -The capacity projector names drives `disk-0`, `disk-1`, and so on, ordered by -protocol and serial number, and publishes them in MachineCapacity status. -Installations target these names. Site enrollment no longer names disks. +A server is covered only when the two lists name the same drives, every drive +is addressed directly by the host, and no removable media is attached. A drive +behind a RAID volume, a drive only one source reports, or a USB or SD device +leaves the server uncovered. -Fleet treats the serial number as an identity claim to match, not as proof. -The wipe environment checks it again on the server itself. +For NVMe, Fleet treats the controller as the drive. It compares the +controller's total capacity, not namespace sizes, because a customer can +create and delete namespaces. ### Pinning at allocation -When it creates a MachineAllocation, the allocator copies into it: +When it creates a MachineAllocation, the allocator computes the policy's +digest, the SHA-256 of its canonical spec, and copies into the allocation: - the policy's name, UID, digest, and spec; and -- the media manifest: each drive's name, identity, capacity, encryption status, - and the rule that matches it. +- the media manifest: each drive's name, identity, capacity, and matching rule. -Allocation refuses a server whose policy does not resolve, or that has a drive -no rule matches. Later changes to the policy or to discovery do not change the -pin. +The allocator names drives `disk-0`, `disk-1`, and so on, at pin time. Names +stay fixed for the allocation, and installations resolve target disks through +the manifest. Allocation refuses a server that is not +[covered](#capacity-status). Later changes to the policy or discovery do not +change the pin. ### Planning a release -The release controller plans the `Cleaning` gate from the pin and current -discovery: +One shared planner turns the pin and current discovery into a plan. The release +controller uses it to create a wipe, and admission uses it to check one. -- Every drive in the manifest gets a step, with its rule's methods and check. +- Every manifest drive gets a step. Its methods are the rule's methods that are + qualified for the drive, or all of them for a Clear rule. - A drive that discovery reports now and the manifest lacks also gets a step, planned with the pinned policy. The customer could have written to it. - A manifest drive that discovery no longer reports blocks the plan, with - reason `DriveMissing`. Replacing a drive does not settle the missing one. -- A new drive that no rule matches blocks the plan, with reason `DriveUncovered`. + reason `DriveMissing`. +- A drive with no planned method blocks the plan, with reason + `DriveUncovered`. -A blocked plan creates no wipe. The `Cleaning` gate stays open, and the -allocation reports why. +A blocked plan creates no wipe. The release controller records the reason in +the allocation's status, and the `Cleaning` gate stays open. Staff can record +the disposal of a missing drive with a `DeviceRecovery` decision +`DisposeDrive`, which names the drive and how it was destroyed or removed. The +planner then omits that drive. Replacing a drive does not settle the missing +one. The `DeviceWipe` carries the plan: @@ -243,41 +265,66 @@ spec: firmware: EX1.3 protocol: NVMe capacityBytes: 3840755982336 - rule: nvme-qualified + rule: nvme-ssd methods: [CryptographicErase, BlockErase] verify: {mode: Canary, samples: 64} ``` -Admission adds one check of its own to the [shared -rules](../device-operations/README.md#admission): the plan must equal the plan -the allocation's pin and current discovery produce. It refuses a mismatch with -reason `PlanMismatch`. +Admission checks that the plan equals the planner's output, as a check of the +kind's own inputs. It refuses a mismatch with reason `PlanMismatch`, and the +wipe ends `Failed` with nothing sent. The release controller then plans again +as the next step. ### Running a wipe -The site worker uses Redfish to check identity, power the server off, and boot -the pinned wipe environment over the network once, as it does today. The wipe -environment runs every step on the server and prints one receipt. +Before powering on, the site worker checks identity over Redfish, as it does +today, and ejects every BMC virtual media. It then boots the pinned wipe +environment over the network once. The boot server refuses a second boot under +the same admission, so the environment never runs twice for one wipe. Before it changes anything, the wipe environment: -1. lists every local block device and namespace; -2. matches each to a planned drive by serial number, model, and firmware; -3. checks that each in-band size equals the planned capacity, so a hidden area - fails the plan; and -4. stops with reason `MediaMismatch` if a planned drive is missing or an - unplanned device exists. +1. lists every block device, NVMe controller, and namespace; +2. matches each drive to a planned drive by serial number, model, and + firmware; +3. restores a host-protected area that shrank a drive; and +4. stops with reason `MediaMismatch` if a planned drive is missing, an + unplanned device exists, or a drive's size still differs from the plan. + +For NVMe, a Sanitize covers the whole controller. Before a `Format` or +`Overwrite`, the environment deletes every namespace and creates one that spans +the controller, so no capacity stays unaddressed. + +Then, for each drive, it tries the planned methods in order. It moves to the +next method only when the drive refuses a command without starting it: an +invalid opcode or field status on NVMe or SAS, or an aborted command on SATA. +It records each refusal. If every method is refused, the wipe ends `Failed` +with reason `NoSupportedMethod`. Any other error leaves that drive's outcome +unknown. + +### Crashes and deadlines + +The wipe environment sends each step to the site's boot server before it +starts the step, with the operation's boot capability. The site journals the +step at the operation's fence, then acknowledges it. The environment starts the +step only after the acknowledgement, and never sends an erase twice. -Then, for each drive, it tries the planned methods in order. It skips a method -that the drive reports it does not support, or that a frozen security state -blocks, and records why. It moves to the next method only when the drive -refused a command without starting it. Any other error leaves that drive's -outcome unknown. +If the server stops mid-wipe, the worker does not boot it again. Whether a +drive's state can be read afterward depends on the method: -The worker journals each step before it sends it, as every [site -worker](../device-operations/README.md#site-execution) does. Erase commands -are never sent twice. After a crash, the wipe environment reads each drive's -sanitize or erase status instead. +| Method | After a crash or deadline | +| --- | --- | +| `CryptographicErase`, `BlockErase`, `SanitizeOverwrite` | The drive keeps its sanitize status across power loss and finishes the sanitize, or reports that it failed. | +| `Format`, `SecureErase`, `Overwrite` | No status survives. The drive's state is unknown. | + +Either way, the wipe ends `OutcomeUnknown`, and the server gets a [recovery +hold](../device-operations/README.md#unknown-outcomes). A wipe that staff retry +reads any sanitize status first, and waits while a sanitize still runs. + +The wipe's deadline comes from the plan. It is a fixed boot allowance plus, +for each drive, the sum over its methods of the rule's `timePerTiB` times the +drive's capacity. A wipe that passes its deadline while a sanitize runs leaves +that drive busy until the sanitize ends. ### Evidence and the cleaning gate @@ -289,10 +336,9 @@ evidence: drives: - name: disk-0 serial: EXAMPLE-SN-0001 - inBandBytes: 3840755982336 - skipped: [{method: CryptographicErase, reason: Unsupported}] + firmware: EX1.3 + refused: [{method: CryptographicErase, status: "invalid field"}] method: BlockErase - assurance: Purge completion: {status: Succeeded, deviceStatus: "sanitize completed"} verify: {mode: Canary, samples: 64, markersFound: 0} startedAt: "2026-11-24T18:31:02Z" @@ -301,46 +347,59 @@ evidence: Evidence never carries data read from a drive. -The coordinator checks the evidence against the admitted plan before it accepts -a `Succeeded` result. Every planned drive must have an entry with the planned -identity, a method from its list, the policy's assurance, a completed erase, and -a passed check. A result that falls short becomes `OutcomeUnknown`, and the -server gets a [recovery hold](../device-operations/README.md#unknown-outcomes). -Staff then retry the wipe or retire the server. +The coordinator, not the site, decides whether a wipe succeeded. It accepts a +`Succeeded` result only when every planned drive has an entry with the planned +identity, a method from its planned list, a completed erase, and a passed check. +It derives each method's assurance itself. A result that falls short ends +`OutcomeUnknown` with one of these reasons, and the server gets a recovery hold: + +| Reason | Meaning | +| --- | --- | +| `EvidenceIncomplete` | A drive's entry is missing, or its erase or check did not complete. | +| `EvidenceMismatch` | An entry names another drive or firmware, or a method not in the plan. | +| `DataRemains` | A canary survived, or a block differed from the written pattern. | -The `Cleaning` gate closes when a `DeviceWipe` for the allocation succeeds with -accepted evidence. +`DataRemains` proves the erase failed. The hold is the same, because staff +must still choose between a retry and retirement. + +The `Cleaning` gate closes when a `DeviceWipe` for the allocation succeeds. ### Capacity status -MachineCapacity is `Available` only when its policy resolves and a rule matches -every drive Device discovery reports. A capacity with an uncovered drive -reports reason `CleaningUncovered`. Commissioning uses the same check before -staff enable capacity. +A server is covered when its MachineCapacity's policy resolves, commissioning +and discovery agree on its drives, and every drive has a planned method. +MachineCapacity is `Available` only when the server is covered. An uncovered +server reports reason `CleaningUncovered`. ### What the lab proves -The lab runs virtual machines behind a Redfish emulator. It can prove: +The lab runs virtual machines behind the DMTF Redfish Interface Emulator. +Today it proves only `Overwrite` with `Full` verification on one virtual disk, +and the journaling and recovery around it. + +With this work, the lab adapter reports drives with serial numbers, models, and +firmware, and the lab machines get emulated NVMe drives. The lab can then also +prove: + +- drive inventory, the manifest, planning, and blocked plans; +- matching drives by serial number, and refusing a missing or extra drive; +- the evidence check and every shortfall reason; and +- falling back when a drive refuses a method. -- drive discovery over Redfish, the media manifest, and planning; -- matching drives by serial number and refusing a missing or extra drive; -- `Overwrite` with `Full` verification on a virtual disk; -- `Format` with `Canary` verification on an emulated NVMe drive; -- falling back when an emulated drive does not support a method; and -- journaling, crash recovery, and the evidence check. +Whether the emulated NVMe drive implements `Format` and Sanitize must be +checked before the lab claims either. -It cannot prove that any method removes data from real media. Emulated drives -have no spare flash, no controller cache, and no encryption keys. The lab cannot -run `CryptographicErase`, `BlockErase`, or `SecureErase`. Each drive model and -firmware must pass hardware qualification before a policy lists it for those -methods. +The lab cannot prove that any method removes data from real media. Emulated +drives have no spare flash, no controller cache, and no encryption keys. Each +drive model and firmware must pass hardware qualification for each method a +policy lists for it. ### Implementation decisions Record these decisions before implementation: - Who approves a hardware qualification, and where its results live. -- Whether staff can release a server whose plan is blocked without retiring it. +- Who can record `DisposeDrive`, and whether a second person must confirm it. - Which roles can create a CleaningPolicy. ### Acceptance tests @@ -350,15 +409,17 @@ These tests are required and not implemented: - A policy with a fallback below its assurance is rejected. - A policy cannot change after creation, and an allocation keeps its pin after the policy is deleted. -- Allocation refuses a server with a drive that no rule matches. -- A drive is removed during an allocation, and release blocks with - `DriveMissing`. +- Allocation refuses a server with a drive no rule covers, or a drive only one + inventory source reports. +- A drive is removed during an allocation. Release blocks with `DriveMissing` + until staff record `DisposeDrive`. - The wipe environment finds an unplanned device and stops before erasing. - A drive refuses its first method, and the next method's evidence closes the gate. -- A canary survives an erase, and the server gets a recovery hold. -- A worker crashes after sending an erase, and the resumed worker reads the - drive's status instead of sending it again. +- A canary survives an erase, and the server gets a recovery hold with + `DataRemains`. +- The server stops during an erase. The worker does not boot it again, and the + wipe ends `OutcomeUnknown`. ## Production readiness review questionnaire @@ -372,12 +433,12 @@ Capacity without a policy is not `Available`. Releases always use their pins. ### What must operators monitor? Blocked plans, recovery holds from wipes, wipe duration per drive model, and -capacity that is not `Available` because a drive is uncovered. +uncovered capacity. ### Does the feature add API types or calls? -It adds `CleaningPolicy` and changes `DeviceWipe`. Discovery adds reads of each -server's drives. +It adds `CleaningPolicy`, changes `DeviceWipe`, and adds a `DeviceRecovery` +decision. Discovery adds reads of each server's drives. ## Implementation history @@ -385,9 +446,11 @@ server's drives. ## Drawbacks -- Each drive model needs hardware qualification before it can reach `Purge`. +- Each drive model needs hardware qualification for each Purge method. +- A pinned policy cannot be tightened. If a qualified method proves flawed, + servers already allocated still release with it, unless staff retire them. - Copying the policy into every allocation duplicates it. -- Running every step in one network boot makes a long wipe one long operation. +- Large drives make long wipes, and a crash late in one restarts it. ## Alternatives @@ -396,16 +459,15 @@ server's drives. Fleet can add it as a method once a vendor's action passes qualification. - **A policy digest without a copy:** Release would fail if the policy were deleted. A finalizer would need a writer that tracks every pin. -- **A policy per allocation request:** Customers would choose their cleaning. - Cleaning protects the next customer, so the provider owns it. +- **A policy chosen by each customer:** Cleaning protects the next customer, + so the provider owns it. - **A relational ledger, as in [#65][release-reuse-pr]:** It adds a database. The allocation and the operation hold everything release needs. ## Infrastructure needed -Testing needs virtual machines with emulated NVMe and virtual disks, and a -Redfish emulator that reports drives. Hardware qualification needs each drive -model and firmware on real servers, and a way to inspect the media after an -erase. +Testing needs virtual machines with emulated NVMe drives and a Redfish emulator +that reports drives. Hardware qualification needs each drive model and firmware +on real servers, and a way to inspect the media after an erase. [release-reuse-pr]: https://github.com/datum-cloud/fleet/pull/65 diff --git a/docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg b/docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg index 292e26c2..70c1a577 100644 --- a/docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg +++ b/docs/enhancements/device-cleaning/diagrams/cleaning-flow.svg @@ -1,5 +1,5 @@ -A pinned policy and drive manifest drive each release wipeAt allocation, the MachineAllocation pins a copy of the CleaningPolicy and the manifest of drives that Device discovery reports. At release, the release controller plans one step per drive from that pin and creates a DeviceWipe. The site runs each drive's methods in order and verifies them. The coordinator checks the evidence against the plan. Evidence that meets the plan closes the Cleaning gate. Evidence that falls short puts the server under a recovery hold. +A pinned policy and drive manifest drive each release wipeAt allocation, the MachineAllocation pins a copy of the CleaningPolicy and the manifest of drives that discovery and commissioning agree on. At release, the release controller plans one step per drive from that pin and creates a DeviceWipe. The site runs each drive's methods in order and verifies them. The coordinator checks the evidence against the plan. Evidence that meets the plan closes the Cleaning gate. Evidence that falls short puts the server under a recovery hold. @@ -7,8 +7,8 @@ CleaningPolicy Methods per media -Device discovery -Drives over Redfish +Drive inventory +Redfish and in-band MachineAllocation Pins policy and drives From 7a26dd73f3f8d8da83fe461c3cf6c6687df1b684 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 09:34:23 -0600 Subject: [PATCH 3/8] docs: Admit DisposeDrive without a hold and carry evidence reasons Define where a drive's disposal is recorded and when DisposeDrive is admitted, have the evidence check return the shortfall reason, and stop claiming the lab proves journaling today. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-cleaning/README.md | 58 +++++++++++++-------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md index 7603b9eb..69197644 100644 --- a/docs/enhancements/device-cleaning/README.md +++ b/docs/enhancements/device-cleaning/README.md @@ -92,8 +92,14 @@ assurance levels. It changes these parts of that design: - **[Operations](../device-operations/README.md#operations):** `DeviceWipe` carries a [cleaning plan](#planning-a-release) instead of a policy digest and target disks, and its deadline comes from the plan. -- **[Unknown outcomes](../device-operations/README.md#unknown-outcomes):** - `DeviceRecovery` gains a `DisposeDrive` decision. +- **[Operations](../device-operations/README.md#operations):** + `DeviceInstallation` target disks resolve through the [pinned + manifest](#pinning-at-allocation). +- **[Operations](../device-operations/README.md#operations) and + [admission](../device-operations/README.md#admission):** `DeviceRecovery` + gains a `DisposeDrive` decision, admitted for a `Release` holder without a + recovery hold. A `Release` holder in custody records disposed drives. See + [Planning a release](#planning-a-release). - **[Capacity status](../device-operations/README.md#capacity-status):** `Available` adds the [cleaning check](#capacity-status). @@ -140,7 +146,7 @@ spec: verify: {mode: Canary, samples: 64} timePerTiB: 3h # The drive models and firmware that passed hardware qualification, and the - # methods each passed. Required for every Purge method. + # methods each passed. A Purge method runs only on a qualified drive. qualified: - {model: EXAMPLE-NVME-3840, firmware: [EX1.2, EX1.3], methods: [CryptographicErase, BlockErase], alwaysEncrypts: true} @@ -217,7 +223,7 @@ digest, the SHA-256 of its canonical spec, and copies into the allocation: The allocator names drives `disk-0`, `disk-1`, and so on, at pin time. Names stay fixed for the allocation, and installations resolve target disks through the manifest. Allocation refuses a server that is not -[covered](#capacity-status). Later changes to the policy or discovery do not +[covered](#capacity-status), with reason `CleaningUncovered`. Later changes to the policy or discovery do not change the pin. ### Planning a release @@ -228,18 +234,24 @@ controller uses it to create a wipe, and admission uses it to check one. - Every manifest drive gets a step. Its methods are the rule's methods that are qualified for the drive, or all of them for a Clear rule. - A drive that discovery reports now and the manifest lacks also gets a step, - planned with the pinned policy. The customer could have written to it. + planned with the pinned policy and named with the next free `disk-N`. The + customer could have written to it. - A manifest drive that discovery no longer reports blocks the plan, with reason `DriveMissing`. - A drive with no planned method blocks the plan, with reason `DriveUncovered`. -A blocked plan creates no wipe. The release controller records the reason in -the allocation's status, and the `Cleaning` gate stays open. Staff can record -the disposal of a missing drive with a `DeviceRecovery` decision -`DisposeDrive`, which names the drive and how it was destroyed or removed. The -planner then omits that drive. Replacing a drive does not settle the missing -one. +A blocked plan creates no wipe, and the `Cleaning` gate stays open. The +release controller, which already writes the allocation's release status, +records the reason there. + +Staff settle a missing drive with a `DeviceRecovery` decision `DisposeDrive`. +It names the drive and how it was destroyed or removed, with a reference. +Admission accepts it only when the holder is `Release`, no operation is active, +and the drive is in the manifest but absent from current discovery. No recovery +hold is needed. The coordinator records the disposal in custody with the +holder, and the planner omits that drive. The record ends when the holder +leaves `Release`. Replacing a drive does not settle the missing one. The `DeviceWipe` carries the plan: @@ -282,14 +294,16 @@ today, and ejects every BMC virtual media. It then boots the pinned wipe environment over the network once. The boot server refuses a second boot under the same admission, so the environment never runs twice for one wipe. -Before it changes anything, the wipe environment: +Before it erases anything, the wipe environment: 1. lists every block device, NVMe controller, and namespace; 2. matches each drive to a planned drive by serial number, model, and firmware; -3. restores a host-protected area that shrank a drive; and +3. restores a host-protected area that shrank a drive, the only change it + makes before erasing; and 4. stops with reason `MediaMismatch` if a planned drive is missing, an - unplanned device exists, or a drive's size still differs from the plan. + unplanned device exists, a device configuration overlay hides capacity, or + a drive's size still differs from the plan. For NVMe, a Sanitize covers the whole controller. Before a `Format` or `Overwrite`, the environment deletes every namespace and creates one that spans @@ -350,8 +364,9 @@ Evidence never carries data read from a drive. The coordinator, not the site, decides whether a wipe succeeded. It accepts a `Succeeded` result only when every planned drive has an entry with the planned identity, a method from its planned list, a completed erase, and a passed check. -It derives each method's assurance itself. A result that falls short ends -`OutcomeUnknown` with one of these reasons, and the server gets a recovery hold: +It derives each method's assurance itself. The kind's evidence check returns +one of these reasons, the coordinator records it, and the result ends +`OutcomeUnknown` with a recovery hold: | Reason | Meaning | | --- | --- | @@ -374,8 +389,7 @@ server reports reason `CleaningUncovered`. ### What the lab proves The lab runs virtual machines behind the DMTF Redfish Interface Emulator. -Today it proves only `Overwrite` with `Full` verification on one virtual disk, -and the journaling and recovery around it. +Today it proves only `Overwrite` with `Full` verification on one virtual disk. With this work, the lab adapter reports drives with serial numbers, models, and firmware, and the lab machines get emulated NVMe drives. The lab can then also @@ -383,8 +397,9 @@ prove: - drive inventory, the manifest, planning, and blocked plans; - matching drives by serial number, and refusing a missing or extra drive; -- the evidence check and every shortfall reason; and -- falling back when a drive refuses a method. +- the evidence check and every shortfall reason; +- falling back when a drive refuses a method; and +- step journaling, and that a stopped wipe is never booted again. Whether the emulated NVMe drive implements `Format` and Sanitize must be checked before the lab claims either. @@ -399,7 +414,8 @@ policy lists for it. Record these decisions before implementation: - Who approves a hardware qualification, and where its results live. -- Who can record `DisposeDrive`, and whether a second person must confirm it. +- Who can record `DisposeDrive`, whether a second person must confirm it, and + whether admitting it without a recovery hold is acceptable. - Which roles can create a CleaningPolicy. ### Acceptance tests From 939d931f9058fc24bae8340867ccd929f7cece74 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 11:13:27 -0600 Subject: [PATCH 4/8] docs: Require a recovery hold before DisposeDrive A person chose the safer default: DisposeDrive is admitted only under a recovery hold. A wipe that cannot clean a missing or uncovered drive now ends OutcomeUnknown at admission without being delivered, which gives that hold. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-cleaning/README.md | 61 +++++++++++---------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md index 69197644..883f7b74 100644 --- a/docs/enhancements/device-cleaning/README.md +++ b/docs/enhancements/device-cleaning/README.md @@ -95,11 +95,11 @@ assurance levels. It changes these parts of that design: - **[Operations](../device-operations/README.md#operations):** `DeviceInstallation` target disks resolve through the [pinned manifest](#pinning-at-allocation). -- **[Operations](../device-operations/README.md#operations) and - [admission](../device-operations/README.md#admission):** `DeviceRecovery` - gains a `DisposeDrive` decision, admitted for a `Release` holder without a - recovery hold. A `Release` holder in custody records disposed drives. See - [Planning a release](#planning-a-release). +- **[Unknown outcomes](../device-operations/README.md#unknown-outcomes):** + the coordinator ends a wipe that cannot clean a drive `OutcomeUnknown` + without delivering it. `DeviceRecovery` gains a `DisposeDrive` decision that + settles that hold, and a `Release` holder in custody records disposed drives. + See [Planning a release](#planning-a-release). - **[Capacity status](../device-operations/README.md#capacity-status):** `Available` adds the [cleaning check](#capacity-status). @@ -223,8 +223,8 @@ digest, the SHA-256 of its canonical spec, and copies into the allocation: The allocator names drives `disk-0`, `disk-1`, and so on, at pin time. Names stay fixed for the allocation, and installations resolve target disks through the manifest. Allocation refuses a server that is not -[covered](#capacity-status), with reason `CleaningUncovered`. Later changes to the policy or discovery do not -change the pin. +[covered](#capacity-status), with reason `CleaningUncovered`. Later changes to +the policy or discovery do not change the pin. ### Planning a release @@ -236,22 +236,24 @@ controller uses it to create a wipe, and admission uses it to check one. - A drive that discovery reports now and the manifest lacks also gets a step, planned with the pinned policy and named with the next free `disk-N`. The customer could have written to it. -- A manifest drive that discovery no longer reports blocks the plan, with - reason `DriveMissing`. -- A drive with no planned method blocks the plan, with reason - `DriveUncovered`. - -A blocked plan creates no wipe, and the `Cleaning` gate stays open. The -release controller, which already writes the allocation's release status, -records the reason there. - -Staff settle a missing drive with a `DeviceRecovery` decision `DisposeDrive`. -It names the drive and how it was destroyed or removed, with a reference. -Admission accepts it only when the holder is `Release`, no operation is active, -and the drive is in the manifest but absent from current discovery. No recovery -hold is needed. The coordinator records the disposal in custody with the -holder, and the planner omits that drive. The record ends when the holder -leaves `Release`. Replacing a drive does not settle the missing one. +- A manifest drive that discovery no longer reports gets a step marked + `Missing`. +- A drive with no planned method gets a step marked `Uncovered`. + +Fleet cannot account for the data on a `Missing` or `Uncovered` drive. The +coordinator admits a wipe with such a step, sends nothing, and ends it +`OutcomeUnknown` with reason `DriveMissing` or `DriveUncovered`. The server +gets a recovery hold, and the `Cleaning` gate stays open. + +Staff settle that hold with a `DeviceRecovery` decision `DisposeDrive`. It names +the drive and how it was destroyed or removed, with a reference. Admission +accepts it only under that hold, and only for a drive the held wipe could not +clean and current discovery no longer reports, so an uncovered drive must be +pulled first. `DisposeDrive` clears the hold. The coordinator records the +disposal in custody with the `Release` holder, the planner omits the drive, and +the release controller plans the next step. The record ends when the holder +leaves `Release`. Replacing a drive does not settle the missing one. Staff can +also retire the server under the same hold. The `DeviceWipe` carries the plan: @@ -280,6 +282,8 @@ spec: rule: nvme-ssd methods: [CryptographicErase, BlockErase] verify: {mode: Canary, samples: 64} + # Set only for a drive the plan cannot clean: Missing or Uncovered. + # state: Missing ``` Admission checks that the plan equals the planner's output, as a check of the @@ -395,7 +399,7 @@ With this work, the lab adapter reports drives with serial numbers, models, and firmware, and the lab machines get emulated NVMe drives. The lab can then also prove: -- drive inventory, the manifest, planning, and blocked plans; +- drive inventory, the manifest, planning, and missing or uncovered drives; - matching drives by serial number, and refusing a missing or extra drive; - the evidence check and every shortfall reason; - falling back when a drive refuses a method; and @@ -414,8 +418,7 @@ policy lists for it. Record these decisions before implementation: - Who approves a hardware qualification, and where its results live. -- Who can record `DisposeDrive`, whether a second person must confirm it, and - whether admitting it without a recovery hold is acceptable. +- Who can record `DisposeDrive`, and whether a second person must confirm it. - Which roles can create a CleaningPolicy. ### Acceptance tests @@ -427,8 +430,8 @@ These tests are required and not implemented: the policy is deleted. - Allocation refuses a server with a drive no rule covers, or a drive only one inventory source reports. -- A drive is removed during an allocation. Release blocks with `DriveMissing` - until staff record `DisposeDrive`. +- A drive is removed during an allocation. Release holds the server with + `DriveMissing` until staff record `DisposeDrive` under that hold. - The wipe environment finds an unplanned device and stops before erasing. - A drive refuses its first method, and the next method's evidence closes the gate. @@ -448,7 +451,7 @@ Capacity without a policy is not `Available`. Releases always use their pins. ### What must operators monitor? -Blocked plans, recovery holds from wipes, wipe duration per drive model, and +Recovery holds from wipes, wipe duration per drive model, and uncovered capacity. ### Does the feature add API types or calls? From 66a724de9424d493df51fbcd736b79a75b16eca6 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 11:14:36 -0600 Subject: [PATCH 5/8] docs: Name the phase change and refuse Retry for drive holds State that a wipe with a missing or uncovered drive goes from Admitted to OutcomeUnknown with nothing sent, that Retry cannot settle that hold, and that the next wipe takes the next step number. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-cleaning/README.md | 30 ++++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md index 883f7b74..15b479c0 100644 --- a/docs/enhancements/device-cleaning/README.md +++ b/docs/enhancements/device-cleaning/README.md @@ -95,11 +95,14 @@ assurance levels. It changes these parts of that design: - **[Operations](../device-operations/README.md#operations):** `DeviceInstallation` target disks resolve through the [pinned manifest](#pinning-at-allocation). +- **[Operation phases](../device-operations/README.md#operations):** a wipe + with a `Missing` or `Uncovered` step moves from `Admitted` to + `OutcomeUnknown` with nothing sent. The data on that drive is unaccounted + for, which is an outcome Fleet cannot prove. - **[Unknown outcomes](../device-operations/README.md#unknown-outcomes):** - the coordinator ends a wipe that cannot clean a drive `OutcomeUnknown` - without delivering it. `DeviceRecovery` gains a `DisposeDrive` decision that - settles that hold, and a `Release` holder in custody records disposed drives. - See [Planning a release](#planning-a-release). + such a hold is settled by a new `DeviceRecovery` decision, `DisposeDrive`, + not by `Retry`. A `Release` holder in custody records disposed drives. See + [Planning a release](#planning-a-release). - **[Capacity status](../device-operations/README.md#capacity-status):** `Available` adds the [cleaning check](#capacity-status). @@ -249,11 +252,12 @@ Staff settle that hold with a `DeviceRecovery` decision `DisposeDrive`. It names the drive and how it was destroyed or removed, with a reference. Admission accepts it only under that hold, and only for a drive the held wipe could not clean and current discovery no longer reports, so an uncovered drive must be -pulled first. `DisposeDrive` clears the hold. The coordinator records the -disposal in custody with the `Release` holder, the planner omits the drive, and -the release controller plans the next step. The record ends when the holder -leaves `Release`. Replacing a drive does not settle the missing one. Staff can -also retire the server under the same hold. +pulled first. Admission refuses `Retry` for this hold, because a retried wipe +would plan the same step. `DisposeDrive` clears the hold. The coordinator +records the disposal in custody with the `Release` holder, the planner omits +the drive, and the release controller plans the next wipe with the next step +number. The record ends when the holder leaves `Release`. Replacing a drive +does not settle the missing one. The `DeviceWipe` carries the plan: @@ -282,8 +286,14 @@ spec: rule: nvme-ssd methods: [CryptographicErase, BlockErase] verify: {mode: Canary, samples: 64} + - name: disk-1 + serial: EXAMPLE-SN-0002 + model: EXAMPLE-NVME-3840 + firmware: EX1.3 + protocol: NVMe + capacityBytes: 3840755982336 # Set only for a drive the plan cannot clean: Missing or Uncovered. - # state: Missing + state: Missing ``` Admission checks that the plan equals the planner's output, as a check of the From 05c54fd1445d6522fefe4b6bcaa94da10cac5506 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 14:33:01 -0600 Subject: [PATCH 6/8] docs: Record the cleaning grace and who records DisposeDrive A person decided both: a drive waits a fixed 10 minutes before it holds the server, and a single recovery operator may record DisposeDrive. Also mark the dedicated CleaningPolicy role as decided. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-cleaning/README.md | 28 ++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md index 15b479c0..0b14815f 100644 --- a/docs/enhancements/device-cleaning/README.md +++ b/docs/enhancements/device-cleaning/README.md @@ -244,12 +244,17 @@ controller uses it to create a wipe, and admission uses it to check one. - A drive with no planned method gets a step marked `Uncovered`. Fleet cannot account for the data on a `Missing` or `Uncovered` drive. The -coordinator admits a wipe with such a step, sends nothing, and ends it -`OutcomeUnknown` with reason `DriveMissing` or `DriveUncovered`. The server -gets a recovery hold, and the `Cleaning` gate stays open. - -Staff settle that hold with a `DeviceRecovery` decision `DisposeDrive`. It names -the drive and how it was destroyed or removed, with a reference. Admission +release controller waits 10 minutes for discovery to report the drive again, +so a brief gap in discovery does not hold the server. The wait is fixed, not a +policy setting, and each blocked plan gets its own. If the drive is still +`Missing` or `Uncovered`, the release controller creates the wipe. The +coordinator admits it, sends nothing, and ends it `OutcomeUnknown` with reason +`DriveMissing` or `DriveUncovered`. The server gets a recovery hold, and the +`Cleaning` gate stays open. + +A recovery operator settles that hold with a `DeviceRecovery` decision +`DisposeDrive`. One operator may record it; no second person confirms it. It +names the drive and how it was destroyed or removed, with a reference. Admission accepts it only under that hold, and only for a drive the held wipe could not clean and current discovery no longer reports, so an uncovered drive must be pulled first. Admission refuses `Retry` for this hold, because a retried wipe @@ -425,11 +430,16 @@ policy lists for it. ### Implementation decisions -Record these decisions before implementation: +Decided: + +- A dedicated provider role creates CleaningPolicies, separate from staff + viewer roles. +- A single recovery operator may record `DisposeDrive`. +- A drive waits a fixed 10 minutes before it holds the server. + +Record this decision before implementation: - Who approves a hardware qualification, and where its results live. -- Who can record `DisposeDrive`, and whether a second person must confirm it. -- Which roles can create a CleaningPolicy. ### Acceptance tests From 61edaf6312f4ac6349dc1138ebc6e4d71176e670 Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 14:33:47 -0600 Subject: [PATCH 7/8] docs: Say what the cleaning wait covers and test it An uncovered drive is already in discovery, so the wait is for the plan to cover every drive again, and it starts again after each hold is settled. The acceptance tests now name the recovery operator and cover a drive that returns within the wait. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-cleaning/README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md index 0b14815f..a4c87ced 100644 --- a/docs/enhancements/device-cleaning/README.md +++ b/docs/enhancements/device-cleaning/README.md @@ -244,10 +244,11 @@ controller uses it to create a wipe, and admission uses it to check one. - A drive with no planned method gets a step marked `Uncovered`. Fleet cannot account for the data on a `Missing` or `Uncovered` drive. The -release controller waits 10 minutes for discovery to report the drive again, +release controller waits 10 minutes for the plan to cover every drive again, so a brief gap in discovery does not hold the server. The wait is fixed, not a -policy setting, and each blocked plan gets its own. If the drive is still -`Missing` or `Uncovered`, the release controller creates the wipe. The +policy setting, and it starts again after each hold is settled. If a drive is +still `Missing` or `Uncovered` when it ends, the release controller creates the +wipe. The coordinator admits it, sends nothing, and ends it `OutcomeUnknown` with reason `DriveMissing` or `DriveUncovered`. The server gets a recovery hold, and the `Cleaning` gate stays open. @@ -450,8 +451,11 @@ These tests are required and not implemented: the policy is deleted. - Allocation refuses a server with a drive no rule covers, or a drive only one inventory source reports. -- A drive is removed during an allocation. Release holds the server with - `DriveMissing` until staff record `DisposeDrive` under that hold. +- A drive is removed during an allocation. Release waits 10 minutes, then + holds the server with `DriveMissing` until a recovery operator records + `DisposeDrive` under that hold. +- A drive is missing from discovery for less than 10 minutes, and release + wipes it without holding the server. - The wipe environment finds an unplanned device and stops before erasing. - A drive refuses its first method, and the next method's evidence closes the gate. From b485b254fefbaa0bab19168aeca94646f4b4b50f Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Wed, 25 Nov 2026 16:11:53 -0600 Subject: [PATCH 8/8] docs: Pin cleaning policies by generation and digest, not UID No spec holds an object UID. The allocation pins its policy's name, generation, digest and a copy of the spec, so a policy recreated under the same name changes no pin, and the DeviceWipe example drops the policy and Device UIDs. Co-Authored-By: Claude Opus 5.5 --- docs/enhancements/device-cleaning/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/enhancements/device-cleaning/README.md b/docs/enhancements/device-cleaning/README.md index a4c87ced..08a3034f 100644 --- a/docs/enhancements/device-cleaning/README.md +++ b/docs/enhancements/device-cleaning/README.md @@ -220,14 +220,16 @@ create and delete namespaces. When it creates a MachineAllocation, the allocator computes the policy's digest, the SHA-256 of its canonical spec, and copies into the allocation: -- the policy's name, UID, digest, and spec; and +- the policy's name, generation, digest, and spec; and - the media manifest: each drive's name, identity, capacity, and matching rule. The allocator names drives `disk-0`, `disk-1`, and so on, at pin time. Names stay fixed for the allocation, and installations resolve target disks through the manifest. Allocation refuses a server that is not [covered](#capacity-status), with reason `CleaningUncovered`. Later changes to -the policy or discovery do not change the pin. +the policy or discovery do not change the pin, and neither does a policy +deleted and recreated under the same name: the copy and digest pin the +content, so no spec holds the policy's UID. ### Planning a release @@ -275,12 +277,11 @@ metadata: namespace: default spec: creator: system:serviceaccount:fleet-system:release-controller - deviceRef: {name: server-example-001, uid: 6f1c0b52-1d7e-4a35-9e0b-2c41f7a0d9e3} + deviceRef: {name: server-example-001} authority: allocationRef: {name: alloc-3b9d61c2} step: 1 - policy: {name: tenant-reuse-v1, uid: 0d6e3b9a-52c1-4f7e-a8d0-3c9b1e5f7a24, - digest: "sha256:5b1e0c7d9a3f..."} + policy: {name: tenant-reuse-v1, generation: 1, digest: "sha256:5b1e0c7d9a3f..."} assurance: Purge drives: - name: disk-0