Skip to content
Draft
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
3 changes: 3 additions & 0 deletions crates/admin-cli/src/debug_bundle/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ struct MachineAnalysis {
}

/// Helper function to get BMC IP and MAC address from machine_id
#[allow(deprecated)]
async fn get_bmc_ip_from_host_id(
api_client: &ApiClient,
host_id: &str,
Expand Down Expand Up @@ -1698,6 +1699,7 @@ impl<'a> ZipBundleCreator<'a> {
Ok(())
}

#[allow(deprecated)]
fn add_machine_analysis_json(
&self,
zip: &mut ZipWriter<File>,
Expand Down Expand Up @@ -1801,6 +1803,7 @@ impl<'a> ZipBundleCreator<'a> {
}

#[allow(clippy::too_many_arguments)]
#[allow(deprecated)]
fn add_metadata(
&self,
zip: &mut ZipWriter<File>,
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/dpu/network/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ pub async fn show_dpu_network_config(
Ok(())
}

#[allow(deprecated)]
pub async fn show_dpu_status(
api_client: &ApiClient,
output_file: &mut Box<dyn tokio::io::AsyncWrite + Unpin>,
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/dpu/reprovision/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub async fn reprovision(api_client: &ApiClient, reprov: Args) -> CarbideCliResu
}
}

#[allow(deprecated)]
async fn apply_health_report(
api_client: &ApiClient,
id: carbide_uuid::machine::MachineId,
Expand Down
2 changes: 2 additions & 0 deletions crates/admin-cli/src/dpu/status/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct DpuStatus {
}

impl From<Machine> for DpuStatus {
#[allow(deprecated)]
fn from(machine: Machine) -> Self {
let state = match machine.state.split_once(' ') {
Some((state, _)) => state.to_owned(),
Expand Down Expand Up @@ -105,6 +106,7 @@ impl From<DpuStatus> for Row {
}
}

#[allow(deprecated)]
pub fn get_dpu_version_status(build_info: &BuildInfo, machine: &Machine) -> String {
let mut version_statuses = Vec::default();

Expand Down
2 changes: 2 additions & 0 deletions crates/admin-cli/src/dpu/versions/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct DpuVersions {
}

impl From<Machine> for DpuVersions {
#[allow(deprecated)]
fn from(machine: Machine) -> Self {
let state = match machine.state.split_once(' ') {
Some((state, _)) => state.to_owned(),
Expand Down Expand Up @@ -144,6 +145,7 @@ pub fn generate_firmware_status_table(machines: Vec<Machine>) -> Box<Table> {
Box::new(table)
}

#[allow(deprecated)]
pub async fn handle_dpu_versions(
output_file: &mut Box<dyn tokio::io::AsyncWrite + Unpin>,
output_format: OutputFormat,
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/host/reprovision/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::errors::{CarbideCliError, CarbideCliResult};
use crate::machine::{HealthReportTemplates, get_health_report};
use crate::rpc::ApiClient;

#[allow(deprecated)]
pub async fn trigger_reprovisioning_set(
data: ReprovisionSet,
api_client: &ApiClient,
Expand Down
4 changes: 4 additions & 0 deletions crates/admin-cli/src/inventory/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ struct DpuMachineInfo<'a> {
}

/// Generate element containing all information needed to write a Machine Host.
#[allow(deprecated)]
fn get_host_machine_info<'a>(
machines: &'a [&'a ::rpc::Machine],
) -> HashMap<&'a str, HostMachineInfo<'a>> {
Expand Down Expand Up @@ -127,6 +128,7 @@ fn get_host_machine_info<'a>(
}

/// Generate element containing all information needed to write a Machine Host.
#[allow(deprecated)]
fn get_dpu_machine_info<'a>(
machines: &'a [&'a ::rpc::Machine],
) -> HashMap<&'a str, DpuMachineInfo<'a>> {
Expand All @@ -153,6 +155,7 @@ fn get_dpu_machine_info<'a>(
}

/// Generate element containing all information needed to write a BMC Host.
#[allow(deprecated)]
fn get_bmc_info<'a>(
machines: &[&'a ::rpc::Machine],
managed_hosts: &'a [ExploredManagedHost],
Expand Down Expand Up @@ -330,6 +333,7 @@ type CreateInventoryReturnType<'a> = (
);

/// Generate inventory item for instances.
#[allow(deprecated)]
fn create_inventory_for_instances<'a>(
instances: &'a InstanceList,
machines: &'a MachineList,
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/machine/hardware_info/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub async fn handle_update_machine_hardware_info_gpus(
.await
}

#[allow(deprecated)]
pub async fn handle_show_machine_hardware_info(
api_client: &ApiClient,
output_file: &mut Box<dyn tokio::io::AsyncWrite + Unpin>,
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/machine/metadata/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ pub async fn metadata_remove_labels(
Ok(())
}

#[allow(deprecated)]
pub async fn metadata_from_expected_machine(
api_client: &ApiClient,
cmd: MachineMetadataCommandFromExpectedMachine,
Expand Down
2 changes: 2 additions & 0 deletions crates/admin-cli/src/machine/nvlink_info/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use super::args::{NvlinkInfoArgs, NvlinkInfoPopulateArgs};
use crate::errors::{CarbideCliError, CarbideCliResult};
use crate::rpc::ApiClient;

#[allow(deprecated)]
pub async fn handle_nvlink_info_show(
args: NvlinkInfoArgs,
api_client: &ApiClient,
Expand Down Expand Up @@ -58,6 +59,7 @@ pub async fn handle_nvlink_info_show(
Ok(())
}

#[allow(deprecated)]
pub async fn handle_nvlink_info_populate(
args: NvlinkInfoPopulateArgs,
_output_format: OutputFormat,
Expand Down
3 changes: 3 additions & 0 deletions crates/admin-cli/src/machine/show/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use crate::errors::{CarbideCliError, CarbideCliResult};
use crate::rpc::ApiClient;
use crate::{async_write, async_write_table_as_csv, async_writeln};

#[allow(deprecated)]
fn convert_machine_to_nice_format(
machine: forgerpc::Machine,
history_count: u32,
Expand Down Expand Up @@ -217,6 +218,7 @@ fn get_machine_type(machine_id: Option<MachineId>) -> String {
.unwrap_or_else(|| "Unknown".to_string())
}

#[allow(deprecated)]
fn convert_machines_to_nice_table(machines: forgerpc::MachineList) -> Box<Table> {
let mut table = Box::new(Table::new());

Expand Down Expand Up @@ -425,6 +427,7 @@ pub async fn handle_show(
Ok(())
}

#[allow(deprecated)]
pub async fn get_next_free_machine(
api_client: &ApiClient,
machine_ids: &mut VecDeque<MachineId>,
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/managed_host/show/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ fn format_health_alerts(alerts: &[HealthProbeAlert], width: usize) -> String {
.join(&format!("\n{:<width$}: ", " "))
}

#[allow(deprecated)]
pub async fn show(
output_file: &mut Box<dyn tokio::io::AsyncWrite + Unpin>,
args: Args,
Expand Down
1 change: 1 addition & 0 deletions crates/admin-cli/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,7 @@ impl ApiClient {
}

/// Build an InstanceAllocationRequest from CLI args and machine info.
#[allow(deprecated)]
pub async fn build_instance_request(
&self,
machine: Machine,
Expand Down
1 change: 1 addition & 0 deletions crates/api-core/src/attestation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub async fn get_ek_cert_by_machine_id(

// obtain an ek cert
let tpm_ek_cert = machine
.status
.hardware_info
.as_ref()
.ok_or_else(|| CarbideError::internal("Hardware Info not found.".to_string()))?
Expand Down
2 changes: 1 addition & 1 deletion crates/api-core/src/dpa/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async fn handle_dpa_message(services: Arc<Api>, message: SetVni, topic: String)

let machine = machine.unwrap();

let cur_spx_status_observations = machine.spx_status_observation.unwrap_or_default();
let cur_spx_status_observations = machine.status.spx_status_observation.unwrap_or_default();
let mut new_spx_status_observations = MachineSpxStatusObservation::default();

let mut add_new_observation = true;
Expand Down
14 changes: 10 additions & 4 deletions crates/api-core/src/ethernet_virtualization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,15 @@ pub async fn admin_network(
// If we loop through the machine interfaces for the host snapshot and look for
// that combo, the segment_id of that interface should be the network segment we want,
// but checking against known admin segments adds a little bit of defense.
let interface = snapshot.host_snapshot.interfaces.iter().find(|interface| {
interface.attached_dpu_machine_id.as_ref() == Some(dpu_machine_id)
&& admin_segment_ids.contains(&interface.segment_id)
});
let interface = snapshot
.host_snapshot
.status
.interfaces
.iter()
.find(|interface| {
interface.attached_dpu_machine_id.as_ref() == Some(dpu_machine_id)
&& admin_segment_ids.contains(&interface.segment_id)
});

let host_machine_id = snapshot.host_snapshot.id;
let Some(interface) = interface else {
Expand All @@ -351,6 +356,7 @@ pub async fn admin_network(
// still disables the admin DHCP path on non-primary DPUs via is_primary_dpu.
let active_interface = snapshot
.host_snapshot
.status
.interfaces
.iter()
.find(|interface| {
Expand Down
2 changes: 1 addition & 1 deletion crates/api-core/src/handlers/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub(crate) async fn trigger_machine_attestation(
id: format!("{}", machine_id),
}));
}
1 => &machines[0].bmc_info,
1 => &machines[0].status.bmc_info,
_ => {
return Err(Status::from(CarbideError::Internal {
message: format!("Found more than one machine for machine id {}", machine_id),
Expand Down
5 changes: 3 additions & 2 deletions crates/api-core/src/handlers/bmc_endpoint_explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ pub(crate) async fn admin_power_control(

if let Some(power_state) = snapshot
.host_snapshot
.status
.power_options
.map(|x| x.desired_power_state)
&& power_state == model::power_manager::PowerState::On
Expand Down Expand Up @@ -1091,13 +1092,13 @@ pub(crate) async fn validate_and_complete_bmc_endpoint_request(
id: machine_id.to_string(),
})?;

let bmc_ip = machine.bmc_info.ip.as_ref().ok_or_else(|| {
let bmc_ip = machine.status.bmc_info.ip.as_ref().ok_or_else(|| {
CarbideError::internal(format!(
"Machine found for {machine_id} but BMC IP is missing"
))
})?;

let bmc_mac_address = machine.bmc_info.mac.ok_or_else(|| {
let bmc_mac_address = machine.status.bmc_info.mac.ok_or_else(|| {
CarbideError::internal(format!("BMC endpoint for {bmc_ip} ({machine_id}) found but does not have associated MAC"))
})?;

Expand Down
5 changes: 3 additions & 2 deletions crates/api-core/src/handlers/component_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ async fn group_machine_ids_by_rack(
/// Returns whether the machine is a rack-scale server (today just GB200, but will later include other SKUs)
fn is_rack_scale_server(machine: &Machine) -> bool {
machine
.status
.hardware_info
.as_ref()
.is_some_and(|hw| hw.is_gbx00())
Expand Down Expand Up @@ -1126,15 +1127,15 @@ async fn resolve_compute_tray_endpoints(
continue;
};

let Some(bmc_mac) = machine.bmc_info.mac else {
let Some(bmc_mac) = machine.status.bmc_info.mac else {
unresolved.push(UnresolvedDevice {
id: machine_id,
reason: "BMC MAC not available".into(),
});
continue;
};

let Some(bmc_ip) = machine.bmc_info.ip else {
let Some(bmc_ip) = machine.status.bmc_info.ip else {
unresolved.push(UnresolvedDevice {
id: machine_id,
reason: "BMC IP not configured".into(),
Expand Down
2 changes: 1 addition & 1 deletion crates/api-core/src/handlers/dpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(crate) async fn modify_dpf_state(
id: machine_id.to_string(),
})?;

if !request.dpf_enabled && machine_snapshot.host_snapshot.dpf.used_for_ingestion {
if !request.dpf_enabled && machine_snapshot.host_snapshot.config.dpf.used_for_ingestion {
return Err(CarbideError::FailedPrecondition(format!(
"Cannot disable DPF for host {}: machine was ingested via DPF.",
machine_id
Expand Down
4 changes: 3 additions & 1 deletion crates/api-core/src/handlers/dpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub(crate) async fn get_managed_host_network_config_inner(

let primary_dpu_snapshot = snapshot
.host_snapshot
.status
.interfaces
.iter()
.find(|x| x.primary_interface)
Expand Down Expand Up @@ -190,6 +191,7 @@ pub(crate) async fn get_managed_host_network_config_inner(

let booturl_override = if snapshot
.host_snapshot
.status
.hardware_info
.as_ref()
.map(|h| h.machine_type)
Expand Down Expand Up @@ -927,7 +929,7 @@ pub(crate) async fn record_dpu_network_status(
id: dpu_machine_id.to_string(),
})?;

if snapshot.host_snapshot.dpf.used_for_ingestion {
if snapshot.host_snapshot.config.dpf.used_for_ingestion {
// DPF-managed DPUs don't use this upgrade path. Clear any stale flag so the DPU
// doesn't keep receiving upgrade signals after the host was switched to DPF.
if dpu_machine.needs_agent_upgrade() {
Expand Down
23 changes: 12 additions & 11 deletions crates/api-core/src/handlers/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,16 +893,16 @@ pub(crate) async fn invoke_power(
log_tenant_organization_id(instance.config.tenant.tenant_organization_id.as_str());
}

let bmc_ip =
snapshot
.host_snapshot
.bmc_info
.ip
.as_ref()
.ok_or_else(|| CarbideError::NotFoundError {
kind: "bmc_ip",
id: machine_id.to_string(),
})?;
let bmc_ip = snapshot
.host_snapshot
.status
.bmc_info
.ip
.as_ref()
.ok_or_else(|| CarbideError::NotFoundError {
kind: "bmc_ip",
id: machine_id.to_string(),
})?;

let run_provisioning_instructions_on_every_boot = snapshot
.instance
Expand Down Expand Up @@ -1030,6 +1030,7 @@ pub(crate) async fn invoke_power(
let bmc_mac_address =
snapshot
.host_snapshot
.status
.bmc_info
.mac
.ok_or_else(|| CarbideError::NotFoundError {
Expand All @@ -1045,7 +1046,7 @@ pub(crate) async fn invoke_power(
.redfish_pool
.create_client(
&bmc_ip,
snapshot.host_snapshot.bmc_info.port,
snapshot.host_snapshot.status.bmc_info.port,
RedfishAuth::Key(CredentialKey::BmcCredentials {
credential_type: BmcCredentialType::BmcRoot { bmc_mac_address },
}),
Expand Down
2 changes: 1 addition & 1 deletion crates/api-core/src/handlers/instance_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ pub(crate) async fn remove_machine_association(
.into());
}

if let Some(ref instance_type_id) = machine.instance_type_id {
if let Some(ref instance_type_id) = machine.config.instance_type_id {
// Query the DB for the instance type so that we can use a row-level lock for coordination.
// We need this so that ComputeAllocation additions and updates that increase allocations can't exceed the number
// of machines associated with a type.
Expand Down
Loading