Skip to content

Commit 370c959

Browse files
committed
Merge branch 'main' into planning-reports
2 parents dcac3dd + 444761e commit 370c959

File tree

113 files changed

+7930
-1847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+7930
-1847
lines changed

Cargo.lock

Lines changed: 19 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ omicron-workspace-hack = "0.1.0"
580580
omicron-zone-package = "0.12.2"
581581
oxide-client = { path = "clients/oxide-client" }
582582
oxide-tokio-rt = "0.1.2"
583-
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "2d095de2258aa0653d669b72c741f26e608c81a6", features = [ "api", "std" ] }
583+
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "6a5d3f336685a2aeb291962ae7f583b9355f3022", features = [ "api", "std" ] }
584584
oxlog = { path = "dev-tools/oxlog" }
585585
oxnet = "0.1.3"
586586
once_cell = "1.21.3"
@@ -590,7 +590,7 @@ openapiv3 = "2.2.0"
590590
# must match samael's crate!
591591
openssl = "0.10"
592592
openssl-sys = "0.9"
593-
opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "2d095de2258aa0653d669b72c741f26e608c81a6" }
593+
opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "6a5d3f336685a2aeb291962ae7f583b9355f3022" }
594594
oso = "0.27"
595595
owo-colors = "4.2.2"
596596
oximeter = { path = "oximeter/oximeter" }
@@ -969,6 +969,7 @@ opt-level = 3
969969
# tufaceous-artifact = { path = "../tufaceous/artifact" }
970970
# tufaceous-brand-metadata = { path = "../tufaceous/brand-metadata" }
971971
# tufaceous-lib = { path = "../tufaceous/lib" }
972+
# Extra slash here to pretend to be a different source.
972973

973974
# [patch."https://github.com/oxidecomputer/typify"]
974975
# typify = { path = "../typify/typify" }

clients/sled-agent-client/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ progenitor::generate_api!(
6262
InventoryDisk = nexus_sled_agent_shared::inventory::InventoryDisk,
6363
InventoryZpool = nexus_sled_agent_shared::inventory::InventoryZpool,
6464
MacAddr = omicron_common::api::external::MacAddr,
65+
MupdateOverrideBootInventory = nexus_sled_agent_shared::inventory::MupdateOverrideBootInventory,
6566
Name = omicron_common::api::external::Name,
6667
NetworkInterface = omicron_common::api::internal::shared::NetworkInterface,
6768
OmicronPhysicalDiskConfig = omicron_common::disk::OmicronPhysicalDiskConfig,

common/src/disk.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,34 @@ pub enum M2Slot {
626626
B,
627627
}
628628

629+
impl M2Slot {
630+
/// Flip from `A` to `B` or vice versa.
631+
pub fn toggled(self) -> Self {
632+
match self {
633+
Self::A => Self::B,
634+
Self::B => Self::A,
635+
}
636+
}
637+
638+
/// Convert this slot to an MGS "firmware slot" index.
639+
pub fn to_mgs_firmware_slot(self) -> u16 {
640+
match self {
641+
Self::A => 0,
642+
Self::B => 1,
643+
}
644+
}
645+
646+
/// Convert a putative MGS "firmware slot" index to an `M2Slot`, returning
647+
/// `None` if `slot` is invalid.
648+
pub fn from_mgs_firmware_slot(slot: u16) -> Option<Self> {
649+
match slot {
650+
0 => Some(Self::A),
651+
1 => Some(Self::B),
652+
_ => None,
653+
}
654+
}
655+
}
656+
629657
impl fmt::Display for M2Slot {
630658
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
631659
match self {

dev-tools/omdb/src/bin/omdb/db/ereport.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ async fn cmd_db_ereport_list(
155155
restart_id: restart_id.into_untyped_uuid(),
156156
ena: ena.into(),
157157
class: class.clone(),
158-
source: db::model::Reporter::Sp { sp_type, slot: sp_slot.0 },
158+
source: db::model::Reporter::Sp {
159+
sp_type: sp_type.into(),
160+
slot: sp_slot.0,
161+
},
159162
serial: serial_number.as_deref(),
160163
part_number: part_number.as_deref(),
161164
}
@@ -547,7 +550,10 @@ async fn cmd_db_ereporters(
547550
)| {
548551
ReporterRow {
549552
first_seen,
550-
identity: db::model::Reporter::Sp { slot: slot.0, sp_type },
553+
identity: db::model::Reporter::Sp {
554+
slot: slot.0,
555+
sp_type: sp_type.into(),
556+
},
551557
serial,
552558
part_number,
553559
id: restart_id,

dev-tools/omdb/src/bin/omdb/nexus.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ use nexus_types::internal_api::background::RegionSnapshotReplacementStartStatus;
6666
use nexus_types::internal_api::background::RegionSnapshotReplacementStepStatus;
6767
use nexus_types::internal_api::background::SupportBundleCleanupReport;
6868
use nexus_types::internal_api::background::SupportBundleCollectionReport;
69+
use nexus_types::internal_api::background::SupportBundleEreportStatus;
6970
use nexus_types::internal_api::background::TufArtifactReplicationCounters;
7071
use nexus_types::internal_api::background::TufArtifactReplicationRequest;
7172
use nexus_types::internal_api::background::TufArtifactReplicationStatus;
@@ -2415,6 +2416,8 @@ fn print_task_support_bundle_collector(details: &serde_json::Value) {
24152416
listed_in_service_sleds,
24162417
listed_sps,
24172418
activated_in_db_ok,
2419+
sp_ereports,
2420+
host_ereports,
24182421
}) = collection_report
24192422
{
24202423
println!(" Support Bundle Collection Report:");
@@ -2428,6 +2431,26 @@ fn print_task_support_bundle_collector(details: &serde_json::Value) {
24282431
println!(
24292432
" Bundle was activated in the database: {activated_in_db_ok}"
24302433
);
2434+
print_ereport_status("SP", &sp_ereports);
2435+
print_ereport_status("Host OS", &host_ereports);
2436+
}
2437+
}
2438+
}
2439+
2440+
fn print_ereport_status(which: &str, status: &SupportBundleEreportStatus) {
2441+
match status {
2442+
SupportBundleEreportStatus::NotRequested => {
2443+
println!(" {which} ereport collection was not requested");
2444+
}
2445+
SupportBundleEreportStatus::Failed { error, n_collected } => {
2446+
println!(" {which} ereport collection failed:");
2447+
println!(
2448+
" ereports collected successfully: {n_collected}"
2449+
);
2450+
println!(" error: {error}");
2451+
}
2452+
SupportBundleEreportStatus::Collected { n_collected } => {
2453+
println!(" {which} ereports collected: {n_collected}");
24312454
}
24322455
}
24332456
}

dev-tools/omdb/tests/successes.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ SPs FOUND THROUGH IGNITION
110110
SERVICE PROCESSOR STATES
111111

112112
TYPE SLOT MODEL SERIAL REV HUBRIS PWR ROT_ACTIVE
113-
Sled 0 i86pc SimGimlet00 0 0000000000000000 A2 slot A
114-
Sled 1 i86pc SimGimlet01 0 0000000000000000 A2 slot A
113+
Sled 0 i86pc SimGimlet00 0 0000000000000000 A0 slot A
114+
Sled 1 i86pc SimGimlet01 0 0000000000000000 A0 slot A
115115
Switch 0 FAKE_SIM_SIDECAR SimSidecar0 0 0000000000000000 A2 slot A
116116
Switch 1 FAKE_SIM_SIDECAR SimSidecar1 0 0000000000000000 A2 slot A
117117

dev-tools/reconfigurator-cli/src/lib.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
use anyhow::{Context, anyhow, bail};
88
use camino::{Utf8Path, Utf8PathBuf};
9+
use chrono::{DateTime, Utc};
910
use clap::{ArgAction, ValueEnum};
1011
use clap::{Args, Parser, Subcommand};
1112
use daft::Diffable;
@@ -1077,6 +1078,27 @@ enum SetArgs {
10771078
},
10781079
/// planner chicken switches
10791080
ChickenSwitches(SetChickenSwitchesArgs),
1081+
/// timestamp for ignoring impossible MGS updates
1082+
IgnoreImpossibleMgsUpdatesSince {
1083+
since: SetIgnoreImpossibleMgsUpdatesSinceArgs,
1084+
},
1085+
}
1086+
1087+
#[derive(Debug, Clone)]
1088+
struct SetIgnoreImpossibleMgsUpdatesSinceArgs(DateTime<Utc>);
1089+
1090+
impl FromStr for SetIgnoreImpossibleMgsUpdatesSinceArgs {
1091+
type Err = anyhow::Error;
1092+
1093+
fn from_str(s: &str) -> Result<Self, Self::Err> {
1094+
if s.eq_ignore_ascii_case("now") {
1095+
return Ok(Self(Utc::now()));
1096+
}
1097+
if let Ok(datetime) = humantime::parse_rfc3339(s) {
1098+
return Ok(Self(datetime.into()));
1099+
}
1100+
bail!("invalid timestamp: expected `now` or an RFC3339 timestamp")
1101+
}
10801102
}
10811103

10821104
#[derive(Debug, Args)]
@@ -2394,6 +2416,16 @@ fn cmd_set(
23942416
)
23952417
}
23962418
}
2419+
SetArgs::IgnoreImpossibleMgsUpdatesSince { since } => {
2420+
state
2421+
.system_mut()
2422+
.description_mut()
2423+
.set_ignore_impossible_mgs_updates_since(since.0);
2424+
format!(
2425+
"ignoring impossible MGS updates since {}",
2426+
humantime::format_rfc3339_millis(since.0.into())
2427+
)
2428+
}
23972429
};
23982430

23992431
sim.commit_and_bump(format!("reconfigurator-cli set: {}", rv), state);

0 commit comments

Comments
 (0)