fix(machine-controller): gate Assigned/Ready on provisioning-completion on evidence for custom iPXE boots - #5087
Conversation
…on evidence for custom iPXE boots
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-5087.docs.buildwithfern.com/infra-controller |
chet
left a comment
There was a problem hiding this comment.
I can't look at the change completely right now, but I just wanna make sure this isn't colliding with the work that Brian did to allow machine allocations to go into unmanaged networks.
I'll have to find his PR later, but the idea is that for one of our partners, as soon as the machine gets allocated and rebooted, we don't actually see the machine again until they release it.
Brian did the work to make this happen, it was either in June or the end of May.
|
Thank you, @chet, for your insight. When I reviewed the existing get notification (OS completion) feature, I discovered that it was only activated when the phone home feature was enabled. I will contact @bcavnvidia to confirm if there is a similar feature that could be referenced instead of the new one. There has been a recent bug reported that is attempting to fix these issues. |
Description
NICo previously treated a one-time custom iPXE boot as complete the moment the tenant's script was served:
WaitingForRebootToReadydeclared the instanceAssigned/Readyright after issuing the reboot, and/api/v0/pxe/bootconsumed the one-shotuse_custom_pxe_on_bootrequest on the first serve. If the script then failed before installing an OS (e.g. a transient HTTP 403 on the kernel fetch), every later network boot received "exit into the OS" against an empty disk — an infinite boot loop reported as Ready, recoverable only by a manualrebootWithCustomIpxe.This PR makes provisioning success an observed fact instead of an assumption. Provisioning boots (new instances, and reboots with
rebootWithCustomIpxe/boot_with_custom_ipxe) now enter a newAssigned/WaitingForProvisioningCompletestate instead ofReady, and the one-shot request stays armed until there is evidence the tenant's operating system actually installed.Key behaviors:
instances.custom_pxe_serve_count/custom_pxe_last_served_at.provisioning_quiet_window(default 15m) otherwise.max_provisioning_servesorprovisioning_deadlinetransitions the instance toFailed { ProvisioningFailed }— a clear terminal state for upstream orchestrators instead of a silent loop; tenants seeProvisioning(notReady) while the wait is in flight.rebootWithCustomIpxeand instance deletion are honored from both the waiting state and theProvisioningFailedstate, handing back to theAssigned/Readyflow without waiting for timeouts.run_provisioning_instructions_on_every_boot), DPU flows, and dev boot overrides are unchanged; the legacy consume-on-serve path inAssigned/Readyremains for machines already mid-flight.Related issues
Type of Change
Testing
Tests executed:
cargo test -p api-core
cargo test -p machine-controller
cargo test -p api-model
Covers: script re-served on repeated PXE requests without consuming the request; serve accounting; phone-home and quiet-window completion; serve-budget and deadline failure into
ProvisioningFailed; recovery viarebootWithCustomIpxefrom waiting and failed states; always-PXE and plain-reboot behavior unchanged.Additional Notes
instancescolumns via migration20260817154233_custom_pxe_serve_tracking.sql(custom_pxe_serve_count,custom_pxe_last_served_at); both reset when a new provisioning boot is armed.provisioning_quiet_window(15m),max_provisioning_serves,provisioning_deadline.machine-controller/src/handler/provisioning_completion.rsfor testability.WaitingForProvisioningCompletecarries onlystarted_at/deadline; serve bookkeeping lives on the instance row to avoid stale copies in persisted state.docs/architecture/state_machines/managedhost.md; tenant-facing behavior documented indocs/configuration/tenant_management.md.