Rack State Machine interaction with Machine, Switch, and Power Shelf
This document defines the combined state machines for Machine (each compute tray / managed host lifecycle), Switch (each NVLink switch), Power Shelf (each power shelf), and Rack (collection of machines, switches, and power shelves). The diagram below shows all four and the transitions between the Rack state machine and the child device state machines.
For switch-only and power-shelf-only diagrams, see Switch State Diagram and Power Shelf State Diagram. For on-demand rack maintenance API details, see On-Demand Rack Maintenance.
Combined State Diagram (Machine, Switch, Power Shelf, Rack)
Rack State Machine Flow
The Rack state machine represents a collection of machines, switches, and power shelves. The rack lifecycle runs in coordination with child device state machines: the rack tracks when its children are created and ready, drives maintenance (firmware upgrade, NVOS update, NMX cluster configuration, optional power sequencing), validates the rack via RVS, and reaches Ready when validation completes and all trays are healthy.
High-Level Rack Diagram
Rack State Definitions
Created (R_Created)
- Entry: Site operator enters the expected rack; Site Explorer creates the rack entity when a machine, switch, or power shelf with the same
rack_idis discovered. - Exit: When the number of discovered switches reaches the rack profile switch count, the rack moves to Discovering. A missing or unknown rack profile keeps the rack in
Created.
Discovering (R_Discovering)
- Entry: From
Createdwhen discovery starts. Also re-entered fromReadywhentopology_changedis set (tray replacement). - Exit: When the number of switches in
SwitchControllerState::Readyreaches the rack profile switch count, the rack atomically setsingestion_in_progressand transitions to Maintenance atFirmwareUpgrade(Start). A missing or unknown rack profile keeps the rack inDiscovering.
Compute and power shelf counts and readiness do not gate either ingestion transition. Their profile counts describe expected inventory for MissingRackComponent health alerts. The Helm chart defaults expect 16 compute trays and 9 switches in every profile. The default power shelf count is 8 for GB200, 6 for GB300, and 4 for VR profiles. _NO_POWERSHELF profiles expect zero power shelves. Site configuration can override these defaults. The switch count is a minimum threshold: zero allows progression without switches, and extra switches do not prevent either transition.
Maintenance (R_Maintenance)
- Entry: From
Discoveringafter the profile switch readiness threshold is met, fromReadywhenreprovision_requestedormaintenance_requestedis set, or fromErrorwhen on-demand maintenance is requested. - Exit:
- To Validating (
Pending) when maintenance reachesCompleted. - To Error on timeout or unrecoverable failure.
- To Validating (
Sub-state flow (activities may be skipped based on MaintenanceScope.activities):
During automatic maintenance, a missing rack-profile firmware_object skips
both update phases. If a switch in the maintenance scope is already in
ReProvisioning::WaitingForNVOSUpgrade, the rack transitions to Error instead
of skipping the NVOS phase.
The first automatic firmware batch includes only ready compute hosts without reprovision or machine-maintenance requests, ready switches without reprovision requests, and ready power shelves without reprovision requests. Unready compute is left for supplemental admission. If no compute or switch is ready, NICo keeps an empty current-cycle job without submitting an empty RMS request.
While automatic ingestion has a persisted firmware job, WaitForComplete
compares current compute membership with that job’s device handles. A newly
arrived host stays pending until it is Ready and has no reprovision or machine
maintenance request. NICo then submits the rack profile’s configured firmware
object for that host and appends its child job handle to the persisted rack job.
Existing devices are not resubmitted, and a controller restart resumes polling
all persisted handles. A host that has not joined this job stays pending even
if its machine state is Failed; that unrelated failure does not fail the
rack firmware job. An unsubmitted host already in Assigned is excluded from
supplemental firmware and does not block ingestion. Its firmware requires a
separate maintenance operation when the host is eligible.
Switch and power shelf firmware progress includes only devices admitted to the current job. Unsubmitted devices do not fail or delay this firmware phase merely because their own provisioning is waiting or failed. Shelf membership is persisted separately from RMS handles because RMS may omit shelf jobs; the existing controller-completion fallback applies only to those admitted shelves.
A ready host with desired power Off blocks submission with a retryable handler
error; its desired power is not changed. Results polled for existing devices
are committed before supplemental admission. Inventory, credential, or dispatch
errors for a late host therefore do not prevent existing devices from observing
their completed firmware results. Other unsubmitted hosts remain pending until
ready and free of conflicting requests; this waiting has no overall deadline.
Completed repeats this membership check before clearing ingestion_in_progress
and validation labels. Unsubmitted hosts outside Assigned, or a pending firmware job, return the
rack to FirmwareUpgrade(WaitForComplete), including after a restart between
persisting a new batch and transitioning the rack. The firmware job persists
return_to_completed = true with the supplemental batch, or with the transition
to firmware waiting when hosts are not ready. After that job completes, the rack returns directly to
Completed and repeats the membership check. It does not repeat switch NVOS
updates, rack-wide compute reboots, or NMX configuration. Predecessor jobs
without the marker default to false and retain the normal firmware continuation.
Explicit maintenance retains its selected device scope. Entering a new ingestion cycle
clears the previous cycle’s firmware job in the same transaction as the state transition.
If the new cycle skips firmware because its profile has no firmware object, no old job
can trigger supplemental admission at Completed. Hosts arriving after ingestion ends
are outside this check.
When a firmware job exists, automatic ingestion selects restart targets from its
admitted compute hosts, excluding Assigned hosts and desired power Off.
It waits for selected targets to accept maintenance. Without a firmware job,
only ready, unclaimed hosts whose desired power is not Off are selected. It saves that batch in restart_machine_ids and waits for
those targets, including across restarts. New arrivals do not enlarge an active
batch or restart previously completed targets. Saved targets that have been deleted
or are no longer associated with the rack no longer block the batch; remaining targets
must still complete their restarts. Explicit power maintenance retains its existing
desired-off rejection and membership handling.
Discovery persists ingestion_in_progress when entering maintenance. Only an
actual successful NVOS update in that ingestion cycle automatically reboots
compute hosts; skipping the update does not. On-demand maintenance requires an
explicit PowerSequence activity, including when other activities default to
all. Reprovision does not enable the ingestion flag. Predecessor rows without
the flag do not gain an automatic reboot.
When an NVOS update triggers a reboot, its completion commits the transition to
PowerReset before any reboot request is queued. PowerReset then atomically
queues asynchronous graceful Reboot requests for the selected batch. Saved
target IDs let the batch resume after a controller restart. Explicit power
maintenance targets every compute host in the rack regardless of device scope.
It waits without queuing requests while any target has an instance, pending
maintenance, or a state that cannot accept maintenance.
For explicit power maintenance, any compute host with desired power Off
causes rack maintenance to enter Error without queuing reboots or changing
desired power. After correcting desired power, an operator must request
maintenance again. Automatic ingestion instead excludes desired-off targets.
The batch completes when every request is cleared and every host has a Scout
reboot timestamp later than the persisted batch-state timestamp. Hosts do not
need to reach Ready, and the timestamp does not prove that this request caused
the reboot. The batch has no timeout; a host that never becomes eligible or never
reports a newer reboot can leave maintenance waiting indefinitely
(timeout follow-up).
An operator can terminate maintenance, which cancels only saved, rack-owned
restart requests that no host has claimed. For explicit power maintenance,
membership changes start a fresh batch. Automatic ingestion retains its saved
batch and waits only for saved targets still associated with the rack. Deleted or
detached targets do not block completion. Conflicting maintenance requests move the
rack to Error. After the batch
completes, maintenance runs NMX-C configuration if selected, or completes. A
persisted PoweringOn state remains a no-op that completes maintenance without
another reboot.
Graceful reboots do not fall back to forced restarts. Both direct Redfish and
RMS compute backends receive GracefulRestart. Saved legacy Reset requests
retain forced-restart behavior and can still complete
or be cancelled by the rack. All controllers reading machine maintenance must
support the Reboot operation before a rack queues it.
The RMS power-control adapter preserves GracefulRestart and ForceRestart as
distinct operations. Compute AcPowercycle requests use Core’s Redfish implementation
through the RMS adapter, including requests queued as AcPowercycle maintenance.
Queued AC cycles restore onboard NIC settings on Vera Rubin hosts with managed
DPUs using the ingestion sequence; explicit direct/bypass requests skip this cleanup.
All machine controllers must support the AC maintenance phases before the operation
is queued. Queued
compute and switch resets preserve graceful intent through the graceful flag.
Switch AC cycles remain unsupported, and the power-shelf state controller supports
only power on/off. See the
RMS power-control mapping.
ConfigureNmxCluster sub-states
Start submits one ConfigureSwitchCertificate request containing every rack
switch. The request always binds nvue_api and also binds the explicitly configured gNMI
telemetry interface. After that job completes, the rack submits the unchanged
RMS ScaleUpFabricManager V2 request. RMS selects the primary and reconciles the
fabric and binds NMX-C to the current NVUE material. NICo persists the observed
primary. When scale_up_fabric_telemetry is in the effective service list, NICo
submits a certificate request for that primary. Each submitted parent
RMS job ID is persisted while NICo polls the corresponding operation.
The RMS V2 deployment must rebind NMX-C on every run, including when its
existing Hello check succeeds; otherwise a rotation can leave NMX-C on the old
certificate.
Validating (R_Validating)
- Entry: From
Maintenance(Completed). - Exit:
- To Ready when validation reaches
Validatedand all child devices are ready. - To Error on terminal validation failure.
- To Ready when validation reaches
Sub-states: Pending → InProgress → Partial / FailedPartial → Validated or Failed. RVS drives transitions by writing rv.run-id and partition result labels on rack machines.
Ready (R_Ready)
- Entry: From
Validatingwhen validation completes and every tray is healthy. - Exit:
- To Maintenance when
reprovision_requestedormaintenance_requestedis set. - To Discovering when
topology_changedis set (tray replacement). - To Error when any child switch, power shelf, or machine enters a terminal failure state.
- To Maintenance when
The rack is fully operational. While ready, it monitors child health and accepts reprovisioning or on-demand maintenance requests.
Error (R_Error)
- Entry: From
Maintenance,Validating, orReadyon failure. - Exit:
- To Ready when a component-origin error is marked for automatic recovery and all child devices are healthy again.
- To Maintenance when on-demand maintenance is requested from error state.
Maintenance-origin errors remain in Error until a new maintenance request is submitted. Errors without recovery metadata retain automatic component-readiness recovery.
Deleting (R_Deleting)
- Entry: When the rack is marked
deleted. - Exit: Terminal delete.
Switch Interaction with Rack
The Rack state machine drives or observes the Switch state machine as follows:
These cross-state dependencies are shown in the Combined State Diagram.
Switch State Machine Flow (summary)
The Switch state machine runs on each switch. The lifecycle runs from creation through initialization, certificate configuration, password rotation, slot/tray fetch, validation, BOM validation, and Ready. From Ready a switch can enter operator Maintenance, rack-driven ReProvisioning, Deleting, or Error.
Bring-up flow:
Rack reprovisioning flow (when continue_after_firmware_upgrade is true):
See Switch State Diagram for the full switch FSM.
Machine Interaction with Rack
The Rack state machine drives or observes the Machine (compute) state machine as follows:
These cross-state dependencies are shown in the Combined State Diagram.
Power Shelf Interaction with Rack
See Power Shelf State Diagram for the power-shelf FSM.
Recovering from M_HostReprovision::FailedFirmwareUpgrade
A compute machine that fails its host firmware upgrade lands in the
M_HostReprovision::FailedFirmwareUpgrade substate. There are two ways out:
- Automatic retry. While
retry_count < MAX_FIRMWARE_UPGRADE_RETRIESand the configuredhost_firmware_upgrade_retry_intervalhas elapsed since the failure, the machine state handler automatically transitions back toCheckingFirmwareV2and re-attempts the upgrade. - Fresh Host Reprovision request. The Rack state machine (or an operator
via
trigger_host_reprovisioning) can issue a brand-new Host Reprovision request at any time. The new request overwriteshost_reprovisioning_requestedwithstarted_at = None; the FailedFirmwareUpgrade handler detects this fresh request and restarts the upgrade flow fromCheckingFirmwareV2withretry_countreset to0, mirroring the wayManagedHostState::Readykicks off a Host Reprovision (including thehost-fw-updatehealth-report alert merge). Rack-level requests (initiator prefixed withrack-) instead enterWaitingForRackFirmwareUpgrade.
A fresh request allows the rack to retry an admitted compute host’s failed
firmware operation without waiting for retry backoff. Automatic ingestion tracks
admitted firmware work separately from unrelated device failures; it does not
require the full expected inventory to reach M_Ready before validation.
Tray Replacement (External Event)
When a tray (compute machine) in a rack is physically replaced, the rack topology changes. This is an external event that triggers the following state machine transitions:
- Old machine: The replaced machine is removed from the rack. Its Machine state machine terminates (deletion path).
- New machine: Site Explorer detects the new tray and creates a new machine entity in M_Created. The new machine progresses through its ingestion states toward M_Ready.
- Rack: The rack detects the topology change (
topology_changed) and transitions from R_Ready → R_Discovering. In R_Discovering the rack waits until the ready switch count reaches the profile minimum, then proceeds through R_Maintenance → R_Validation → R_Ready as in the normal flow.
Compute discovery proceeds independently of the switch threshold; the rack follows its normal maintenance and validation flow.
How the data is organized
A rack is the top-level entity. Every machine (compute tray), every switch, and every power shelf belongs to exactly one rack.
- Each rack has a unique identifier (the rack ID).
- Each child device stores the rack ID of the rack it belongs to.
- Each switch has
switch_reprovisioning_requestedand per-cycle status fields (firmware_upgrade_status,nvos_update_status,fabric_manager_status) that the rack state machine sets during maintenance.
When a site operator enters an expected rack (with a rack ID and rack type), Site Explorer creates the rack entity as soon as it discovers machines, switches, or power shelves that share the same rack ID. From that point the rack tracks its children through their respective state machines until the entire rack reaches a ready state.
Implementation
- Rack state type:
RackStateincrates/api-model/src/rack.rs. - Rack handlers:
crates/rack-controller/src/. - Switch state type:
SwitchControllerStateincrates/api-model/src/switch/mod.rs. - Switch handlers:
crates/switch-controller/src/. - On-demand maintenance API: On-Demand Rack Maintenance.