Skip to content

Identify M.2 A/B and the boot disk from chassis labels - #11591

Draft
smklein wants to merge 6 commits into
topo-disk-scanfrom
m2-slot-from-label
Draft

smklein wants to merge 6 commits into
topo-disk-scanfrom
m2-slot-from-label

Conversation

@smklein

@smklein smklein commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #11590.

M2Slot::from_chassis_location maps "M.2 East" to A and "M.2 West" to B. Sled-agent and installinator now use it everywhere they turn an M.2 into A or B:

  • the slot sled-agent reports for each M.2, and installinator's write targets (this replaces the TryFrom<i64> impl keyed on PCIe slot numbers 0x11/0x12)
  • which M.2 is the boot disk: the boot-storage-unit property says whether the host booted from A or B, and sled-hardware now matches that against each socket's label instead of OxideSled::bootdisk_pcie_slots, which is removed

Those PCIe numbers are internal to the board and may change across host OS versions. The chassis labels are what the topology promises. On Gimlet and Cosmo the two mappings agree. Using one mapping for both also means the reported boot slot and the boot disk can't disagree. With this change, disk discovery in sled-hardware no longer depends on which board it's running on.

The East→A / West→B pairing is still board knowledge that lives in omicron, though it's now written in terms of labels rather than PCIe numbers.

Synthetic M.2s (m2_0/m2_1) are labelled East and West, so they now get slots A and B. Before, their offset PCIe slots matched neither. On a4x2 this changes which host phase 2 error is reported; that check still fails.

Testing: unit tests for the label mapping and for boot-disk selection (East/West × A/B, and U.2 bays); sled-hardware and installinator build and pass tests on illumos. Tested on london via mupdate (installinator works, sled agent is able to identify boot disk via label).

M2Slot::from_chassis_location maps "M.2 East" to A and "M.2 West" to B,
replacing the TryFrom<i64> impl that keyed on the PCIe slot numbers of
the bridges above the M.2 sockets. Those numbers are internal to the
board and may change across host OS versions; the chassis labels are
what the hardware topology promises. On Gimlet and Cosmo the two
mappings agree, so real sleds see no change.

Synthetic M.2s named m2_0 and m2_1 are labelled East and West, so they
now get slots A and B where before their offset PCIe slots matched
neither.
@smklein

smklein commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

The boot-storage-unit property says whether the host booted from A or B.
Match that against each M.2 socket's label, as M2Slot already does for
the slot sled-agent reports, rather than against a per-board table of
PCIe slot numbers. Removes OxideSled::bootdisk_pcie_slots.
@smklein smklein changed the title Pick an M.2's A/B slot from its chassis label Identify M.2 A/B and the boot disk from chassis labels Oct 28, 2026
@smklein

smklein commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I reviewed the latest push and found no new bugs. Boot-disk detection now uses the chassis label, the same source as the reported slot. This changes how a sled finds its boot disk, and the PR notes it hasn't run on real hardware yet, so a human look would still be worthwhile.

What was reviewed:

  • classify_bay now sets is_boot_disk only for an M.2 bay whose label maps through from_chassis_location to the boot storage unit. U.2 bays and unknown labels never qualify, and the new test covers each of these cases.
  • boot_storage_unit_from_property keeps the 0x41/0x42 mapping and its error path. Dropping sled_type from read_bays/poll_bay still leaves the not-an-Oxide-sled check in place.
  • installinator's WriteDestination and InternalDiskDetails.slot both use the label mapping, so they agree with boot-disk selection.
Extended reasoning...

The change touches M.2 slot and boot-disk identification in sled-hardware, sled-agent's config-reconciler, sled-agent types and installinator. It moves both from PCIe slot numbers to the chassis labels "M.2 East" and "M.2 West". It touches no auth, crypto or data-exposure surface. Since the earlier review, new commits route boot-disk selection through the same label mapping as the reported slot. The change still decides which physical drive a sled treats as its boot disk and where installinator writes, and the PR says it has not been run on real hardware.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant