Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reconfigurator] Decommission sleds #5698

Merged
merged 21 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
adec837
Add sled_state map to blueprints
jgallagher Apr 29, 2024
ab67000
update blueprint db serialization
jgallagher Apr 29, 2024
6faa77e
expectorate openapi
jgallagher Apr 29, 2024
e985d91
schema migration: backfill sled states for past blueprints
jgallagher Apr 29, 2024
d795f57
Merge branch 'main' into john/blueprint-store-sled-state
jgallagher May 1, 2024
0330f88
comment cleanup
jgallagher May 1, 2024
ae4f771
expectorate comment update
jgallagher May 1, 2024
4949eac
rework VPC/blueprint resolution test to use BlueprintBuilder
jgallagher May 1, 2024
36fde78
rename SledFilter::All -> ::Commissioned, omitting decommissioned sleds
jgallagher May 2, 2024
036f030
planner: mark sleds decommissioned
jgallagher May 2, 2024
aa715ad
add basic test for marking sleds decommissioned
jgallagher May 2, 2024
6eadb5f
decommissioning a sled decommissions its disks
jgallagher May 3, 2024
30bff33
blueprint realization: decommission sleds
jgallagher May 3, 2024
e6e6fef
prune fully decommissioned sleds from blueprints
jgallagher May 3, 2024
f1ce720
Merge branch 'main' into john/blueprint-store-sled-state
jgallagher May 6, 2024
7aabc98
Merge branch 'john/blueprint-store-sled-state' into john/mark-sleds-d…
jgallagher May 6, 2024
51e38c5
Merge branch 'main' into john/mark-sleds-decommissioned
jgallagher May 13, 2024
8d08368
clarify omdb db sleds output
jgallagher May 13, 2024
64e8660
clarify BlueprintBuilder::into_zones_map()
jgallagher May 13, 2024
de8a027
minor cleanup from PR feedback
jgallagher May 13, 2024
1e629df
planner: finding a decommissioned sleds with non-expunged zones is an…
jgallagher May 13, 2024
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
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 @@ -1455,8 +1455,11 @@ async fn cmd_db_sleds(
let filter = match args.filter {
Some(filter) => filter,
None => {
eprintln!("note: listing all sleds (use -F to filter, e.g. -F in-service)");
SledFilter::All
eprintln!(
"note: listing all commissioned sleds \
(use -F to filter, e.g. -F in-service)"
);
SledFilter::Commissioned
}
};

Expand Down
6 changes: 3 additions & 3 deletions dev-tools/omdb/tests/env.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stdout:
stderr:
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
note: database schema version matches expected (<redacted database version>)
note: listing all sleds (use -F to filter, e.g. -F in-service)
note: listing all commissioned sleds (use -F to filter, e.g. -F in-service)
=============================================
EXECUTING COMMAND: omdb ["db", "--db-url", "junk", "sleds"]
termination: Exited(2)
Expand Down Expand Up @@ -341,7 +341,7 @@ note: database URL not specified. Will search DNS.
note: (override with --db-url or OMDB_DB_URL)
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
note: database schema version matches expected (<redacted database version>)
note: listing all sleds (use -F to filter, e.g. -F in-service)
note: listing all commissioned sleds (use -F to filter, e.g. -F in-service)
=============================================
EXECUTING COMMAND: omdb ["--dns-server", "[::1]:REDACTED_PORT", "db", "sleds"]
termination: Exited(0)
Expand All @@ -356,5 +356,5 @@ note: database URL not specified. Will search DNS.
note: (override with --db-url or OMDB_DB_URL)
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
note: database schema version matches expected (<redacted database version>)
note: listing all sleds (use -F to filter, e.g. -F in-service)
note: listing all commissioned sleds (use -F to filter, e.g. -F in-service)
=============================================
2 changes: 1 addition & 1 deletion dev-tools/omdb/tests/successes.out
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ stdout:
stderr:
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
note: database schema version matches expected (<redacted database version>)
note: listing all sleds (use -F to filter, e.g. -F in-service)
note: listing all commissioned sleds (use -F to filter, e.g. -F in-service)
=============================================
EXECUTING COMMAND: omdb ["db", "sleds", "-F", "discretionary"]
termination: Exited(0)
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/tests/test_all_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async fn test_omdb_success_cases(cptestctx: &ControlPlaneTestContext) {
// collection?
assert!(parsed
.planning_input
.all_sled_ids(SledFilter::All)
.all_sled_ids(SledFilter::Commissioned)
.next()
.is_some());
assert!(!parsed.collections.is_empty());
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/tests/usage_errors.out
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Options:
Show sleds that match the given filter

Possible values:
- all: All sleds
- commissioned: All sleds that are currently part of the control plane cluster
- discretionary: Sleds that are eligible for discretionary services
- in-service: Sleds that are in service (even if they might not be eligible
for discretionary services)
Expand Down
8 changes: 4 additions & 4 deletions dev-tools/reconfigurator-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ fn cmd_sled_list(
.to_planning_input_builder()
.context("failed to generate planning input")?
.build();
let rows = planning_input.all_sled_resources(SledFilter::All).map(
let rows = planning_input.all_sled_resources(SledFilter::Commissioned).map(
|(sled_id, sled_resources)| Sled {
id: sled_id,
subnet: sled_resources.subnet.net().to_string(),
Expand Down Expand Up @@ -648,7 +648,7 @@ fn cmd_inventory_generate(
// has no zones on it.
let planning_input =
sim.system.to_planning_input_builder().unwrap().build();
for sled_id in planning_input.all_sled_ids(SledFilter::All) {
for sled_id in planning_input.all_sled_ids(SledFilter::Commissioned) {
builder
.found_sled_omicron_zones(
"fake sled agent",
Expand Down Expand Up @@ -1077,7 +1077,7 @@ fn cmd_load(
.context("generating planning input")?
.build();
for (sled_id, sled_details) in
loaded.planning_input.all_sleds(SledFilter::All)
loaded.planning_input.all_sleds(SledFilter::Commissioned)
{
if current_planning_input.sled_resources(&sled_id).is_some() {
swriteln!(
Expand Down Expand Up @@ -1202,7 +1202,7 @@ fn cmd_file_contents(args: FileContentsArgs) -> anyhow::Result<Option<String>> {
let mut s = String::new();

for (sled_id, sled_resources) in
loaded.planning_input.all_sled_resources(SledFilter::All)
loaded.planning_input.all_sled_resources(SledFilter::Commissioned)
{
swriteln!(
s,
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/db/datastore/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ mod tests {
// Check the number of blueprint elements against our collection.
assert_eq!(
blueprint1.blueprint_zones.len(),
planning_input.all_sled_ids(SledFilter::All).count(),
planning_input.all_sled_ids(SledFilter::Commissioned).count(),
);
assert_eq!(
blueprint1.blueprint_zones.len(),
Expand Down
2 changes: 2 additions & 0 deletions nexus/db-queries/src/db/datastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub use probe::ProbeInfo;
pub use rack::RackInit;
pub use rack::SledUnderlayAllocationResult;
pub use silo::Discoverability;
pub use sled::SledTransition;
pub use sled::TransitionError;
pub use switch_port::SwitchPortSettingsCombinedResult;
pub use virtual_provisioning_collection::StorageType;
pub use volume::read_only_resources_associated_with_volume;
Expand Down
Loading
Loading