Skip to content

Commit e97647d

Browse files
authored
Local storage [1/4]: add local_storage dataset (#9264)
To implement RFD 590, Propolis will use a delegated ZVOL as a file backed NVMe device. This PR creates a new "local_storage" dataset that can be used for this purpose on every zpool in the rack. This is created under the `crypt` parent so that the delegated storage is encrypted at rest. This is done with the planner instead of adding to U2_EXPECTED_DATASETS, and this required changing a bunch of tests that were assuming a specific number of datasets per pool, along with a whole whack of tests that use expectorate.
1 parent ac4ec36 commit e97647d

File tree

66 files changed

+8702
-6385
lines changed

Some content is hidden

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

66 files changed

+8702
-6385
lines changed

common/src/api/internal/shared.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,9 @@ pub enum DatasetKind {
943943

944944
// Other datasets
945945
Debug,
946+
947+
/// Used for transient storage, contains volumes delegated to VMMs
948+
LocalStorage,
946949
}
947950

948951
impl Serialize for DatasetKind {
@@ -1003,7 +1006,10 @@ impl DatasetKind {
10031006
match self {
10041007
Cockroach | Crucible | Clickhouse | ClickhouseKeeper
10051008
| ClickhouseServer | ExternalDns | InternalDns => true,
1009+
10061010
TransientZoneRoot | TransientZone { .. } | Debug => false,
1011+
1012+
LocalStorage => true,
10071013
}
10081014
}
10091015

@@ -1041,6 +1047,7 @@ impl fmt::Display for DatasetKind {
10411047
return Ok(());
10421048
}
10431049
Debug => "debug",
1050+
LocalStorage => "local_storage",
10441051
};
10451052
write!(f, "{}", s)
10461053
}
@@ -1067,6 +1074,7 @@ impl FromStr for DatasetKind {
10671074
"internal_dns" => InternalDns,
10681075
"zone" => TransientZoneRoot,
10691076
"debug" => Debug,
1077+
"local_storage" => LocalStorage,
10701078
other => {
10711079
if let Some(name) = other.strip_prefix("zone/") {
10721080
TransientZone { name: name.to_string() }
@@ -1162,6 +1170,7 @@ mod tests {
11621170
DatasetKind::TransientZoneRoot,
11631171
DatasetKind::TransientZone { name: String::from("myzone") },
11641172
DatasetKind::Debug,
1173+
DatasetKind::LocalStorage,
11651174
];
11661175

11671176
assert_eq!(kinds.len(), DatasetKind::COUNT);

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

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ use nexus_types::deployment::OximeterReadPolicy;
5353
use nexus_types::internal_api::background::AbandonedVmmReaperStatus;
5454
use nexus_types::internal_api::background::BlueprintPlannerStatus;
5555
use nexus_types::internal_api::background::BlueprintRendezvousStatus;
56+
use nexus_types::internal_api::background::DatasetsRendezvousStats;
5657
use nexus_types::internal_api::background::EreporterStatus;
5758
use nexus_types::internal_api::background::InstanceReincarnationStatus;
5859
use nexus_types::internal_api::background::InstanceUpdaterStatus;
@@ -1477,6 +1478,26 @@ fn print_task_blueprint_loader(details: &serde_json::Value) {
14771478
}
14781479
}
14791480

1481+
fn print_datasets_rendezvous_stats(
1482+
stats: &DatasetsRendezvousStats,
1483+
dataset_name: &'static str,
1484+
) {
1485+
let DatasetsRendezvousStats {
1486+
num_inserted,
1487+
num_already_exist,
1488+
num_not_in_inventory,
1489+
num_tombstoned,
1490+
num_already_tombstoned,
1491+
} = stats;
1492+
1493+
println!(" {dataset_name} rendezvous counts:");
1494+
println!(" num_inserted: {num_inserted}");
1495+
println!(" num_already_exist: {num_already_exist}");
1496+
println!(" num_not_in_inventory: {num_not_in_inventory}");
1497+
println!(" num_tombstoned: {num_tombstoned}");
1498+
println!(" num_already_tombstoned: {num_already_tombstoned}");
1499+
}
1500+
14801501
fn print_task_blueprint_rendezvous(details: &serde_json::Value) {
14811502
match serde_json::from_value::<BlueprintRendezvousStatus>(details.clone()) {
14821503
Err(error) => eprintln!(
@@ -1489,27 +1510,13 @@ fn print_task_blueprint_rendezvous(details: &serde_json::Value) {
14891510
" inventory collection: {}",
14901511
status.inventory_collection_id
14911512
);
1492-
println!(" debug_dataset rendezvous counts:");
1493-
println!(
1494-
" num_inserted: {}",
1495-
status.stats.debug_dataset.num_inserted
1496-
);
1497-
println!(
1498-
" num_already_exist: {}",
1499-
status.stats.debug_dataset.num_already_exist
1500-
);
1501-
println!(
1502-
" num_not_in_inventory: {}",
1503-
status.stats.debug_dataset.num_not_in_inventory
1504-
);
1505-
println!(
1506-
" num_tombstoned: {}",
1507-
status.stats.debug_dataset.num_tombstoned
1508-
);
1509-
println!(
1510-
" num_already_tombstoned: {}",
1511-
status.stats.debug_dataset.num_already_tombstoned
1513+
1514+
print_datasets_rendezvous_stats(
1515+
&status.stats.debug_dataset,
1516+
"debug_dataset",
15121517
);
1518+
1519+
// crucible datasets have a different number of rendezvous stats
15131520
println!(" crucible_dataset rendezvous counts:");
15141521
println!(
15151522
" num_inserted: {}",
@@ -1523,6 +1530,11 @@ fn print_task_blueprint_rendezvous(details: &serde_json::Value) {
15231530
" num_not_in_inventory: {}",
15241531
status.stats.crucible_dataset.num_not_in_inventory
15251532
);
1533+
1534+
print_datasets_rendezvous_stats(
1535+
&status.stats.local_storage_dataset,
1536+
"local_storage_dataset",
1537+
);
15261538
}
15271539
}
15281540
}

dev-tools/omdb/tests/successes.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,12 @@ task: "blueprint_rendezvous"
580580
num_inserted: 0
581581
num_already_exist: 0
582582
num_not_in_inventory: 0
583+
local_storage_dataset rendezvous counts:
584+
num_inserted: 0
585+
num_already_exist: 0
586+
num_not_in_inventory: 0
587+
num_tombstoned: 0
588+
num_already_tombstoned: 0
583589

584590
task: "crdb_node_id_collector"
585591
configured period: every <REDACTED_DURATION>m
@@ -1115,6 +1121,12 @@ task: "blueprint_rendezvous"
11151121
num_inserted: 0
11161122
num_already_exist: 0
11171123
num_not_in_inventory: 0
1124+
local_storage_dataset rendezvous counts:
1125+
num_inserted: 0
1126+
num_already_exist: 0
1127+
num_not_in_inventory: 0
1128+
num_tombstoned: 0
1129+
num_already_tombstoned: 0
11181130

11191131
task: "crdb_node_id_collector"
11201132
configured period: every <REDACTED_DURATION>m

0 commit comments

Comments
 (0)