Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
38a265b
(4/N) db_metadata_nexus database queries (handoff)
smklein Aug 27, 2025
3e61a97
(5/N) Read database access records on boot
smklein Aug 27, 2025
e1b43c3
(6/N) Add image to planning report for zones
smklein Aug 27, 2025
6b7e9ed
(7/N) Use nexus_generation, update it
smklein Aug 27, 2025
db263c1
Merge with main
smklein Sep 3, 2025
bbb204c
drop keys for InlineErrorChain
smklein Sep 3, 2025
67505ec
Merge
smklein Sep 4, 2025
e1f2fe1
Merge
smklein Sep 4, 2025
529874d
update nexus internal API
smklein Sep 4, 2025
961338c
Actually create NotYet records when appropriate
smklein Sep 4, 2025
fed7aa0
Merge with main
smklein Sep 4, 2025
bf79e74
Merge
smklein Sep 5, 2025
51b3103
Merge
smklein Sep 5, 2025
9514deb
Fix database_nexus_access_create to use active Nexus
smklein Sep 5, 2025
ce31570
Make clippy happy
smklein Sep 5, 2025
70d4ab9
Simplify database_nexus_access_create, move tests
smklein Sep 5, 2025
690ea16
Unify queries for all db_metadata_nexus states
smklein Sep 8, 2025
f15fa4b
comments, enums, set_..._nexuses
smklein Sep 8, 2025
5525529
determine_nexus_generation no longer returns an option
smklein Sep 9, 2025
c8126af
maybe when we say the gen bumps, we should do that
smklein Sep 9, 2025
056829f
merge
smklein Sep 9, 2025
e3615a9
merge
smklein Sep 9, 2025
a38a811
move some generation checks out of planner, into blippy
smklein Sep 9, 2025
b4bcca7
get_zones_not_yet_propagated_to_inventory comments
smklein Sep 10, 2025
a6548ca
clarifying planner comments
smklein Sep 10, 2025
448a39d
proposed
smklein Sep 10, 2025
07d79f3
Test cleanup, make lack of nexus zones more of an error, delay deploy…
smklein Sep 10, 2025
730a3b5
Ensure nexus can always be 'shut down' safely, refactor can_zone_be_u…
smklein Sep 12, 2025
f34422f
Merge
smklein Sep 15, 2025
4939771
clippy
smklein Sep 15, 2025
aa76e15
Change how simulated reconfigurator creates planning input
smklein Sep 15, 2025
b4cfa2d
plumb nexus_generation as arg
smklein Sep 15, 2025
ff13b71
stop using --no-zones
smklein Sep 16, 2025
2e04448
set nexus_generation explicitly during reconfigurator-cli tests
smklein Sep 16, 2025
8067ac9
Also update reconfigurator-cli output
smklein Sep 16, 2025
e9b2e17
remove XXX comment
smklein Sep 16, 2025
2ab3af2
Merge with main (mostly sled_add_zone_nexus stuff)
smklein Sep 16, 2025
87ecf81
merge with main
smklein Sep 16, 2025
02d6aae
Review feedback (BTreeSets, using PlanningInputBuilder, dedup setters)
smklein Sep 16, 2025
e8d0d03
Converge with 9023, to make the incoming merge easier
smklein Sep 16, 2025
ef82b33
merge
smklein Sep 17, 2025
0ac6f92
merge
smklein Sep 17, 2025
f82ad3b
Continuing to reduce the diff
smklein Sep 17, 2025
59194c0
Continuing to reduce diff
smklein Sep 17, 2025
deb3139
Report about the right zones
smklein Sep 17, 2025
e7c58ef
Throw errors on corrupt db/bp active gens
smklein Sep 17, 2025
d42a109
iterate over all zones
smklein Sep 17, 2025
ff3d86b
Update nexus last
smklein Sep 17, 2025
7b67eaf
review feedback
smklein Sep 17, 2025
8d17221
Review feedback, moving determine_nexus_gen (and tests) to planner
smklein Sep 17, 2025
b1ee973
update nexus tests to only upgrade between non-installdataset versions
smklein Sep 18, 2025
4ea1405
trying to improve planner report
smklein Sep 18, 2025
9843b4a
Minimize window where planner report shows up, test it
smklein Sep 18, 2025
4beb420
More feedback
smklein Sep 18, 2025
f61d3fd
Merge
smklein Sep 22, 2025
8a96005
wip
jgallagher Sep 22, 2025
d491246
cargo fmt
jgallagher Sep 22, 2025
5392671
Merge branch 'main' into john/target-release-test-nexus-handoff
jgallagher Sep 23, 2025
8118180
fix incorrect comments referring to the install dataset
jgallagher Sep 23, 2025
5fd5517
more specific description of `set active-nexus-gen`
jgallagher Sep 23, 2025
19a7276
Merge remote-tracking branch 'origin/main' into john/target-release-t…
jgallagher Sep 23, 2025
0ecb80c
remove test pruned from main
jgallagher Sep 23, 2025
ddf1afb
determine active Nexus generation from UnstableReconfiguratorState
jgallagher Sep 23, 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
25 changes: 19 additions & 6 deletions dev-tools/reconfigurator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl ReconfiguratorSim {
builder.set_internal_dns_version(parent_blueprint.internal_dns_version);
builder.set_external_dns_version(parent_blueprint.external_dns_version);

let active_nexus_gen = state.config().active_nexus_zone_generation();
let mut active_nexus_zones = BTreeSet::new();
let mut not_yet_nexus_zones = BTreeSet::new();

Expand Down Expand Up @@ -177,20 +178,23 @@ impl ReconfiguratorSim {

match &zone.zone_type {
nexus_types::deployment::BlueprintZoneType::Nexus(nexus) => {
if nexus.nexus_generation
== parent_blueprint.nexus_generation
{
if nexus.nexus_generation == active_nexus_gen {
active_nexus_zones.insert(zone.id);
} else if nexus.nexus_generation
> parent_blueprint.nexus_generation
{
} else if nexus.nexus_generation > active_nexus_gen {
not_yet_nexus_zones.insert(zone.id);
}
}
_ => (),
}
}

if active_nexus_zones.is_empty() {
bail!(
"no Nexus zones found at current active generation \
({active_nexus_gen})"
);
}

builder.set_active_nexus_zones(active_nexus_zones);
builder.set_not_yet_nexus_zones(not_yet_nexus_zones);

Expand Down Expand Up @@ -1185,6 +1189,9 @@ enum SetArgs {
Seed { seed: String },
/// target number of Nexus instances (for planning)
NumNexus { num_nexus: u16 },
/// specify the generation of Nexus zones that are considered active when
/// running the blueprint planner
ActiveNexusGen { gen: Generation },
/// system's external DNS zone name (suffix)
ExternalDnsZoneName { zone_name: String },
/// system target release
Expand Down Expand Up @@ -2736,6 +2743,12 @@ fn cmd_set(
.target_nexus_zone_count(usize::from(num_nexus));
rv
}
SetArgs::ActiveNexusGen { gen } => {
let rv =
format!("will use active Nexus zones from generation {gen}");
state.config_mut().set_active_nexus_zone_generation(gen);
rv
}
SetArgs::ExternalDnsZoneName { zone_name } => {
let rv = format!(
"external DNS zone name: {:?} -> {:?}",
Expand Down
38 changes: 31 additions & 7 deletions dev-tools/reconfigurator-cli/tests/input/cmds-target-release.txt
Original file line number Diff line number Diff line change
Expand Up @@ -446,26 +446,50 @@ blueprint-diff latest
sled-set d81c6a84-79b8-4958-ae41-ea46c9b19763 omicron-config latest
inventory-generate

# Add Nexus zones on three sleds
# Start the Nexus handoff process: A planning step here should place three new
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI, I did add this test to #8936 in a recent update, but I'm totally fine with deleting my changes and using what you have here.

(I think your addition of set active-nexus-gen 2 will become necessary anyway)

# Nexus zones, each running from the new TUF repo artifact.
blueprint-plan latest latest
blueprint-diff latest

# Propagate configs to the sleds which should be running Nexus
# Update inventory to reflect the three Nexus zones starting.
sled-set 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c omicron-config latest
sled-set 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6 omicron-config latest
sled-set d81c6a84-79b8-4958-ae41-ea46c9b19763 omicron-config latest
inventory-generate

# Update the Nexus generation from 1 -> 2, initiating
# quiesce of the old Nexuses
# Planning now should bump the top-level `nexus_generation` to 2, indicating
# that we want handoff to begin.
blueprint-plan latest latest
blueprint-diff latest

# Expunge three Nexus zones, one at a time
# Planning again should make no changes: we haven't yet performed a handoff,
# so the old Nexus zones are still in charge.
blueprint-plan latest latest
blueprint-diff latest

# Bump the set of active Nexus zones; this simulates Nexus handoff.
set active-nexus-gen 2

# Planning should now expunge one of the old Nexus zones.
blueprint-plan latest latest
blueprint-diff latest

# Two more planning iterations should expunge the remaining two old install
# dataset Nexus zones.
blueprint-plan latest latest
blueprint-diff latest
blueprint-plan latest latest
blueprint-diff latest

# Attempt to plan one more blueprint.
# There should be no changes attempted here.
# Update sled configs and inventory to reflect the expunged Nexus zones.
sled-set 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c omicron-config latest
sled-set 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6 omicron-config latest
sled-set d81c6a84-79b8-4958-ae41-ea46c9b19763 omicron-config latest
inventory-generate

# Planning now should note that the old zones are gone, but do nothing else:
# the update is complete. All in-service zones have image sources from the new
# TUF repo, and all zones using old images are expunged.
blueprint-plan latest latest
blueprint-diff latest
blueprint-show latest
3 changes: 3 additions & 0 deletions dev-tools/reconfigurator-cli/tests/output/cmds-stdout
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ wiped system

> load state.json
loaded data from "state.json"
warnings:
could not determine active Nexus generation from serialized state: no target blueprint set (using default of 1)
Comment on lines +866 to +867
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why's this? Aren't we loaded something we just saved, and wouldn't the saved version have what we need?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test doesn't use the example system; it's just showing a handful of commands. Earlier in this file we see no blueprints at all:

> blueprint-list
T ENA ID PARENT TIME_CREATED 

which is consistent with the warning here that there's no target blueprint.

result:
system:
using collection 6e066695-94bc-4250-bd63-fd799c166cc1 as source of sled inventory data
Expand All @@ -875,6 +877,7 @@ result:
config:
configured external DNS zone name: oxide.example
configured silo names: example-silo
active Nexus generation: 1


> sled-show dde1c0e2-b10d-4621-b420-f179f7a7a00a
Expand Down
Loading
Loading