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
1 change: 1 addition & 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 @@ -1316,7 +1316,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 @@ -1341,7 +1341,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 @@ -1366,7 +1366,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.

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

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 @@ -20,6 +20,7 @@ use omicron_common::api::external::TufArtifactMeta;
use omicron_common::api::external::TufRepoDescription;
use omicron_common::disk::M2Slot;
use omicron_uuid_kinds::SledUuid;
use sled_hardware_types::OxideSled;
use slog::Logger;
use slog::debug;
use slog::error;
Expand Down Expand Up @@ -371,12 +372,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
2 changes: 1 addition & 1 deletion nexus/reconfigurator/planning/src/mgs_updates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,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 == "913-0000019" {
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 @@ -964,7 +964,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 => "913-0000019".to_string(),
_ => format!("dummy_{}", sp_id.type_),
},
serial_number: serial.to_string(),
..dummy_sp_state.clone()
};
Expand Down
2 changes: 1 addition & 1 deletion nexus/reconfigurator/planning/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,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 = "913-0000019".to_string();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a cosmo or gimlet model? I see it's used in several places. it would be really nice to have it as a constant so we know to use it where necessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I see it's for a gimlet. Can it be something like const DEFAULT_GIMLET_MODEL: &str = "913-0000019" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the gimlet model. A constant is a good idea!

let serial = format!("serial{}", unique);
let revision = 0;
let mut zpool_rng = TypedUuidRng::from_seed(
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 @@ -685,6 +685,9 @@ pub enum FailedHostOsUpdateReason {
/// details
#[error("sled agent was unable to retrieve boot disk phase 2 image: {0:?}")]
UnableToRetrieveBootDiskPhase2Image(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-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -3517,6 +3517,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
19 changes: 19 additions & 0 deletions openapi/nexus-lockstep.json
Original file line number Diff line number Diff line change
Expand Up @@ -3755,6 +3755,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
Loading