Skip to content
Open
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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dev-tools/reconfigurator-cli/tests/output/cmds-example-stdout
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ done: <REDACTED_TIMESTAMP>
errors: 0

Sled serial0
part number: model0
part number: 913-0000019
power: A2
revision: 0
MGS slot: Sled 0
Expand All @@ -1344,7 +1344,7 @@ Sled serial0
RoT: slot B SHA3-256: slotBdigest1

Sled serial1
part number: model1
part number: 913-0000019
power: A2
revision: 0
MGS slot: Sled 1
Expand All @@ -1369,7 +1369,7 @@ Sled serial1
RoT: slot B SHA3-256: slotBdigest1

Sled serial2
part number: model2
part number: 913-0000019
power: A2
revision: 0
MGS slot: Sled 2
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

438 changes: 219 additions & 219 deletions dev-tools/reconfigurator-cli/tests/output/cmds-target-release-stdout

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions nexus/reconfigurator/planning/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ oxnet.workspace = true
rand.workspace = true
semver.workspace = true
sled-agent-client.workspace = true
sled-hardware-types.workspace = true
slog.workspace = true
slog-error-chain.workspace = true
sp-sim.workspace = true
Expand Down
18 changes: 15 additions & 3 deletions nexus/reconfigurator/planning/src/mgs_updates/host_phase_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use omicron_common::disk::M2Slot;
use omicron_uuid_kinds::OmicronZoneKind;
use omicron_uuid_kinds::SledUuid;
use omicron_uuid_kinds::TypedUuid;
use sled_hardware_types::OxideSled;
use slog::Logger;
use slog::debug;
use slog::error;
Expand Down Expand Up @@ -378,12 +379,23 @@ pub(super) fn try_make_update(
);
};

let Some(sled_type) = OxideSled::try_from_model(&baseboard_id.part_number)
else {
return Err(FailedHostOsUpdateReason::UnableToDetermineSledModel(
baseboard_id.part_number.clone(),
));
};

let mut phase_1_artifacts = Vec::with_capacity(1);
let mut phase_2_artifacts = Vec::with_capacity(1);
for artifact in &current_artifacts.artifacts {
// TODO-correctness we only support gimlet at the moment, need
// to tell if this target is a gimlet or a comso
if artifact.id.kind == ArtifactKind::GIMLET_HOST_PHASE_1 {
if artifact.id.kind == ArtifactKind::COSMO_HOST_PHASE_1
&& sled_type == OxideSled::Cosmo
{
phase_1_artifacts.push(artifact);
} else if artifact.id.kind == ArtifactKind::GIMLET_HOST_PHASE_1
&& sled_type == OxideSled::Gimlet
{
phase_1_artifacts.push(artifact);
} else if artifact.id.kind == ArtifactKind::HOST_PHASE_2 {
phase_2_artifacts.push(artifact);
Expand Down
3 changes: 2 additions & 1 deletion nexus/reconfigurator/planning/src/mgs_updates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ mod test {
use nexus_types::inventory::CabooseWhich;
use nexus_types::inventory::SpType;
use omicron_test_utils::dev::LogContext;
use sled_hardware_types::GIMLET_SLED_MODEL;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::sync::Arc;
Expand Down Expand Up @@ -932,7 +933,7 @@ mod test {
// each of the sled boards, and report no pending updates
let mut expected_blocked_updates = Vec::new();
for baseboard_id in &collection.baseboards {
if baseboard_id.part_number == "dummy_sled" {
if baseboard_id.part_number == GIMLET_SLED_MODEL {
expected_blocked_updates.push(BlockedMgsUpdate {
baseboard_id: baseboard_id.clone(),
reason: FailedMgsUpdateReason::HostOs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ use omicron_common::api::external::TufRepoMeta;
use omicron_common::disk::M2Slot;
use omicron_common::update::ArtifactId;
use omicron_uuid_kinds::SledUuid;
use sled_hardware_types::GIMLET_SLED_MODEL;
use tufaceous_artifact::ArtifactHash;
use tufaceous_artifact::ArtifactKind;
use tufaceous_artifact::ArtifactVersion;
Expand Down Expand Up @@ -964,7 +965,11 @@ impl<'a> TestBoardCollectionBuilder<'a> {
};

let sp_state = SpState {
model: format!("dummy_{}", sp_id.type_),
// We assume a valid model ID for sleds
model: match sp_id.type_ {
SpType::Sled => GIMLET_SLED_MODEL.to_string(),
_ => format!("dummy_{}", sp_id.type_),
},
serial_number: serial.to_string(),
..dummy_sp_state.clone()
};
Expand Down
3 changes: 2 additions & 1 deletion nexus/reconfigurator/planning/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ use omicron_uuid_kinds::MupdateOverrideUuid;
use omicron_uuid_kinds::OmicronZoneUuid;
use omicron_uuid_kinds::SledUuid;
use omicron_uuid_kinds::ZpoolUuid;
use sled_hardware_types::GIMLET_SLED_MODEL;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::fmt;
Expand Down Expand Up @@ -1271,7 +1272,7 @@ impl Sled {
) -> Sled {
use typed_rng::TypedUuidRng;
let unique = unique.unwrap_or_else(|| hardware_slot.to_string());
let model = format!("model{}", unique);
let model = GIMLET_SLED_MODEL.to_string();
let serial = format!("serial{}", unique);
let revision = 0;
let mut zpool_rng = TypedUuidRng::from_seed(
Expand Down
1 change: 1 addition & 0 deletions nexus/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ schemars = { workspace = true, features = ["chrono", "uuid1", "url"] }
serde.workspace = true
serde_json.workspace = true
serde_with.workspace = true
sled-hardware-types.workspace = true
slog.workspace = true
slog-error-chain.workspace = true
steno.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion nexus/types/src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,7 @@ mod test {
use super::PendingMgsUpdates;
use crate::inventory::BaseboardId;
use gateway_types::component::SpType;
use sled_hardware_types::GIMLET_SLED_MODEL;

#[test]
fn test_serialize_pending_mgs_updates() {
Expand All @@ -2429,7 +2430,7 @@ mod test {
let mut pending_mgs_updates = PendingMgsUpdates::new();
let update = PendingMgsUpdate {
baseboard_id: Arc::new(BaseboardId {
part_number: String::from("913-0000019"),
part_number: String::from(GIMLET_SLED_MODEL),
serial_number: String::from("BRM27230037"),
}),
sp_type: SpType::Sled,
Expand Down
3 changes: 3 additions & 0 deletions nexus/types/src/deployment/planning_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,9 @@ pub enum FailedHostOsUpdateReason {
/// shut down
#[error("sled contains zones that are unsafe to shut down: {0:?}")]
UnsafeZoneFound(String),
/// The sled model could not be determined
#[error("unable to determine the sled model {0:?}")]
UnableToDetermineSledModel(String),
}

#[derive(
Expand Down
19 changes: 19 additions & 0 deletions openapi/nexus-lockstep.json
Original file line number Diff line number Diff line change
Expand Up @@ -4296,6 +4296,25 @@
"type",
"value"
]
},
{
"description": "The sled model could not be determined",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"unable_to_determine_sled_model"
]
},
"value": {
"type": "string"
}
},
"required": [
"type",
"value"
]
}
]
},
Expand Down
7 changes: 5 additions & 2 deletions sled-hardware/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use std::ops::RangeInclusive;

pub mod underlay;

pub const GIMLET_SLED_MODEL: &str = "913-0000019";
pub const COSMO_SLED_MODEL: &str = "913-0000023";

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum OxideSled {
Gimlet,
Expand All @@ -27,8 +30,8 @@ impl OxideSled {

pub fn try_from_model(model: &str) -> Option<Self> {
match model {
"913-0000023" => Some(Self::Cosmo),
"913-0000019" | "913-0000006" => Some(Self::Gimlet),
COSMO_SLED_MODEL => Some(Self::Cosmo),
GIMLET_SLED_MODEL | "913-0000006" => Some(Self::Gimlet),
_ => None,
}
}
Expand Down
Loading