Skip to content

Commit 5f2f06d

Browse files
authored
[sled-agent] Read boot partition of M.2 drives (PR 1/2) (#8450)
This PR is basically just adding the `host_phase_2` module to `sled-agent-config-reconciler`, which reads the boot partition of the two M.2 slots (using multiple-of-the-disk-block-size reads, which are required when accessing the raw device). The results of these reads is only logged as of this PR; the followup adds it to inventory. There are a handful of other cleanup changes that snuck in here due to dropping an out-of-date `#![allow(dead_code)]`.
1 parent d4cf01a commit 5f2f06d

File tree

12 files changed

+547
-27
lines changed

12 files changed

+547
-27
lines changed

Cargo.lock

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

sled-agent/config-reconciler/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ workspace = true
1010
[dependencies]
1111
anyhow.workspace = true
1212
async-trait.workspace = true
13+
bytes.workspace = true
1314
camino.workspace = true
1415
camino-tempfile.workspace = true
1516
chrono.workspace = true
@@ -27,6 +28,7 @@ nexus-sled-agent-shared.workspace = true
2728
omicron-common.workspace = true
2829
omicron-uuid-kinds.workspace = true
2930
serde.workspace = true
31+
sha2.workspace = true
3032
sled-agent-api.workspace = true
3133
sled-agent-types.workspace = true
3234
sled-hardware.workspace = true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Seeds for failure cases proptest has generated in the past. It is
2+
# automatically read and these particular cases re-run before any
3+
# novel cases are generated.
4+
#
5+
# It is recommended to check this file in to source control so that
6+
# everyone who runs the test benefits from these saved cases.
7+
cc dae3bb9081ff9f94d9c588fb2d535df1ef72b8af5169dc8bc5072ee99e6ee72b # shrinks to input = _ProptestReadValidHostPhase2Args { data: [], block_size: 512 }

sled-agent/config-reconciler/src/dataset_serialization_task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub(crate) struct DatasetTaskHandle(mpsc::Sender<DatasetTaskRequest>);
180180
impl DatasetTaskHandle {
181181
// For testing, create a handle on which requests will always fail with a
182182
// `DatasetTaskError`.
183-
#[cfg(any(test, feature = "testing"))]
183+
#[cfg(test)]
184184
pub(crate) fn spawn_noop() -> Self {
185185
let (tx, _rx) = mpsc::channel(1);
186186
Self(tx)

sled-agent/config-reconciler/src/handle.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ impl ConfigReconcilerHandle {
242242
current_config_rx,
243243
reconciler_result_tx,
244244
currently_managed_zpools_tx,
245+
self.internal_disks_rx.clone(),
245246
external_disks_tx,
246247
raw_disks_rx,
247248
Arc::clone(&self.destroy_orphans),
@@ -420,16 +421,6 @@ impl ConfigReconcilerHandle {
420421
}
421422
}
422423

423-
#[derive(Debug)]
424-
struct ReconcilerTaskDependencies {
425-
key_requester: StorageKeyRequester,
426-
time_sync_config: TimeSyncConfig,
427-
reconciler_result_tx: watch::Sender<ReconcilerResult>,
428-
currently_managed_zpools_tx: watch::Sender<Arc<CurrentlyManagedZpools>>,
429-
ledger_task_log: Logger,
430-
reconciler_task_log: Logger,
431-
}
432-
433424
/// Fields of sled-agent inventory reported by the config reconciler subsystem.
434425
///
435426
/// Note that much like inventory in general, these fields are not collected

0 commit comments

Comments
 (0)