Skip to content

feat: Attach boot NICs through NSO, off by default - #225

Open
scotwells wants to merge 17 commits into
feat/ipam-labfrom
feat/nso-boot-attachment
Open

scotwells wants to merge 17 commits into
feat/ipam-labfrom
feat/nso-boot-attachment

Conversation

@scotwells

@scotwells scotwells commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Fleet can now attach a server's boot NIC to a provider-owned NSO boot network and take its provisioning address from NSO, behind the same boot address seam as the direct IPAM claim, which stays the default. Each installation and wipe gets its own boot attachment claim, programmed before any address is read and released only once NSO reports the claim gone and IPAM holds nothing for it, and the allocation records each boot claim until its release is verified. Handing a shared boot NIC to the customer is one NSO step, and a port is never on the boot network and a customer network at once. Stacked on #218.

Related to #186

How it stays inactive

Nothing selects it: no binary, configuration, site setting or staging overlay constructs the NSO source, admission registers only IPAM's claim kind, and no lab mode uses it. A test pins that the default allocator creates no NSO claim.

Schema changes

An operation now names its address claim's API group and kind as well as its name, and the allocation gains an optional record of its boot claims. Only an operation that carries a boot address uses the first, and nothing gives one today, so no stored operation changes. The record is empty until an NSO source writes it.

Decisions for a person

  • The NSO API this needs does not exist yet. The physical mode, the attachment point, the boot attachment claim, the address on the claim, the verified release and the handover are assumptions, kept in one place and listed in the boot network doc.
  • Release verification checks only the IPAM claim names NSO is assumed to use; if NSO names them otherwise, a release would count as verified while IPAM still holds the address. A release whose address lingers also stops that release pass, and an existing boot claim is not compared with the attachment point inventory names now, so a recabled port keeps its old claim. All three must be fixed before any site enables this.
  • A requester moves a boot NIC only while custody holds the Device for its allocation and runs no other operation.
  • Nothing calls the shared-NIC handover yet, so attachment is dedicated-boot-NIC only until feat: Attach Machine interfaces through NSO on custody #198's customer attachment uses it. Pick the order with feat: Attach Machine interfaces through NSO on custody #198.
  • Before any environment selects this source: NSO's isolation of the boot network between servers proven, and a least-privilege role for boot attachment claims and the IPAM reads it makes, scoped to the boot network's namespace.

Test plan

  • Each guarantee tested against a real API server with a test realizer, each failing when its guard is removed
  • A port's membership through install, handover, held reinstall and release is never boot and customer at once, and no boot NIC moves while another operation runs or another allocation holds the Device
  • Every gh pr checks entry green on the head, including the multi-plane acceptance
  • A run against NSO's real physical mode, once it exists

🤖 Generated with Claude Code

@scotwells
scotwells requested review from ecv and kevwilliams November 26, 2026 03:49
@scotwells
scotwells force-pushed the feat/nso-boot-attachment branch from 7c067e4 to 98c6bf0 Compare November 28, 2026 23:51
@scotwells
scotwells force-pushed the feat/nso-boot-attachment branch from 98c6bf0 to b477627 Compare November 29, 2026 01:20
@scotwells
scotwells force-pushed the feat/nso-boot-attachment branch from b477627 to 056bb49 Compare November 29, 2026 02:04
@scotwells
scotwells force-pushed the feat/nso-boot-attachment branch from 056bb49 to 56e4070 Compare November 29, 2026 02:15
@scotwells scotwells added the multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners label Nov 29, 2026
@scotwells
scotwells marked this pull request as ready for review November 29, 2026 02:59
@scotwells
scotwells requested a review from a team as a code owner November 29, 2026 02:59
@ecv ecv mentioned this pull request Nov 29, 2026
3 of 4 tasks

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes.

When this source is enabled, Install attaches the boot NIC through NSO before custody admits the operation, and no test covers that ordering. Enabling it is the stated next step, so the ordering should be fixed and pinned first.

Boot NIC attachment through NSO is off by default as claimed: nothing outside tests constructs nso.BootAttachments or NewBootAttachmentCheck, admission registers only IPAM's claim kind, and TestTheDefaultAllocatorClaimsNoBootAddress now also asserts no NSO interface claim is created. The NSO side is explicitly assumed (assumed.go), so nothing is real until NSO ships it; the findings below must be settled before anything selects it.

  • Attach runs before custody admits anything. bootNetwork calls Attach inside Install/the wipe path "before the operation exists", gated only by the allocation being Active and the Device UID matching. Custody's holder, hold and active-operation checks run later at admission, so a second installation or wipe queued behind a running or held one would move the shared port onto the boot network first. The BootNIC guard covers the customer attach path, not this one. Gate Attach on custody (holder is this allocation, no hold, no other active operation) or add a test that proves the port stays put while another operation is active.
  • BootNIC and HandOver have no non-test caller (only nsoboot_test.go and verify_test.go), and the PR's own docs say the customer network attachment must call BootNIC. Until it does, selecting this source puts the boot NIC on the boot network while the customer attach adapter can still ask for the same port. Wire it, or make the NSO source refuse to construct until the customer path calls it.
  • Tenant isolation rests on NSO assumption 4 (a port on the boot network carries no other claim, and the boot network is isolated between servers). Fleet checks the network name, mode, labels, Device UID and exactly one cable record, but cannot enforce isolation itself; state in the docs that enabling needs NSO's isolation proven first.
  • No RBAC for NSO networkinterfaceclaims or for the IPAM reader the NSO source uses (IPAM, IPAMNamespace, Location) is added anywhere in config/, so the least-privilege grant is unreviewed. Add the role with the wiring, scoped to the boot network namespace, and without update/patch.
  • Release deletes with a UID precondition, which is right. The release verification relies on NSO's IPAM claim names (BootAddressIPClaims), mirrored from NSO's current code and not a contract; a rename leaves a release that never verifies and blocks the allocation closed (safe, but loud only as an error).
  • The allocation status record caps at 64 boot claims (ErrBootClaimsFull) and fails closed, which is right; confirm a stuck unverified release is visible to operators before it can fill.

Follow-ups:

  • Passing CI (go-test (custody-*), go-test (rest)) does not show that attach is gated on custody; no test covers it. I did not mutate #225 guards (envtest runs take about 7 minutes each here).

@scotwells
scotwells requested a review from ecv November 29, 2026 04:33

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still holding at 56e4070: the head is unchanged, so the attach-before-custody ordering in my last review stands.

@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve.

The new commit closes my hold. With the NSO source selected, Install and the wipe path now read custody first and move the boot NIC only while custody holds the Device for this allocation and runs no other operation; otherwise they claim nothing and wait with ErrBootNICBusy. TestNSOBootNICWaitsForCustody covers another running operation and another holder, and shows the attachment is made once custody can admit the operation. The doc now says enabling the source needs NSO's isolation proven first.

Follow-ups:

  • mayAttach does not look at a recovery hold; it relies on a held operation staying the active one. Add a case where a recovery hold is set and a different installation asks, and assert no claim is created.
  • The custody read and the attach are not atomic, so an operation admitted in between could still meet a moved port. Admission refuses that operation, so the window is narrow; worth a sentence in the doc.

@scotwells
scotwells requested a review from ecv November 29, 2026 05:51
@scotwells

Copy link
Copy Markdown
Contributor Author

Thanks. At 97e138c, a requester moves a boot NIC only while custody holds the Device for its allocation and runs no other operation. Otherwise it waits with ErrBootNICBusy and claims nothing. A held operation runs nothing, so the one that settles it can still attach. A new test covers a running operation and another holder, and removing any part of the gate fails it.

The boot network doc now says enabling the source needs NSO's isolation between servers proven first. The other points are in the body as decisions before any environment selects this source: wiring the shared-NIC handover with #198, a least-privilege role for boot attachment claims and the IPAM reads, and the assumed NSO IPAM claim names.

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still approved at 97e138c: nothing has changed since my last review.

scotwells and others added 17 commits November 29, 2026 00:48
Carry the boot address claim as a typed reference (apiGroup, kind,
name; no UID) and add TypedReference to internal/api/v1alpha1, the
same type Increment C defines.

Add bootaddress.Source (Requester, Attach, Claim, Release, Detach,
Operations). IPAM's Claimer implements it with no-op attach and detach
and stays the default; the allocator attaches before it claims and
releases before it detaches.

Admission picks its boot address check by claim kind from a registry;
only IPAM's IPClaim is registered. An unknown kind fails for good with
UnsupportedBootAddressClaim. BootAddressUnavailable now means only an
unreadable source (Pending, requeued); every terminal claim problem is
BootAddressClaimMismatch.

Tests pass: custody, bootaddress, allocation, site, api.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add nso.BootAttachments, a second boot address source, off by
default. For each installation and wipe it creates one Physical
NetworkInterfaceClaim named <operation>-boot on the provider's boot
network, for the boot NIC's MAC and cabled switch port. It waits until
NSO reports the claim Programmed before reading the bound IPv4
address, maps NSO's AddressPoolExhausted and allocation refusals to
the IPAM errors, and verifies a release only once the claim is gone
and IPAM holds no allocation for NSO's address claim.

Add nso.BootAttachmentCheck, the admission check for the claim kind
with IPAM's rules; nothing registers it by default. assumed.go lists
the NSO contract this relies on that NSO does not have yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add Allocator.HandOver, which releases the boot claims of ended,
unheld operations while an allocation is active, so NSO can move a
shared boot NIC to the customer's networks. Add Allocator.BootNIC and
BootNICCondition, which give NetworkReady=False with
BootNetworkAttached, or RecoveryHold for a held operation, while a
boot attachment holds a boot NIC the Machine also uses.

Test the source end to end against a real API server with a test
realizer that stands in for NSO's assumed port membership: install,
handover, held reinstall, handover and the release's wipe never put
the port on the boot and customer networks at once, each move is one
step, and the wipe attaches only after the Network gate closed.

Document the seam's NSO source and its assumed contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switching a requester's boot address source changed where existing
claims were released, so an IPAM claim made before a switch to NSO
was never released or verified, and release could finish while IPAM
still held its address.

Each source now reports its claim kind. New claims still go through
the configured source, but release lists and releases through every
known source by kind: the configured one and IPAM's claimer, which is
always present as the default. An IPAM claim keeps IPAM's verified
release and an NSO claim NSO's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Verify a boot release against both IPAM claim names NSO's code uses
  today: <claim>-f-ipv4 and the name suffixed with -l and eight hex
  digits of the location's hash. BootAttachments gains Location.
- Make the admission check only through NewBootAttachmentCheck, which
  refuses a reader scheme that does not know NSO's claim; a zero check
  fails closed instead of leaving operations Pending forever.
- Keep waiting on NSO's AllocationFailed, which NSO retries, and carry
  its reason and message in the error.
- Mark the source as one whose address can outlive its claim.
- Tests: drop the two-step realizer knob, and find NSO's CRDs from the
  version in go.mod in the module cache, skipping when absent, instead
  of running the go command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A source whose address can outlive its claim (NSO) is verified again
  for every operation of the allocation that names its claim kind, from
  the allocator's own DeviceInstallation and DeviceWipe records, so a
  claim NSO removed while IPAM still holds its address keeps the
  release open. IPAM's path is unchanged.
- IPAM's implicit default claimer treats a provider API without IPAM's
  kinds as nothing to release; configured sources still report errors.
- Add PreviousBootAddresses, and scope BootNIC to every known source by
  claim kind, so a boot claim left by a replaced source still reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document previous sources and the missing IPAM API, re-verified NSO
releases, both IPAM claim names, the fail-closed check, and which
guarantees are Fleet's and which are assumed of NSO and proven only
against the test realizer. The NetworkReady check exists but nothing
calls it until customer network attachment lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Before it creates a boot claim, the requester records the operation's
  kind and name and the claim's typed reference in the allocation's
  status (status.bootClaims). Release checks every recorded claim
  through the source of its kind and removes a record only once its
  release is verified, so a claim NSO dropped while IPAM holds its
  address keeps release open even after custody retention removed the
  operation, or for an operation that was never created. This replaces
  the scan of surviving operations and the Lingering marker.
- Treat only a NoMatch answer as IPAM's API being absent, and only for
  IPAM's implicit default claimer; a failed or partial discovery, or a
  configured source's absent API, keeps the release open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full status.bootClaims record now refuses the next installation or
wipe with ErrBootClaimsFull before any claim is made, instead of
failing on the API's item limit, and never drops or overwrites an
unverified entry. Tests fill the record and check the refusal, and
check that no claim is made when its record cannot be written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The record of boot claims applied to every source, so a long-lived
allocation on IPAM gained one entry per installation or wipe and, at
64, refused new work. IPAM removes a claim and its address together,
so its claims need no record.

- Bring back bootaddress.Lingering; only such a source (NSO) is
  recorded. IPAM is verified from its surviving claims, as before.
- Every release pass, hand-over included, prunes the entries it
  verified.
- A record with neither a claim nor an operation, such as one whose
  attach failed before any claim was made, is verified and cleared
  instead of keeping hand-over open until the final release.
- The full-record tests use the NSO source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A record with neither a surviving claim nor an operation was checked
with the source's Release, which deletes. A requester that had
recorded and was still attaching could create its claim after the
pass listed claims; Release then deleted the live claim and cleared
the record, losing record-before-claim.

The record-only path now calls Lingering.Released, which only reads:
a claim present now keeps the entry and the pass not done, and the
entry is cleared only when the claim is still absent and IPAM holds no
allocation under either address-claim name. Deleting stays on the
normal path and the final release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A release pass could find no claim yet and clear a requester's record
while its attach was still creating the claim, leaving a claim with no
record until the requester's next call. After Attach succeeds, the
requester now records the claim again, from the stored allocation,
before Claim reads the address, so an address is only handed out for
a recorded claim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The boot attachment and claim-kind tests name an allocation's Device
incarnation in its label, a hold's operation by kind and name, and an
installation's request in its label, as every spec now does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default allocator, with no boot address source, creates no NSO
interface claim for an installation or a wipe, as it creates no IPAM
claim. Nothing constructs the NSO boot attachment source outside tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the NSO source selected, an installation or wipe queued behind a
running operation, or requested while custody held the Device for
another allocation, would move the shared port onto the boot network
before admission. The requester now claims nothing and waits with
ErrBootNICBusy until custody holds the Device for its allocation and runs
no other operation; a test covers both cases. The boot network doc says
so, and that enabling the source needs NSO's isolation proven first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells
scotwells force-pushed the feat/nso-boot-attachment branch from 97e138c to 31e84ec Compare November 29, 2026 07:19
@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026
@scotwells
scotwells requested a review from ecv November 29, 2026 07:19

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve.

Rebase only: range-diff against my last review shows no change to this PR's commits.

@scotwells
scotwells requested a review from ecv November 29, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants