Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d2cfd20
Add libtopo dependency to sled-hardware
smklein Sep 10, 2026
91ff18c
Rename disk "slot" to "pcie_slot" in sled-hardware and Nexus types
smklein Sep 11, 2026
2417ea5
Report each disk's chassis location from the hardware topology
smklein Sep 11, 2026
1f8a88b
Carry disk chassis location through the sled-agent API into inventory
smklein Sep 11, 2026
603073f
Add /usr/lib/fm/amd64 to the illumos runpath for libtopo
smklein Sep 11, 2026
c51a8fa
Give the example inventory disks chassis locations
smklein Sep 11, 2026
62b18e0
Show only the chassis location on the inventory disk line
smklein Sep 11, 2026
e35b60a
Tidy the topo lookup after review
smklein Sep 11, 2026
7ba9b63
Give the planning system builder's disks chassis locations
smklein Sep 11, 2026
a226091
Disk location follow-ups: reconcile late labels, merge topo reads, lo…
smklein Sep 14, 2026
f69fbb6
merge
smklein Sep 16, 2026
7807fec
Use libtopo 0.2.0's hc constants and typed property getter
smklein Sep 16, 2026
901fb2a
Set libtopo's runpath through omicron-rpaths, not .cargo/config.toml
smklein Sep 16, 2026
37dec5e
Read disk locations from topo on every hardware poll
smklein Sep 16, 2026
8eb6538
Rename sled-hardware disk_location.rs to nvme_instance.rs
smklein Sep 16, 2026
831a0ef
Set libtopo's runpath for crates that reach it only via dev-dependencies
smklein Sep 16, 2026
7564f16
Set libtopo's runpath in .cargo/config.toml, not omicron-rpaths
smklein Sep 17, 2026
ce390cc
Give synthetic disks chassis locations that match real hardware
smklein Sep 17, 2026
5219def
Disk location review follow-ups
smklein Sep 17, 2026
15ee23c
Disk location review follow-ups, third round
smklein Sep 17, 2026
8dbe94d
merge
smklein Sep 18, 2026
b253d2e
merge
smklein Oct 8, 2026
ed8b4f3
merge
smklein Oct 16, 2026
d45b283
merge
smklein Oct 20, 2026
6cecf2f
merge
smklein Oct 23, 2026
a1ae16d
merge
smklein Oct 28, 2026
8923b45
merge
smklein Nov 2, 2026
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
27 changes: 23 additions & 4 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ filetime = "0.2.26"
flate2 = "1.1.2"
float-ord = "0.3.2"
flume = "0.11.1"
fmd-adm = { git = "https://github.com/oxidecomputer/fmd-adm", rev = "846361bf0a698a8c7efefd97b2828b9aa74858c4" }
fmd-adm-sys = { git = "https://github.com/oxidecomputer/fmd-adm", rev = "846361bf0a698a8c7efefd97b2828b9aa74858c4" }
fmd-adm = { git = "https://github.com/oxidecomputer/fmd-adm", rev = "5b57d8dd36f96778d0c067ec9647ddde9b58ace7" }
fmd-adm-sys = { git = "https://github.com/oxidecomputer/fmd-adm", rev = "5b57d8dd36f96778d0c067ec9647ddde9b58ace7" }
foreign-types = "0.3.2"
fs-err = "3.1.1"
futures = "0.3.31"
Expand Down Expand Up @@ -589,7 +589,7 @@ hyper-util = "0.1.16"
hyper-rustls = "0.27.7"
hyper-staticfile = "0.10.1"
iddqd = { version = "0.4.2", features = ["daft", "serde", "schemars08"] }
illumos-nvpair = "0.3.0"
illumos-nvpair = "0.4.0"
illumos-nvpair-sys = "0.2.0"
illumos-utils = { path = "illumos-utils" }
iana-time-zone = "0.1.63"
Expand Down Expand Up @@ -619,6 +619,7 @@ libc = "0.2.174"
linkme = "0.3"
libipcc = { git = "https://github.com/oxidecomputer/ipcc-rs", rev = "524eb8f125003dff50b9703900c6b323f00f9e1b" }
libnvme = { git = "https://github.com/oxidecomputer/libnvme", rev = "dd5bb221d327a1bc9287961718c3c10d6bd37da0" }
libtopo = "0.1.0"
linear-map = "1.2.0"
live-tests-macros = { path = "live-tests/macros" }
lldpd_client = { git = "https://github.com/oxidecomputer/lldp", rev = "54b266174d4de9628bca9c97b0db176e16f12154", package = "lldpd-client" }
Expand Down
7 changes: 5 additions & 2 deletions dev-tools/omdb/src/bin/omdb/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7581,7 +7581,9 @@ async fn cmd_db_inventory_physical_disks(
struct DiskRow {
inv_collection_id: Uuid,
sled_id: Uuid,
slot: i64,
pcie_slot: i64,
#[tabled(display_with = "display_option_blank")]
location: Option<String>,
vendor: String,
model: String,
serial: String,
Expand Down Expand Up @@ -7634,7 +7636,8 @@ async fn cmd_db_inventory_physical_disks(
DiskRow {
inv_collection_id: disk.inv_collection_id.into_untyped_uuid(),
sled_id: disk.sled_id.into_untyped_uuid(),
slot: disk.slot,
pcie_slot: disk.pcie_slot,
location: disk.location.clone(),
vendor: disk.vendor,
model: disk.model.clone(),
serial: disk.serial.clone(),
Expand Down
10 changes: 5 additions & 5 deletions installinator/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ impl WriteDestination {
let mut drives = BTreeMap::new();

for disk in hardware.m2_disks() {
let Ok(slot) = M2Slot::try_from(disk.slot()) else {
let Ok(slot) = M2Slot::try_from(disk.pcie_slot()) else {
warn!(
log, "skipping M.2 drive with unexpected slot number";
Comment thread
smklein marked this conversation as resolved.
Resolved
"slot" => disk.slot(),
"pcie_slot" => disk.pcie_slot(),
);
continue;
};
Expand All @@ -136,7 +136,7 @@ impl WriteDestination {
log, "found target M.2 disk";
"identity" => ?disk.identity(),
"path" => disk.devfs_path().as_str(),
"slot" => disk.slot(),
"pcie_slot" => disk.pcie_slot(),
"boot_image_path" => path.as_str(),
"zpool" => %disk.zpool_name(),
);
Expand Down Expand Up @@ -165,7 +165,7 @@ impl WriteDestination {
log, "skipping duplicate M.2 drive entry";
"identity" => ?disk.identity(),
"path" => disk.devfs_path().as_str(),
"slot" => disk.slot(),
"pcie_slot" => disk.pcie_slot(),
"boot_image_path" => path.as_str(),
"zpool" => %disk.zpool_name(),
);
Expand All @@ -178,7 +178,7 @@ impl WriteDestination {
log, "found M.2 disk but failed to find boot image path";
"identity" => ?disk.identity(),
"path" => disk.devfs_path().as_str(),
"slot" => disk.slot(),
"pcie_slot" => disk.pcie_slot(),
"boot_image_path_err" => err,
"zpool" => %disk.zpool_name(),
);
Expand Down
21 changes: 15 additions & 6 deletions nexus/db-model/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2359,11 +2359,17 @@ impl From<InvSvcEnabledNotOnlineState> for SvcEnabledNotOnlineState {
pub struct InvPhysicalDisk {
pub inv_collection_id: DbTypedUuid<CollectionKind>,
pub sled_id: DbTypedUuid<SledKind>,
pub slot: i64,
/// See [`nexus_types::inventory::PhysicalDisk::pcie_slot`]. The column
/// keeps its original name because columns cannot be renamed
/// idempotently.
Comment thread
smklein marked this conversation as resolved.
Resolved
#[diesel(column_name = slot)]
pub pcie_slot: i64,
pub vendor: String,
pub model: String,
pub serial: String,
pub variant: PhysicalDiskKind,
/// See [`nexus_types::inventory::PhysicalDisk::location`].
pub location: Option<String>,
}

impl InvPhysicalDisk {
Expand All @@ -2375,11 +2381,12 @@ impl InvPhysicalDisk {
Self {
inv_collection_id: inv_collection_id.into(),
sled_id: sled_id.into(),
slot: disk.slot,
pcie_slot: disk.pcie_slot,
vendor: disk.identity.vendor,
model: disk.identity.model,
serial: disk.identity.serial,
variant: disk.variant.into(),
location: disk.location,
}
}
}
Expand Down Expand Up @@ -2410,7 +2417,9 @@ pub enum InvNvmeDiskFirmwareError {
pub struct InvNvmeDiskFirmware {
inv_collection_id: DbTypedUuid<CollectionKind>,
sled_id: DbTypedUuid<SledKind>,
slot: i64,
/// See [`InvPhysicalDisk::pcie_slot`].
Comment thread
smklein marked this conversation as resolved.
Resolved
#[diesel(column_name = slot)]
pcie_slot: i64,
active_slot: SqlU8,
next_active_slot: Option<SqlU8>,
number_of_slots: SqlU8,
Expand Down Expand Up @@ -2496,7 +2505,7 @@ impl InvNvmeDiskFirmware {
Ok(Self {
inv_collection_id: inv_collection_id.into(),
sled_id: sled_id.into(),
slot: sled_slot,
pcie_slot: sled_slot,
active_slot: firmware.active_slot.into(),
next_active_slot: firmware.next_active_slot.map(|nas| nas.into()),
number_of_slots: firmware.number_of_slots.into(),
Expand Down Expand Up @@ -2538,8 +2547,8 @@ impl InvNvmeDiskFirmware {
self.sled_id
}

pub fn slot(&self) -> i64 {
self.slot
pub fn pcie_slot(&self) -> i64 {
self.pcie_slot
}

pub fn number_of_slots(&self) -> SqlU8 {
Expand Down
3 changes: 2 additions & 1 deletion nexus/db-model/src/schema_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{collections::BTreeMap, sync::LazyLock};
///
/// This must be updated when you change the database schema. Refer to
/// schema/crdb/README.adoc in the root of this repository for details.
pub const SCHEMA_VERSION: Version = Version::new(299, 0, 0);
pub const SCHEMA_VERSION: Version = Version::new(300, 0, 0);

/// List of all past database schema versions, in *reverse* order
///
Expand All @@ -28,6 +28,7 @@ pub static KNOWN_VERSIONS: LazyLock<Vec<KnownVersion>> = LazyLock::new(|| {
// | leaving the first copy as an example for the next person.
// v
// KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"),
KnownVersion::new(300, "inv-physical-disk-location"),
KnownVersion::new(299, "blueprint-pruner-config"),
KnownVersion::new(298, "blueprint-zone-multiple-external-ips"),
KnownVersion::new(297, "inventory-zone-multiple-external-ips"),
Expand Down
16 changes: 9 additions & 7 deletions nexus/db-queries/src/db/datastore/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl DataStore {
InvNvmeDiskFirmware::new(
collection_id,
sled_agent.sled_id,
disk.slot,
disk.pcie_slot,
firmware,
)
.map_err(|e| {
Expand Down Expand Up @@ -3092,14 +3092,15 @@ impl DataStore {
.map_err(|e| {
public_error_from_diesel(e, ErrorHandler::Server)
})?;
paginator =
p.found_batch(&batch, &|row| (row.sled_id(), row.slot()));
paginator = p.found_batch(&batch, &|row| {
(row.sled_id(), row.pcie_slot())
});
for firmware in batch {
disk_firmware
.entry(firmware.sled_id().into())
.or_default()
.insert(
firmware.slot(),
firmware.pcie_slot(),
nexus_types::inventory::PhysicalDiskFirmware::from(
firmware,
),
Expand Down Expand Up @@ -3138,12 +3139,12 @@ impl DataStore {
public_error_from_diesel(e, ErrorHandler::Server)
})?;
paginator =
p.found_batch(&batch, &|row| (row.sled_id, row.slot));
p.found_batch(&batch, &|row| (row.sled_id, row.pcie_slot));
Comment thread
smklein marked this conversation as resolved.
Resolved
for disk in batch {
let sled_id = disk.sled_id.into();
let firmware = disk_firmware
.get(&sled_id)
.and_then(|lookup| lookup.get(&disk.slot))
.and_then(|lookup| lookup.get(&disk.pcie_slot))
.unwrap_or(&nexus_types::inventory::PhysicalDiskFirmware::Unknown);

disks.entry(sled_id).or_default().push(
Expand All @@ -3154,7 +3155,8 @@ impl DataStore {
serial: disk.serial,
},
variant: disk.variant.into(),
slot: disk.slot,
pcie_slot: disk.pcie_slot,
location: disk.location,
firmware: firmware.clone(),
},
);
Expand Down
6 changes: 4 additions & 2 deletions nexus/db-queries/src/db/datastore/physical_disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,8 @@ mod test {
model: "model".to_string(),
},
variant: DiskVariant::U2,
slot,
pcie_slot: slot,
location: None,
active_firmware_slot: 1,
next_active_firmware_slot: None,
number_of_firmware_slots: 1,
Expand Down Expand Up @@ -1183,7 +1184,8 @@ mod test {
serial: inv_phys_disk.serial.clone(),
},
variant: inv_phys_disk.variant.into(),
slot: inv_phys_disk.slot,
pcie_slot: inv_phys_disk.pcie_slot,
location: inv_phys_disk.location.clone(),
firmware: PhysicalDiskFirmware::Nvme(NvmeFirmware {
active_slot: inv_disk.active_firmware_slot,
next_active_slot: inv_disk.next_active_firmware_slot,
Expand Down
2 changes: 2 additions & 0 deletions nexus/db-schema/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2078,6 +2078,8 @@ table! {
serial -> Text,

variant -> crate::enums::PhysicalDiskKindEnum,

location -> Nullable<Text>,
}
}

Expand Down
12 changes: 8 additions & 4 deletions nexus/inventory/src/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ pub fn representative() -> Representative {
serial: "XXIV".to_string(),
},
variant: DiskVariant::M2,
slot: 0,
pcie_slot: 0,
location: None,
Comment thread
smklein marked this conversation as resolved.
Resolved
active_firmware_slot: 1,
next_active_firmware_slot: None,
number_of_firmware_slots: 1,
Expand All @@ -502,7 +503,8 @@ pub fn representative() -> Representative {
serial: "0001".to_string(),
},
variant: DiskVariant::U2,
slot: 1,
pcie_slot: 1,
location: None,
Comment thread
smklein marked this conversation as resolved.
Resolved
active_firmware_slot: 1,
next_active_firmware_slot: None,
number_of_firmware_slots: 1,
Expand All @@ -516,7 +518,8 @@ pub fn representative() -> Representative {
serial: "0002".to_string(),
},
variant: DiskVariant::U2,
slot: 2,
pcie_slot: 2,
location: None,
Comment thread
smklein marked this conversation as resolved.
Resolved
active_firmware_slot: 1,
next_active_firmware_slot: None,
number_of_firmware_slots: 1,
Expand All @@ -530,7 +533,8 @@ pub fn representative() -> Representative {
serial: "5".to_string(),
},
variant: DiskVariant::U2,
slot: 3,
pcie_slot: 3,
location: None,
Comment thread
smklein marked this conversation as resolved.
Resolved
active_firmware_slot: 1,
next_active_firmware_slot: None,
number_of_firmware_slots: 1,
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 @@ -1535,7 +1535,8 @@ impl Sled {
.map(|(i, disk)| InventoryDisk {
identity: disk.disk_identity.clone(),
variant: DiskVariant::U2,
slot: i64::try_from(i).unwrap(),
pcie_slot: i64::try_from(i).unwrap(),
location: None,
active_firmware_slot: 1,
next_active_firmware_slot: None,
number_of_firmware_slots: 1,
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6903,7 +6903,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
.into_iter()
.map(|d| UnadoptedPhysicalDisk {
sled_id: d.sled_id.into(),
slot: d.slot,
slot: d.pcie_slot,
variant: d.variant.into(),
disk_id: PhysicalDiskManufacturerIdentity {
vendor: d.vendor,
Expand Down
Loading
Loading