diff --git a/README.md b/README.md index 778018b3..d86103a4 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,9 @@ today. Then choose a topic: The [Bare Metal CLI enhancement](docs/enhancements/metal-cli/README.md) proposes `datumctl metal` discovery, machine management, and safe recovery workflows. +The [boot network enhancement](docs/enhancements/boot-network/README.md) +proposes DHCP reservations that exist only while a machine's network boot is +admitted. Contributors should also read the [repository guidance](AGENTS.md) and [implementation roadmap](docs/development/roadmap.md). diff --git a/docs/enhancements/boot-network/README.md b/docs/enhancements/boot-network/README.md new file mode 100644 index 00000000..7e5dbb09 --- /dev/null +++ b/docs/enhancements/boot-network/README.md @@ -0,0 +1,415 @@ +--- +status: provisional +stage: alpha +--- + +# Boot network reservations + +## Summary + +A machine needs a provisioning address while Fleet installs or wipes it. Fleet +claims one address from IPAM for each network-booting installation or wipe, +retains it in that operation's immutable inputs, and publishes a DHCP reservation +only while its boot admission is open. The network owner's synchronizer applies +the reservation and reports what each DHCP instance serves. Fleet gates boot on +served evidence and success on withdrawal evidence; uncertain results keep the +operation and its address under recovery control. + +The selected topology hosts DHCP and boot files centrally, reached through site +router relays and routed connectivity. No provisioning appliance runs in a cell +or at a physical site. A “site” worker, journal or feed describes logical +responsibility for that site's Devices, not a requirement to host those services +there. Central hosting must preserve that responsibility and its durable state. + +This enhancement complements the [PXE installation enhancement][pxe]. It defines provisioning-address +and DHCP evidence contracts, not installation authorization or a new consumer +network authority. The [server networking proposal][networking] extends the +network-owner handoff; its planned physical attachment must not be confused +with the direct IPAM source already in Fleet. + +## Implementation and rollout status + +The implementation statements below are pinned to Fleet +[`fd0f33f7a740871850b97abc190e28f6f71a3477`][implementation], reviewed on +2026-11-29. They supersede this enhancement's earlier fixed enrollment-address +model. Code, synthetic tests, deployment configuration, and verified operation +are separate milestones. + +| Area | Status at the reviewed revision | +| --- | --- | +| Per-operation IPAM claims, admission validation and recovery retention | Implemented, with unit and allocator/API-server tests. | +| Canonical reservation feed, authenticated per-instance reports and served/withdrawn gates | Implemented and tested with synthetic workers and DHCP reports. | +| Kea synchronizer and central service packaging | Implemented; fake control-socket tests and a real-Kea lab cover reservation-gated answers. These do not prove WAN relay or hardware acceptance. | +| Static central Kea rollout | Separate infrastructure milestone. Static reservations provide neither operation-scoped IPAM claims nor synchronized withdrawal evidence. A merged rollout change is not proof of runtime readiness. | +| Conversion of static central Kea to a synchronizer sidecar and IPAM claims | Later infrastructure follow-up; not established as deployed by the Fleet code or static rollout. | +| Central UEFI HTTP loader delivery and firmware boot-URL selection | Selected direction, not a completed path in this revision. The current Redfish network-boot phases arm `Pxe` and the boot service serves iPXE scripts, not an EFI loader. | +| NSO physical boot attachment | Optional source code exists, off by default, against an assumed NSO contract and test realizer. Real port isolation and handoff remain dependencies. | + +Environment-specific rollout evidence belongs in operational records, not this +public proposal. The pinned [operations guide][operations] records implementation +coverage and gaps; its topology descriptions are not deployment attestations. + +## Motivation + +Independent static DHCP cannot tell an admitted installation from a stray reboot +or supply proof that provisioning access ended. Having Fleet configure switches +or DHCP directly would introduce a second writer. Querying Fleet on every DHCP +request would couple firmware response times to Fleet API availability. + +Instead, the network owner applies a complete desired reservation feed and +returns durable evidence. Provisioning addresses remain separate from consumer +addresses, so ending boot access cannot release an address the consumer still +uses. Standalone and managed consumers use the same allocation and installation +contracts; a managed node does not receive separate boot authority. + +### Goals + +- Claim a provisioning address for each installation or wipe that needs one. +- Keep networking, IPAM, routing and DHCP configuration with their owners. +- Require attributable served and withdrawn evidence for synchronized boot. +- Retain authority, exact inputs and uncertain outcomes through recovery. +- Host DHCP and boot files centrally without a provisioning appliance per site. + +### Non-goals + +- Allocating consumer Machine addresses or changing their lifecycle. +- Configuring switch ports, relays, VLANs or routing from Fleet. +- Treating a MAC, inventory import or enrollment as installation authorization. +- Replacing the PXE contract's boot admission, completion or release gates. +- Claiming every supported legacy boot mode uses UEFI HTTP boot today. + +## Proposal + +### Physical and consumer addresses + +| Address | Identity and lifetime | Authority | +| --- | --- | --- | +| BMC endpoint | Physical asset's management identity | Networking/IPAM and inventory observations | +| Boot address | One installation or wipe; held through any unresolved recovery obligation | IPAM assigns; Fleet requests and publishes the admitted address | +| Underlay addresses and routing peers | Physical host on the fabric | Networking/IPAM and Galactic | +| Consumer Machine interfaces | MachineAllocation through release | Networking/IPAM through the consumer attachment contract | + +A boot claim does not become a permanent inventory address. Device, allocation, +installation and managed NodeClaim identities remain distinct. The boot NIC MAC +comes from Device inventory and is pinned in the admission snapshot. Boot and +consumer addresses must be separate even if a future network-owner handoff uses +the same physical NIC. Dedicated versus shared NIC policy belongs to the server +networking design; sharing requires proven isolation and port transitions. + +### Ownership and hosting + +| Surface | Authoritative writer | +| --- | --- | +| Operation authority and immutable boot inputs | Fleet admission and custody | +| Desired boot reservations | Fleet, derived from retained site boot admissions | +| Address allocation | IPAM; Fleet writes claims, not allocations | +| DHCP configuration | Network owner's synchronizer, combining its base with Fleet's feed | +| Subnet, gateway, relay, VLAN, switch and routing policy | Their networking owners | +| Boot artifact selection and admission | Fleet's selected installation executor | + +The synchronizer runs beside each central Kea instance and pulls the feed over +TLS. Fleet workers do not hold DHCP administration credentials. Network +operations owns the base configuration and relay policy. Logical site services +can be hosted centrally without moving network authority into Fleet or adding +an appliance at the physical site. + +### Address claim lifecycle + +When configured with a provisioning class, the installation requester creates +an IPAM `IPClaim` before its `DeviceInstallation`; the release requester does +the same before its `DeviceWipe`. The default configuration claims no boot +address. Each claim: + +- lives in the provider project's operation namespace; +- is named `-boot` and labeled with allocation, operation and kind; +- requests IPv4, prefix length 32, the configured provisioning class and scope + (normally the site's location), and `reclaimPolicy: Delete`; +- supplies a typed group/kind/name reference and a bound host address to + `spec.bootNetwork`, with no UID, gateway or subnet prefix in that input. + +Synthetic operation fragment, not a complete resource: + +```yaml +spec: + bootInterface: primary + bootNetwork: + addressClaim: + apiGroup: ipam.miloapis.com + kind: IPClaim + name: example-install-1-boot + address: 198.51.100.10 +``` + +The requester reads an existing claim on retry, including a create conflict, +checks its allocation/operation/kind labels and stored Delete policy, and reads +its bound IPv4 address. It does not require the stored class or scope to equal +the original request: IPAM resolves the class. Exhaustion or refusal creates no +operation. A crash between claim and operation leaves the claim for the same +requester to recover; absence of the operation is not permission to release it. + +Admission dispatches validation by claim group/kind. For IPAM it requires the +operation-derived reference, operation and kind labels, a non-deleting Bound +claim, stored Delete policy, and exactly the admitted address. Both creation +timestamps must exist and the claim must be no newer than the operation. This +rejects a claim recreated after its operation; it is a name/label/timestamp +contract, not UID pinning or a general atomic check against concurrent mutation. +Requester and admission checks are deliberately described separately: admission +checks operation/kind labels, not the allocation label. Claim-write permissions +must protect these identities. + +An unreadable claim keeps admission Pending (`BootAddressUnavailable`). A +missing, rebound, invalid or later-recreated claim fails admission +(`BootAddressClaimMismatch`); an unregistered claim kind fails with +`UnsupportedBootAddressClaim`. Missing inventory MAC information fails with +`BootInterfaceUnknown`. The operation retains the exact address and snapshot; +subsequent inventory or policy edits cannot reinterpret admitted work. + +Each requester releases only its own operation kind's claims. An ended +operation's claim remains if custody's recovery hold names it or names it as the +original of a held retry. The allocator reads custody after the operation so it +cannot miss a hold written before `OutcomeUnknown`. Remaining claims are +collected when the allocation is released. Release is verified only when the +claim is absent and no `IPAllocation` in the namespace names it. Failed reads, +failed deletes or lingering allocations keep release unverified. + +This follows IPAM's transactional Delete-policy contract. IPAM ignores delete +preconditions; Fleet relies on the claim name and labels rather than a UID +precondition. Retaining claims are refused. A lost delete response is recovered +by reading claim and allocation state, never by assuming success. + +### Address source limitations + +The source seam orders attach, claim and operation creation; release orders +address release then detach and requires both verified. The default IPAM +source's attach/detach are no-ops: the network owner must already provide the +provisioning attachment. A successful no-op is not evidence of a switch change. + +The optional NSO source and claim-kind checker do not establish a deployed +physical realizer. They depend on the server networking proposal's isolation +and attachment contract. Source changes must retain the old sources and checks +until their existing claims are released; they cannot abandon held addresses. + +The separate `config/components/boot-addresses` roles grant requesters claim +create/get/list/delete and allocation get/list, and admission checkers claim +get. No overlay at this revision includes the component. Operators must enable +and bind it explicitly; ordinary operation roles do not confer IPAM authority. + +## Design details + +### Enrollment and DHCP modes + +Enrollment maps Devices to BMC endpoints and Redfish System IDs/UUIDs, and +contains execution details. A System ID is unique only within its BMC. Current +enrollment contains neither boot MACs nor boot addresses. + +- **static:** DHCP is managed independently; the site refuses operations with a + boot address (`BootNetworkUnsupported`) and requires no synchronized evidence. +- **synced:** network boot requires a boot address (`BootNetworkRequired`) and a + non-empty, duplicate-free `dhcpInstances` set of stable instance names. + +The expected set enumerates every DHCP instance that may serve the site. Workers +and feed use the same enrollment. Static mode must not declare that set. Changing +mode is a controlled migration of retained state and in-flight work, not a way +to erase withdrawal obligations. + +### Reservation feed and applied reports + +The [feed contract][feed-source] carries only canonical MAC, host address and +expiry per reservation. Subnet prefix, gateway and boot options belong to the +DHCP owner's base configuration. A reservation exists while its retained boot +admission is unclosed, unexpired and at the Device's current stored fence. + +Reservations are sorted by MAC, unique by MAC and address, with normalized +addresses and UTC whole-second expiry. The revision is SHA-256 of the canonical +reservation JSON. `issued` is a UTC whole-second timestamp read before deriving +the feed and is outside the revision. A matching digest proves consistency, not +that a DHCP server actually applied anything. + +`GET /dhcp/v1/reservations` requires the expected instance's name in +`X-Fleet-DHCP-Instance`. `POST /dhcp/v1/applied` carries that instance and the +exact feed. The TLS listener is separate from firmware delivery and requires a +bearer token of at least 32 characters without whitespace. Reports must be +canonical, contain no unknown fields, and echo a revision and issue time among +the last 32 feeds issued to that same instance. A feed-server restart requires +a new fetch before reporting; issued-feed memory is not durable. + +Accepted reports are appended and synced before acknowledgment. Unreadable +retained evidence is corruption, never proof of serving or withdrawal. Instance +names are evidence identifiers, not separately authenticated identities: the +site token is shared trust in its synchronizers, which could falsify reports if +compromised. + +### Evidence gates + +1. **Before the initial network-boot power-on**, some expected instance must report the exact + MAC/address pair, with the report accepted after creation of this boot + admission. An older accepted report does not satisfy the gate. Expiry while + waiting leaves an unknown outcome. Power-off and the one-time `Pxe` boot + override precede this gate; it does not prevent those hardware effects. + Recovery skips this gate when the power-on is journaled done. An outstanding + power-on intent still passes through admission and served-evidence checks; + if recovery reaches that step, it observes the prior attempt rather than + resending it. +2. **Before success**, some expected instance must have served that pair during + this operation. Every expected instance's latest report must echo a feed + issued strictly after publication of the admission, containing neither any + MAC nor any address ever published for this Device. This covers earlier held + reservations as well as the current one. + +The second gate includes an instance that never reported or fetched the +reservation but crashed before reporting. Silence cannot prove withdrawal. +After the ten-minute withdrawal wait expires the outcome remains unknown; +recovery waits again. Publishing a reservation is journaled before storing the +admission, so subsequent failure cannot become an ordinary terminal Failed that +would permit premature address release. + +The proof depends on a common clock for publication and feed issue times. The +current shared site-state volume is ReadWriteOnce; moving workers and feed to +different nodes requires clock guarantees, not just central placement. + +### DHCP synchronizer + +The [synchronizer][sync-source] validates each feed and places each IPv4 address +into exactly one containing base subnet. No matching subnet or multiple matches +fail the cycle; reservations are never silently dropped. Kea receives a +`config-set` on revision change or detected process restart. Reports follow only +successful application. An unchanged revision is reported again with a fresh +issue time, by default every 30 seconds, so an instance that missed a boot +window can still establish withdrawal. + +A failed fetch or apply leaves the last configuration in place. Expiry removes a +reservation from subsequent feeds; it is not an autonomous DHCP revocation +timer. Kea restart reapplication is supported, but no general “failure always +stops serving” claim follows. The network owner's base must exclude competing +static reservations and dynamic pools for managed boot addresses; the +synchronizer appends reservations and does not audit away conflicting base +policy. Only one writer may mutate the live configuration. + +### Retiring an instance + +Stable names survive restarts. Retirement requires first establishing that the +instance can no longer answer, then removing it from the expected set and +restarting workers and feed with consistent enrollment. Removing a name alone +does not fence a server. Old retirement log entries are not withdrawal evidence. + +Authenticated contacts from an instance outside the expected set are refused +and retained with a 30-second per-name rate limit. Contacts retained at or after +publication block withdrawal; a 45-second quiet bound assumes polling no slower +than 15 seconds. This is not a mechanism that clears old blocking contacts merely +by waiting. A removed replica whose synchronizer has stopped while Kea still +serves cannot be detected by polling. Operator fencing and recovery remain +necessary, and lost-instance handling is a production qualification concern. + +### What firmware boots + +The selected central topology uses UEFI HTTP boot for boot-file delivery across +the routed site connection. DHCP relays carry DHCP traffic; firmware reaches the +central HTTP service through normal routing. This is a deployment target, not a +claim that the reviewed worker already implements it. + +At the pinned revision, [network-boot phases][phases-source] use `Pxe`. +[Redfish SetBootOnce][redfish-source] sets the override target and `Once`, then +reads back; it does not set `HttpBootUri`. The [boot listener][boot-source] serves +an iPXE chain script and admitted installer artifacts, not a UEFI EFI loader. +Legacy static/iPXE lab paths therefore remain valid existing modes; hardware +without HTTP boot is not universally rejected by the current code. + +The central HTTP path must qualify loader delivery and one-time boot selection: +a supported Redfish `HttpBootUri`/`UefiHttp` path, or network-owner DHCP boot-file +options that identify a non-secret loader. The current feed contains no boot +URL. An illustrative HTTP-boot class in base configuration does not prove that +its loader exists or firmware can boot it. Operation capabilities must remain +scoped and must not become generic DHCP options. Firmware trust, HTTPS/CA +provisioning and integrity over any private HTTP path need explicit qualification. + +### Release, recovery and security + +Withdrawal of DHCP reservations is necessary evidence for synchronized boot, +not proof that all packets, leases, sessions or executors are fenced. The PXE +and machine lifecycle contracts retain their independent admission, executor, +network handoff and cleanup requirements. Unknown execution, cleanup or +verification retains custody and claims; expiration, inventory import or record +deletion cannot manufacture readiness or expose occupied capacity. + +Recovery resumes retained operation authority and exact inputs rather than +starting a new effect after a timeout. Relays, restricted provisioning routing, +server isolation and spoofing protection remain network-owner requirements. +MACs route requests and do not authenticate hardware. Credentials, rendered +secret-bearing configuration and capability URLs stay out of Git and ordinary +status; report logs contain reservation evidence, not bearer credentials. + +## Validation and production readiness + +Existing source tests cover claim retry/conflict, exhaustion, rebound and +recreated claims, unreadable IPAM, Delete policy, release verification and held +operations; feed canonicalization; containing-subnet placement and rejected Kea +writes; forged reports, feed restarts, expected-instance coverage, fresh unchanged +reports, historical Device reservations and refused contacts. These are contract +tests, not evidence that the selected central topology has passed hardware +acceptance. + +Before enabling synchronized DHCP in a deployment: + +- Prove relayed DHCP and routed central boot delivery on qualified firmware, + including any LACP fallback and switch isolation needed by the site. +- Convert the static Kea configuration to one authoritative synchronizer per + instance, with matching enrollment, TLS, stable identities and IPAM roles. +- Exercise installation and wipe with claims retained across uncertain outcomes, + silent replicas, lost responses, feed restart and recovery. +- Verify withdrawal on every expected instance and independent provisioning + fencing before reuse, including retirement when a synchronizer is stopped. +- Establish monitoring for claim age, IPAM refusal/outage, served/withdrawn gate + latency, rejected reports, synchronization failure and WAN/service loss. +- Preserve journal, admission history, reports and enrollment on upgrades; + establish report-log retention without discarding withdrawal evidence. + +## Drawbacks and alternatives + +Central DHCP and boot files add WAN and central-service dependencies to every +network boot. Retained claims and conservative withdrawal proofs can strand +capacity when an instance disappears; this is preferable to recycling an +address that may still be served. + +Static DHCP remains a rollout/legacy mode but supplies no synchronized proof. +Permanent per-asset addresses waste idle capacity and do not resolve unknown +execution. Direct Fleet writes to switches or DHCP violate single-writer +ownership. Per-site appliances avoid WAN dependence but are not the selected +topology. DHCP querying Fleet per packet would add request-path coupling. + +## Open design questions and follow-up + +- Qualify the central UEFI HTTP loader and firmware URL-selection path and its + transport trust; do not infer support from the `Pxe` worker. +- Complete the separate static-to-synchronized infrastructure rollout and + collect runtime evidence before calling it deployed. +- Establish robust retirement/fencing evidence for a permanently lost instance, + including a stopped synchronizer with a still-serving DHCP process. +- Finish the network owner's physical attachment and consumer handoff contract, + including dedicated/shared NIC choice, without introducing a second writer. +- Define credential rotation, evidence-log retention and cross-node clock + guarantees for centrally hosted logical site services. +- Add DHCPv6 only with matching address-source and DHCP support: the generic + feed accepts IPv6, while the default claim and Kea DHCPv4 synchronizer do not. + +## Reviewed sources + +The proposal began at [PR #87 revision `ba8c519`][original]. This update reads the +[pinned Fleet implementation][implementation], especially the [claim code][claim-source], +[DHCP evidence gates][gates-source], [feed contract][feed-source], +[synchronizer][sync-source] and [operations guide][operations]. The server +networking direction is reviewed at [revision `f68d0c8`][networking-source]; +future contracts in that proposal do not override verified code behavior here. + +[pxe]: https://github.com/datum-cloud/fleet/pull/59 +[networking]: https://github.com/datum-cloud/fleet/pull/186 +[original]: https://github.com/datum-cloud/fleet/blob/ba8c519a28efe2d1f1fdc1535b49131c4be27b75/docs/enhancements/boot-network/README.md +[implementation]: https://github.com/datum-cloud/fleet/tree/fd0f33f7a740871850b97abc190e28f6f71a3477 +[claim-source]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/internal/bootaddress/bootaddress.go +[feed-source]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/internal/bootnet/feed.go +[sync-source]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/internal/dhcpsync/sync.go +[gates-source]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/internal/site/redfishwork/dhcp.go +[phases-source]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/internal/site/redfishwork/kinds.go +[redfish-source]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/internal/redfish/client.go +[boot-source]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/internal/site/redfishwork/boot.go +[operations]: https://github.com/datum-cloud/fleet/blob/fd0f33f7a740871850b97abc190e28f6f71a3477/docs/operations/boot-network.md +[networking-source]: https://github.com/datum-cloud/fleet/blob/f68d0c8c24063c10ac00decced6e02dae9ece2c9/docs/enhancements/server-networking/README.md