Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
17d9ae4
Fix docstring for BlueprintZoneImageSource
plotnick Mar 26, 2025
a87f755
Plumb target release TUF repo through planner
plotnick Mar 26, 2025
851128a
Plan zone updates from TUF repo
plotnick Mar 26, 2025
85e94bb
Plan according to RFD 565 §9
plotnick Apr 23, 2025
194a8a3
Don't update an already up-to-date zone
plotnick Apr 28, 2025
50c1169
Don't trust inventory zones' image_source
plotnick May 2, 2025
ad7103e
Fix failing tests
plotnick May 3, 2025
55b8e0e
Rename datastore methods: update_tuf_* → tuf_*
plotnick May 10, 2025
a7c1e17
Fix typed UUID
plotnick May 10, 2025
57f7154
Rename ControlPlaneZone → NonNexusOmicronZone
plotnick May 10, 2025
77b2156
Simplify OrderedComponent logic
plotnick May 10, 2025
e31fc60
Simplify out-of-date zone collection
plotnick May 10, 2025
7f1f522
Make planning error an error
plotnick May 10, 2025
050933e
Explicitly list which zone kinds get in-place updates
plotnick May 10, 2025
2daabf5
Uncomment test assertion
plotnick May 10, 2025
88733d2
Type-safe fake-zone names
plotnick May 10, 2025
2e0ee41
Merge branch 'main' into plan-target-release
plotnick May 10, 2025
3ae171e
Fix doc bug from renamed method
plotnick May 10, 2025
499106a
Merge branch 'main' into plan-target-release
plotnick May 16, 2025
959e1e4
Merge branch 'main' into plan-target-release
plotnick May 19, 2025
3611b42
Refactor zone update readiness check
plotnick May 21, 2025
b2f09a3
Merge branch 'main' into plan-target-release
plotnick May 22, 2025
70edce7
Check zone image source in inventory
plotnick May 22, 2025
29d2093
initial draft: planning SP, some pieces missing
davepacheco May 28, 2025
38dc53a
add docs
davepacheco Jun 3, 2025
f28b929
fix openapi
davepacheco Jun 4, 2025
bd7bcd6
update comments based on review feedback
davepacheco Jun 4, 2025
bf2ab7c
review feedback
davepacheco Jun 4, 2025
a862939
Merge branch 'dap/sp-planning' into dap/sp-planning-real
davepacheco Jun 4, 2025
7acf01d
Merge remote-tracking branch 'origin/plan-target-release' into dap/sp…
davepacheco Jun 4, 2025
8182a46
incorporate SP updates into planner
davepacheco Jun 4, 2025
78fbd8c
Merge remote-tracking branch 'origin/main' into dap/sp-planning-real
davepacheco Jun 4, 2025
aa00005
Merge branch 'main' into plan-target-release
davepacheco Jun 4, 2025
f715a9a
Merge remote-tracking branch 'origin/plan-target-release' into dap/sp…
davepacheco Jun 4, 2025
ad88157
reconfigurator-cli could let you set SP versions
davepacheco Jun 4, 2025
7705d1c
rustfmt
davepacheco Jun 4, 2025
ceaaec3
fix tests
davepacheco Jun 4, 2025
fac42c3
Merge branch 'dap/sp-planning-real' into dap/reconfigurator-cli-set-s…
davepacheco Jun 4, 2025
4c6d9c1
use SIM_GIMLET_BOARD constant
davepacheco Jun 5, 2025
709ae6d
remove XXX
davepacheco Jun 5, 2025
1c8c753
Merge branch 'dap/sp-planning-real' into dap/reconfigurator-cli-set-s…
davepacheco Jun 5, 2025
ad44964
Merge commit '2d077d531260590a56908d0ee0186f38c0d96d7a' into dap/sp-p…
davepacheco Jun 6, 2025
52a368e
Merge commit 'd2aa2c5f207b9918fab30a7b95790b6bfd29d75d' into dap/sp-p…
davepacheco Jun 6, 2025
51a41f1
Merge branch 'main' into dap/sp-planning-real
davepacheco Jun 6, 2025
734df3c
Merge branch 'dap/sp-planning-real' into dap/reconfigurator-cli-set-s…
davepacheco Jun 6, 2025
ce355a2
Merge branch 'main' into dap/sp-planning-real
davepacheco Jun 11, 2025
fbef9f8
Merge branch 'dap/sp-planning-real' into dap/reconfigurator-cli-set-s…
davepacheco Jun 11, 2025
ac66c42
fix test
davepacheco Jun 12, 2025
95e6c72
Merge branch 'dap/sp-planning-real' into dap/reconfigurator-cli-set-s…
davepacheco Jun 12, 2025
405b29c
Merge branch 'main' into dap/sp-planning-real
davepacheco Jun 13, 2025
29df3f6
review feedback
davepacheco Jun 13, 2025
1a466aa
Merge branch 'dap/sp-planning-real' into dap/reconfigurator-cli-set-s…
davepacheco Jun 13, 2025
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
1 change: 1 addition & 0 deletions Cargo.lock

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

27 changes: 15 additions & 12 deletions dev-tools/omdb/tests/usage_errors.out
Original file line number Diff line number Diff line change
Expand Up @@ -508,19 +508,22 @@ Options:
Show sleds that match the given filter

Possible values:
- all: All sleds in the system, regardless of policy or state
- commissioned: All sleds that are currently part of the control plane cluster
- decommissioned: All sleds that were previously part of the control plane
- all: All sleds in the system, regardless of policy or state
- commissioned: All sleds that are currently part of the control plane
cluster
- decommissioned: All sleds that were previously part of the control plane
cluster but have been decommissioned
- 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)
- query-during-inventory: Sleds whose sled agents should be queried for inventory
- reservation-create: Sleds on which reservations can be created
- vpc-routing: Sleds which should be sent OPTE V2P mappings and Routing rules
- vpc-firewall: Sleds which should be sent VPC firewall rules
- tuf-artifact-replication: Sleds which should have TUF repo artifacts replicated onto
them
- 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)
- query-during-inventory: Sleds whose sled agents should be queried for inventory
- reservation-create: Sleds on which reservations can be created
- vpc-routing: Sleds which should be sent OPTE V2P mappings and Routing
rules
- vpc-firewall: Sleds which should be sent VPC firewall rules
- tuf-artifact-replication: Sleds which should have TUF repo artifacts replicated
onto them
- sps-updated-by-reconfigurator: Sleds whose SPs should be updated by Reconfigurator

--log-level <LOG_LEVEL>
log level filter
Expand Down
73 changes: 67 additions & 6 deletions dev-tools/reconfigurator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ fn process_command(
Commands::SledRemove(args) => cmd_sled_remove(sim, args),
Commands::SledShow(args) => cmd_sled_show(sim, args),
Commands::SledSetPolicy(args) => cmd_sled_set_policy(sim, args),
Commands::SledUpdateSp(args) => cmd_sled_update_sp(sim, args),
Commands::SiloList => cmd_silo_list(sim),
Commands::SiloAdd(args) => cmd_silo_add(sim, args),
Commands::SiloRemove(args) => cmd_silo_remove(sim, args),
Expand Down Expand Up @@ -261,6 +262,8 @@ enum Commands {
SledShow(SledArgs),
/// set a sled's policy
SledSetPolicy(SledSetPolicyArgs),
/// simulate updating the sled's SP versions
SledUpdateSp(SledUpdateSpArgs),

/// list silos
SiloList,
Expand Down Expand Up @@ -372,6 +375,20 @@ impl From<SledPolicyOpt> for SledPolicy {
}
}

#[derive(Debug, Args)]
struct SledUpdateSpArgs {
/// id of the sled
sled_id: SledUuid,

/// sets the version reported for the SP active slot
#[clap(long, required_unless_present_any = &["inactive"])]
active: Option<ArtifactVersion>,

/// sets the version reported for the SP inactive slot
#[clap(long, required_unless_present_any = &["active"])]
inactive: Option<ExpectedVersion>,
}

#[derive(Debug, Args)]
struct SledRemoveArgs {
/// id of the sled
Expand Down Expand Up @@ -885,18 +902,22 @@ fn cmd_sled_show(
args: SledArgs,
) -> anyhow::Result<Option<String>> {
let state = sim.current_state();
let planning_input = state
.system()
.description()
let description = state.system().description();
let sled_id = args.sled_id;
let sp_active_version = description.sled_sp_active_version(sled_id)?;
let sp_inactive_version = description.sled_sp_inactive_version(sled_id)?;
let planning_input = description
.to_planning_input_builder()
.context("failed to generate planning_input builder")?
.build();
let sled_id = args.sled_id;
let sled_resources =
&planning_input.sled_lookup(args.filter, sled_id)?.resources;
let sled = planning_input.sled_lookup(args.filter, sled_id)?;
let sled_resources = &sled.resources;
let mut s = String::new();
swriteln!(s, "sled {}", sled_id);
swriteln!(s, "serial {}", sled.baseboard_id.serial_number);
swriteln!(s, "subnet {}", sled_resources.subnet.net());
swriteln!(s, "SP active version: {:?}", sp_active_version);
swriteln!(s, "SP inactive version: {:?}", sp_inactive_version);
swriteln!(s, "zpools ({}):", sled_resources.zpools.len());
for (zpool, disk) in &sled_resources.zpools {
swriteln!(s, " {:?}", zpool);
Expand Down Expand Up @@ -924,6 +945,46 @@ fn cmd_sled_set_policy(
Ok(Some(format!("set sled {} policy to {}", args.sled_id, args.policy)))
}

fn cmd_sled_update_sp(
sim: &mut ReconfiguratorSim,
args: SledUpdateSpArgs,
) -> anyhow::Result<Option<String>> {
let mut labels = Vec::new();
if let Some(active) = &args.active {
labels.push(format!("active -> {}", active));
}
if let Some(inactive) = &args.inactive {
labels.push(format!("inactive -> {}", inactive));
}

assert!(
!labels.is_empty(),
"clap configuration requires that at least one argument is specified"
);

let mut state = sim.current_state().to_mut();
state.system_mut().description_mut().sled_update_sp_versions(
args.sled_id,
args.active,
args.inactive,
)?;

sim.commit_and_bump(
format!(
"reconfigurator-cli sled-update-sp: {}: {}",
args.sled_id,
labels.join(", "),
),
state,
);

Ok(Some(format!(
"set sled {} SP versions: {}",
args.sled_id,
labels.join(", ")
)))
}

fn cmd_inventory_list(
sim: &mut ReconfiguratorSim,
) -> anyhow::Result<Option<String>> {
Expand Down
12 changes: 12 additions & 0 deletions dev-tools/reconfigurator-cli/tests/input/cmds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ sled-add 90c1102a-b9f5-4d88-92a2-60d54a2d98cc
sled-add 04ef3330-c682-4a08-8def-fcc4bef31bcd
sled-list

sled-update-sp dde1c0e2-b10d-4621-b420-f179f7a7a00a
sled-update-sp dde1c0e2-b10d-4621-b420-f179f7a7a00a --active 1.0.0
sled-show dde1c0e2-b10d-4621-b420-f179f7a7a00a
sled-update-sp dde1c0e2-b10d-4621-b420-f179f7a7a00a --inactive 2.0.0
sled-show dde1c0e2-b10d-4621-b420-f179f7a7a00a
sled-update-sp dde1c0e2-b10d-4621-b420-f179f7a7a00a --active 3.0.0
sled-show dde1c0e2-b10d-4621-b420-f179f7a7a00a
sled-update-sp dde1c0e2-b10d-4621-b420-f179f7a7a00a --active 4.0.0 --inactive invalid
sled-show dde1c0e2-b10d-4621-b420-f179f7a7a00a
sled-update-sp dde1c0e2-b10d-4621-b420-f179f7a7a00a --active 4.0.0 --inactive 5.0.0
sled-show dde1c0e2-b10d-4621-b420-f179f7a7a00a

inventory-generate
inventory-list

Expand Down
7 changes: 7 additions & 0 deletions dev-tools/reconfigurator-cli/tests/output/cmds-example-stdout
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ T ENA ID PARENT

> sled-show 2eb69596-f081-4e2d-9425-9994926e0832
sled 2eb69596-f081-4e2d-9425-9994926e0832
serial serial1
subnet fd00:1122:3344:102::/64
SP active version: Some("0.0.1")
SP inactive version: None
zpools (10):
088ed702-551e-453b-80d7-57700372a844 (zpool)
SledDisk { disk_identity: DiskIdentity { vendor: "fake-vendor", model: "fake-model", serial: "serial-088ed702-551e-453b-80d7-57700372a844" }, disk_id: b2850ccb-4ac7-4034-aeab-b1cd582d407b (physical_disk), policy: InService, state: Active }
Expand Down Expand Up @@ -395,7 +398,10 @@ T ENA ID PARENT

> sled-show 89d02b1b-478c-401a-8e28-7a26f74fa41b
sled 89d02b1b-478c-401a-8e28-7a26f74fa41b
serial serial0
subnet fd00:1122:3344:101::/64
SP active version: Some("0.0.1")
SP inactive version: None
zpools (4):
44fa7024-c2bc-4d2c-b478-c4997e4aece8 (zpool)
SledDisk { disk_identity: DiskIdentity { vendor: "fake-vendor", model: "fake-model", serial: "serial-44fa7024-c2bc-4d2c-b478-c4997e4aece8" }, disk_id: 2a15b33c-dd0e-45b7-aba9-d05f40f030ff (physical_disk), policy: InService, state: Active }
Expand Down Expand Up @@ -497,6 +503,7 @@ WARN failed to place all new desired InternalDns zones, placed: 0, wanted_to_pla
INFO sufficient ExternalDns zones exist in plan, desired_count: 0, current_count: 0
WARN failed to place all new desired Nexus zones, placed: 0, wanted_to_place: 3
INFO sufficient Oximeter zones exist in plan, desired_count: 0, current_count: 0
WARN cannot issue more SP updates (no current artifacts)
INFO some zones not yet up-to-date, sled_id: 89d02b1b-478c-401a-8e28-7a26f74fa41b
INFO will ensure cockroachdb setting, setting: cluster.preserve_downgrade_option, value: DoNotModify
generated blueprint 86db3308-f817-4626-8838-4085949a6a41 based on parent blueprint ade5749d-bdf3-4fab-a8ae-00bea01b3a5a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ INFO sufficient InternalDns zones exist in plan, desired_count: 3, current_count
INFO added zone to sled, sled_id: a88790de-5962-4871-8686-61c1fd5b7094, kind: ExternalDns
INFO sufficient Nexus zones exist in plan, desired_count: 3, current_count: 3
INFO sufficient Oximeter zones exist in plan, desired_count: 0, current_count: 0
WARN cannot issue more SP updates (no current artifacts)
INFO some zones not yet up-to-date, sled_id: a88790de-5962-4871-8686-61c1fd5b7094
INFO will ensure cockroachdb setting, setting: cluster.preserve_downgrade_option, value: DoNotModify
generated blueprint 9c998c1d-1a7b-440a-ae0c-40f781dea6e2 based on parent blueprint 366b0b68-d80e-4bc1-abd3-dc69837847e0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,7 @@ INFO added zone to sled, sled_id: d81c6a84-79b8-4958-ae41-ea46c9b19763, kind: In
INFO sufficient ExternalDns zones exist in plan, desired_count: 3, current_count: 3
INFO sufficient Nexus zones exist in plan, desired_count: 3, current_count: 3
INFO sufficient Oximeter zones exist in plan, desired_count: 0, current_count: 0
WARN cannot issue more SP updates (no current artifacts)
INFO some zones not yet up-to-date, sled_id: d81c6a84-79b8-4958-ae41-ea46c9b19763
INFO will ensure cockroachdb setting, setting: cluster.preserve_downgrade_option, value: DoNotModify
generated blueprint af934083-59b5-4bf6-8966-6fb5292c29e1 based on parent blueprint 58d5e830-0884-47d8-a7cd-b2b3751adeb4
Expand Down
7 changes: 7 additions & 0 deletions dev-tools/reconfigurator-cli/tests/output/cmds-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
error: the following required arguments were not provided:
--active <ACTIVE>
--inactive <INACTIVE>

Usage: sled-update-sp --active <ACTIVE> --inactive <INACTIVE> <SLED_ID>

For more information, try '--help'.
Loading
Loading