Repository navigation
Conversation
0f89d68 to
117c13a
Compare
7c067e4 to
98c6bf0
Compare
117c13a to
4297ea9
Compare
98c6bf0 to
b477627
Compare
4297ea9 to
7357126
Compare
b477627 to
056bb49
Compare
7357126 to
f7d4685
Compare
056bb49 to
56e4070
Compare
ecv
left a comment
There was a problem hiding this comment.
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.
bootNetworkcallsAttachinsideInstall/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. TheBootNICguard covers the customer attach path, not this one. GateAttachon 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. BootNICandHandOverhave no non-test caller (onlynsoboot_test.goandverify_test.go), and the PR's own docs say the customer network attachment must callBootNIC. 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
networkinterfaceclaimsor for the IPAM reader the NSO source uses (IPAM,IPAMNamespace,Location) is added anywhere inconfig/, so the least-privilege grant is unreviewed. Add the role with the wiring, scoped to the boot network namespace, and without update/patch. Releasedeletes 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).
ecv
left a comment
There was a problem hiding this comment.
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:
mayAttachdoes 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.
|
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 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. |
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>
f7d4685 to
f0be8dd
Compare
97e138c to
31e84ec
Compare
ecv
left a comment
There was a problem hiding this comment.
Approve.
Rebase only: range-diff against my last review shows no change to this PR's commits.
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
Test plan
gh pr checksentry green on the head, including the multi-plane acceptance🤖 Generated with Claude Code