Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/api-core/src/cfg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,21 @@ Extends `StateControllerConfig` with:
| `uefi_boot_wait` | `Duration` | `5m` | Wait time for UEFI boot completion after host reboot. |
| `max_bios_config_retries` | `u32` | `3` | Shared retry budget for automated host boot-configuration convergence across BIOS recovery and boot-order verification. |
| `polling_bios_setup_stuck_threshold` | `Duration` | `15m` | Time in PollingBiosSetup with `is_bios_setup == false` before recovery escalation. |
| `boot_interface_observation_interval` | `Duration` | `10m` | Positive time between successful Redfish observations of an already-verified boot interface. |
| `controller` | `StateControllerConfig` | *(default)* | Common state controller timing (see [StateControllerConfig](#statecontrollerconfig)). |

The Redfish observation is read-only. A successful match refreshes the last
observation timestamp. A mismatch records a new pending generation for the same
desired target: Ready enters the existing boot-configuration flow on its next
controller sweep, while Assigned defers remediation until release. Failed reads
and skipped observations preserve the last successful observation and retry on
a later controller iteration.

The controller skips periodic observation for locked Supermicro hosts because
their reported boot-order view remains stale until lockdown is disabled and the
host is rebooted. Profiles configured with `disable_lockdown = true` use the
normal observation path.

### `NetworkSegmentStateControllerConfig`

Extends `StateControllerConfig` with:
Expand Down
19 changes: 19 additions & 0 deletions crates/api-core/src/cfg/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3975,6 +3975,7 @@ mod tests {
uefi_boot_wait: Duration::minutes(5),
max_bios_config_retries: 3,
polling_bios_setup_stuck_threshold: Duration::minutes(15),
boot_interface_observation_interval: Duration::hours(2),
};

let config_str = serde_json::to_string(&input).unwrap();
Expand All @@ -3995,6 +3996,7 @@ mod tests {
fn deserialize_machine_controller_config() {
let config = r#"{"dpu_wait_time": "20m","power_down_wait":"10s",
"failure_retry_time":"1h30m", "dpu_up_threshold": "1w",
"boot_interface_observation_interval": "2h",
"controller": {"iteration_time": "33s", "max_object_handling_time": "63s", "max_concurrency": 13}}"#;
let config: MachineStateControllerConfig = serde_json::from_str(config).unwrap();

Expand All @@ -4021,6 +4023,7 @@ mod tests {
uefi_boot_wait: Duration::minutes(5),
max_bios_config_retries: 3,
polling_bios_setup_stuck_threshold: Duration::minutes(15),
boot_interface_observation_interval: Duration::hours(2),
}
);
}
Expand All @@ -4044,10 +4047,23 @@ mod tests {
uefi_boot_wait: Duration::minutes(5),
max_bios_config_retries: 3,
polling_bios_setup_stuck_threshold: Duration::minutes(15),
boot_interface_observation_interval: Duration::minutes(10),
}
);
}

#[test]
fn reject_nonpositive_boot_interface_observation_intervals() {
for invalid_interval in ["0s", "-1s"] {
let config_json =
format!(r#"{{"boot_interface_observation_interval": "{invalid_interval}"}}"#);
assert!(
serde_json::from_str::<MachineStateControllerConfig>(&config_json).is_err(),
"boot_interface_observation_interval={invalid_interval} must be rejected",
);
}
}

#[test]
fn deserialize_network_segment_state_controller_config() {
let config = r#"{"network_segment_drain_time": "21m",
Expand Down Expand Up @@ -4469,6 +4485,7 @@ mod tests {
uefi_boot_wait: Duration::minutes(5),
max_bios_config_retries: 3,
polling_bios_setup_stuck_threshold: Duration::minutes(15),
boot_interface_observation_interval: Duration::hours(2),
}
);
assert_eq!(
Expand Down Expand Up @@ -4710,6 +4727,7 @@ mod tests {
uefi_boot_wait: Duration::minutes(5),
max_bios_config_retries: 3,
polling_bios_setup_stuck_threshold: Duration::minutes(15),
boot_interface_observation_interval: Duration::minutes(10),
}
);
assert_eq!(
Expand Down Expand Up @@ -5094,6 +5112,7 @@ mod tests {
uefi_boot_wait: Duration::minutes(5),
max_bios_config_retries: 3,
polling_bios_setup_stuck_threshold: Duration::minutes(15),
boot_interface_observation_interval: Duration::hours(2),
}
);
assert_eq!(
Expand Down
1 change: 1 addition & 0 deletions crates/api-core/src/cfg/test_data/full_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ power_down_wait = "13s"
failure_retry_time = "31m"
dpu_up_threshold = "33m"
scout_reporting_timeout = "20m"
boot_interface_observation_interval = "10m"

[host_health]
prevent_allocations_on_stale_dpu_agent_version = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ power_down_wait = "13s"
failure_retry_time = "31m"
dpu_up_threshold = "33m"
scout_reporting_timeout = "20m"
boot_interface_observation_interval = "10m"

[host_health]
prevent_allocations_on_stale_dpu_agent_version = true
Expand Down
1 change: 1 addition & 0 deletions crates/api-core/src/cfg/test_data/site_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dpu_wait_time = "7m"
power_down_wait = "17s"
failure_retry_time = "70m"
dpu_up_threshold = "77m"
boot_interface_observation_interval = "2h"
[machine_state_controller.controller]
iteration_time = "3m"
max_object_handling_time = "11s"
Expand Down
Loading
Loading