Skip to content

Commit cd9b6f1

Browse files
authored
[reconfigurator-planning] allow adding zones if target release generation is 1 (#9066)
For customers that are going to continue relying on MUPdate, the planner should act the same way as it did before self-service update existed. We ascertain this by looking at whether a target release has ever been set. Most of the tests no longer require the `add_zones_with_mupdate_override` config, so add a new reconfigurator-cli script which specifically tests that config.
1 parent 8279fbe commit cd9b6f1

16 files changed

+519
-186
lines changed

dev-tools/reconfigurator-cli/tests/input/cmds-add-sled-no-disks.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ sled-add --ndisks 0
1212
# Generate a new inventory collection that includes that sled.
1313
inventory-generate
1414

15-
# Set the add_zones_with_mupdate_override planner config to ensure that zone
16-
# adds happen despite zone image sources not being Artifact.
17-
set planner-config --add-zones-with-mupdate-override true
18-
1915
# Try to plan a new blueprint; this should be okay even though the sled
2016
# we added has no disks.
2117
blueprint-plan dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 eb0796d5-ab8a-4f7b-a884-b4aeacb8ab51
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This script tests the add-zones-with-mupdate-override
2+
# planner config.
3+
4+
# Load example system
5+
load-example --nsleds 3 --ndisks-per-sled 3
6+
7+
# Create a TUF repository from a fake manifest. We're going to use this
8+
# repository to test out the minimum release generation flow.
9+
tuf-assemble ../../update-common/manifests/fake.toml
10+
set target-release repo-1.0.0.zip
11+
12+
# Update the install dataset on this sled to the target release.
13+
# (This populates the zone manifest, used for no-op conversions from
14+
# install dataset to artifact down the road.)
15+
sled-update-install-dataset serial0 --to-target-release
16+
17+
# Simulate a mupdate on sled 0 by setting the mupdate override field to a
18+
# new UUID (generated using uuidgen).
19+
sled-set serial0 mupdate-override 2d0f6cbc-addc-47a2-962a-6a01e13376bf
20+
21+
# Generate a new inventory and plan against that.
22+
inventory-generate
23+
blueprint-plan latest latest
24+
25+
# Diff the blueprints. This diff should show "will remove mupdate override"
26+
# and the target release minimum generation being set.
27+
blueprint-diff latest
28+
29+
# Set Nexus redundancy to 4.
30+
set num-nexus 4
31+
32+
# Plan with the new Nexus. This will not add any Nexus zones.
33+
blueprint-plan latest latest
34+
blueprint-diff latest
35+
36+
# Set the add-zones-with-mupdate-override config, then do a planning run.
37+
# This *will* add a new Nexus zone.
38+
set planner-config --add-zones-with-mupdate-override true
39+
blueprint-plan latest latest
40+
blueprint-diff latest

dev-tools/reconfigurator-cli/tests/input/cmds-expunge-newly-added-internal-dns.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ blueprint-diff dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 8da82a8e-bf97-4fbd-8ddd-9f64
1212
blueprint-edit 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 mark-for-cleanup 99e2f30b-3174-40bf-a78a-90da8abba8ca
1313
blueprint-diff 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 58d5e830-0884-47d8-a7cd-b2b3751adeb4
1414

15-
# Set the add_zones_with_mupdate_override planner config to ensure that zone
16-
# adds happen despite zone image sources not being Artifact.
17-
set planner-config --add-zones-with-mupdate-override true
18-
1915
# Planning a new blueprint will now replace the expunged zone, with new records for its replacement.
2016
blueprint-plan 58d5e830-0884-47d8-a7cd-b2b3751adeb4
2117
blueprint-diff 58d5e830-0884-47d8-a7cd-b2b3751adeb4 af934083-59b5-4bf6-8966-6fb5292c29e1

dev-tools/reconfigurator-cli/tests/output/cmds-add-sled-no-disks-stdout

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,20 @@ added sled 00320471-945d-413c-85e7-03e091a70b3c (serial: serial3)
3333
generated inventory collection eb0796d5-ab8a-4f7b-a884-b4aeacb8ab51 from configured sleds
3434

3535

36-
> # Set the add_zones_with_mupdate_override planner config to ensure that zone
37-
> # adds happen despite zone image sources not being Artifact.
38-
> set planner-config --add-zones-with-mupdate-override true
39-
planner config updated:
40-
* add zones with mupdate override: false -> true
41-
42-
43-
4436
> # Try to plan a new blueprint; this should be okay even though the sled
4537
> # we added has no disks.
4638
> blueprint-plan dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 eb0796d5-ab8a-4f7b-a884-b4aeacb8ab51
4739
INFO skipping noop image source check for all sleds, reason: no target release is currently set
4840
generated blueprint 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 based on parent blueprint dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
4941
blueprint source: planner with report:
5042
planning report:
51-
planner config:
52-
add zones with mupdate override: true
53-
5443
* zone adds and updates are blocked:
5544
- sleds have deployment units with image sources not set to Artifact:
5645
- sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c: 9 zones
5746
- sled 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6: 8 zones
5847
- sled d81c6a84-79b8-4958-ae41-ea46c9b19763: 8 zones
5948

60-
* adding zones despite being blocked, as specified by the `add_zones_with_mupdate_override` planner config option
49+
* adding zones despite being blocked, because: target release generation is 1
6150
* no zpools in service for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
6251
* discretionary zone placement waiting for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
6352
* zone updates waiting on zone add blockers
@@ -297,16 +286,13 @@ parent: dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
297286

298287
blueprint source: planner with report:
299288
planning report:
300-
planner config:
301-
add zones with mupdate override: true
302-
303289
* zone adds and updates are blocked:
304290
- sleds have deployment units with image sources not set to Artifact:
305291
- sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c: 9 zones
306292
- sled 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6: 8 zones
307293
- sled d81c6a84-79b8-4958-ae41-ea46c9b19763: 8 zones
308294

309-
* adding zones despite being blocked, as specified by the `add_zones_with_mupdate_override` planner config option
295+
* adding zones despite being blocked, because: target release generation is 1
310296
* no zpools in service for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
311297
* discretionary zone placement waiting for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
312298
* zone updates waiting on zone add blockers

dev-tools/reconfigurator-cli/tests/output/cmds-add-zones-with-mupdate-override-stderr

Whitespace-only changes.

0 commit comments

Comments
 (0)