Skip to content

Commit 8571be3

Browse files
authored
[5/n] [reconfigurator-planning] gate adds/updates on zone image sources being known (#8921)
Expand the set of gates for adds/updates to include the fact that zone image sources should be known. Add tests for this: * `cmds-mupdate-update-flow` contains the bulk of testing for this scenario. * I had to make tweaks to some tests, particularly to `cmds-target-release.txt`, in order to start running the test in earnest from the Artifact state rather than the InstallDataset state.
1 parent d1bdb3c commit 8571be3

18 files changed

+3155
-1388
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ 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+
1519
# Try to plan a new blueprint; this should be okay even though the sled
1620
# we added has no disks.
1721
blueprint-plan dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 eb0796d5-ab8a-4f7b-a884-b4aeacb8ab51

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ blueprint-edit 3f00b694-1b16-4aaa-8f78-e6b3a527b434 expunge-zones 8429c772-07e8-
99
blueprint-diff 3f00b694-1b16-4aaa-8f78-e6b3a527b434 366b0b68-d80e-4bc1-abd3-dc69837847e0
1010

1111
blueprint-show 366b0b68-d80e-4bc1-abd3-dc69837847e0
12+
13+
# Set the add_zones_with_mupdate_override planner config to ensure that zone
14+
# adds happen despite zone image sources not being Artifact.
15+
set planner-config --add-zones-with-mupdate-override true
16+
1217
# blueprint-plan will place a new external DNS zone, diff DNS to see the new zone has `ns<N>` and NS records.
1318
blueprint-plan 366b0b68-d80e-4bc1-abd3-dc69837847e0
1419
blueprint-diff 366b0b68-d80e-4bc1-abd3-dc69837847e0 9c998c1d-1a7b-440a-ae0c-40f781dea6e2

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ 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+
1519
# Planning a new blueprint will now replace the expunged zone, with new records for its replacement.
1620
blueprint-plan 58d5e830-0884-47d8-a7cd-b2b3751adeb4
1721
blueprint-diff 58d5e830-0884-47d8-a7cd-b2b3751adeb4 af934083-59b5-4bf6-8966-6fb5292c29e1

dev-tools/reconfigurator-cli/tests/input/cmds-mupdate-update-flow.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ sled-set serial2 mupdate-override unset
104104
# Run the planner again. This will cause sled 2's blueprint
105105
# remove_mupdate_override to be unset. But no further planning steps will
106106
# happen because the target release generation is not new enough.
107-
#
108-
# TODO: we want to block further planning steps until the target release is
109-
# uploaded and all install-dataset zones have been converted to artifact ones.
110107
inventory-generate
111108
blueprint-plan latest latest
112109
blueprint-show latest
@@ -119,10 +116,19 @@ blueprint-plan latest latest
119116
blueprint-show latest
120117
blueprint-diff latest
121118

122-
# Now clear the mupdate override error. At this point, the rest of the
123-
# planner starts working.
119+
# Now clear the mupdate override error. At this point, we're *still* blocked
120+
# on serial1's install dataset not being known (so cannot be noop converted).
124121
sled-set serial1 mupdate-override unset
125122
inventory-generate
123+
blueprint-plan latest latest
124+
blueprint-diff latest
125+
126+
# Update serial1's install dataset. Finally the planner is unblocked. (Note that
127+
# we do noop conversions of serial1 to Artifact and the unblocking of further
128+
# steps within the same blueprint. In other words, the code that considers
129+
# whether add/update are blocked takes into account noop conversions.)
130+
sled-update-install-dataset serial1 --to-target-release
131+
inventory-generate
126132

127133
# This will attempt to update the RoT bootloader on the first sled.
128134
blueprint-plan latest latest

dev-tools/reconfigurator-cli/tests/input/cmds-target-release.txt

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ show
77
# Create a TUF repository from a fake manifest. (The output TUF repo is
88
# written to a temporary directory that this invocation of `reconfigurator-cli`
99
# is running out of as its working directory.)
10+
#
11+
# This is used to simulate the initial version of the system.
12+
tuf-assemble ../../update-common/manifests/fake-0.0.1.toml
13+
14+
# Load the target release from the assembled TUF repository.
15+
set target-release repo-0.0.1.zip
16+
17+
# Print the default target release.
18+
show
19+
20+
# Update the install dataset on all sleds to the target release.
21+
# This will cause zones to be noop converted over to Artifact,
22+
# unblocking upgrades.
23+
sled-update-install-dataset serial0 --to-target-release
24+
sled-update-install-dataset serial1 --to-target-release
25+
sled-update-install-dataset serial2 --to-target-release
26+
27+
# Generate inventory, then do a planning run to ensure that all zones
28+
# are set to Artifact.
29+
inventory-generate
30+
blueprint-plan latest latest
31+
blueprint-diff latest
32+
# The above blueprint includes a pending MGS update, which we should delete
33+
# (we want to start from a fresh state).
34+
blueprint-edit latest delete-sp-update serial0
35+
# Also set the Omicron config for all sleds to reflect the
36+
# corresponding image sources.
37+
sled-set serial0 omicron-config latest
38+
sled-set serial1 omicron-config latest
39+
sled-set serial2 omicron-config latest
40+
# Generate inventory once more to reflect the omicron config changes.
41+
inventory-generate
42+
inventory-show latest
43+
44+
# Setup is now done -- create another TUF repository which will act as the
45+
# target release being updated to.
1046
tuf-assemble ../../update-common/manifests/fake.toml
1147

1248
# Load the target release from the assembled TUF repository.
@@ -17,14 +53,13 @@ show
1753

1854
# Test that this state survives a save/load operation.
1955
save saved.out
20-
wipe all
56+
wipe system
2157
# This should NOT show the target release.
2258
show
23-
load saved.out
59+
load saved.out 61f451b3-2121-4ed6-91c7-a550054f6c21
2460
# This should show the target release.
2561
show
2662

27-
2863
# Great. Now, let's run through an upgrade!
2964
# First, print out what we've got.
3065
sled-list

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,34 @@ 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+
3644
> # Try to plan a new blueprint; this should be okay even though the sled
3745
> # we added has no disks.
3846
> blueprint-plan dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21 eb0796d5-ab8a-4f7b-a884-b4aeacb8ab51
3947
INFO skipping noop image source check for all sleds, reason: no target release is currently set
40-
WARN cannot issue more MGS-driven updates (no current artifacts)
4148
generated blueprint 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1 based on parent blueprint dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
4249
blueprint source: planner with report:
4350
planning report for blueprint 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1:
51+
planner config:
52+
add zones with mupdate override: true
53+
54+
* zone adds and updates are blocked:
55+
- sleds have deployment units with image sources not set to Artifact:
56+
- sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c: 9 zones
57+
- sled 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6: 8 zones
58+
- sled d81c6a84-79b8-4958-ae41-ea46c9b19763: 8 zones
59+
60+
* adding zones despite being blocked, as specified by the `add_zones_with_mupdate_override` planner config option
4461
* no zpools in service for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
4562
* discretionary zone placement waiting for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
63+
* zone updates waiting on zone add blockers
4664

4765

4866

@@ -279,8 +297,19 @@ parent: dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
279297

280298
blueprint source: planner with report:
281299
planning report for blueprint 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1:
300+
planner config:
301+
add zones with mupdate override: true
302+
303+
* zone adds and updates are blocked:
304+
- sleds have deployment units with image sources not set to Artifact:
305+
- sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c: 9 zones
306+
- sled 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6: 8 zones
307+
- sled d81c6a84-79b8-4958-ae41-ea46c9b19763: 8 zones
308+
309+
* adding zones despite being blocked, as specified by the `add_zones_with_mupdate_override` planner config option
282310
* no zpools in service for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
283311
* discretionary zone placement waiting for NTP zones on sleds: 00320471-945d-413c-85e7-03e091a70b3c
312+
* zone updates waiting on zone add blockers
284313

285314

286315

dev-tools/reconfigurator-cli/tests/output/cmds-example-stdout

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,15 @@ T ENA ID PARENT
599599

600600
> blueprint-plan ade5749d-bdf3-4fab-a8ae-00bea01b3a5a
601601
INFO skipping noop image source check for all sleds, reason: no target release is currently set
602-
WARN cannot issue more MGS-driven updates (no current artifacts)
603602
generated blueprint 86db3308-f817-4626-8838-4085949a6a41 based on parent blueprint ade5749d-bdf3-4fab-a8ae-00bea01b3a5a
604603
blueprint source: planner with report:
605-
empty planning report for blueprint 86db3308-f817-4626-8838-4085949a6a41.
604+
planning report for blueprint 86db3308-f817-4626-8838-4085949a6a41:
605+
* zone adds waiting on blockers
606+
* zone adds and updates are blocked:
607+
- sleds have deployment units with image sources not set to Artifact:
608+
- sled 89d02b1b-478c-401a-8e28-7a26f74fa41b: 18 zones
609+
610+
* zone updates waiting on zone add blockers
606611

607612

608613

@@ -1839,10 +1844,16 @@ INTERNAL DNS STATUS
18391844
> # sled to be expunged.
18401845
> blueprint-plan latest
18411846
INFO skipping noop image source check for all sleds, reason: no target release is currently set
1842-
WARN cannot issue more MGS-driven updates (no current artifacts)
18431847
generated blueprint 86db3308-f817-4626-8838-4085949a6a41 based on parent blueprint ade5749d-bdf3-4fab-a8ae-00bea01b3a5a
18441848
blueprint source: planner with report:
1845-
empty planning report for blueprint 86db3308-f817-4626-8838-4085949a6a41.
1849+
planning report for blueprint 86db3308-f817-4626-8838-4085949a6a41:
1850+
* zone adds waiting on blockers
1851+
* zone adds and updates are blocked:
1852+
- sleds have deployment units with image sources not set to Artifact:
1853+
- sled 2eb69596-f081-4e2d-9425-9994926e0832: 4 zones
1854+
- sled 89d02b1b-478c-401a-8e28-7a26f74fa41b: 17 zones
1855+
1856+
* zone updates waiting on zone add blockers
18461857

18471858

18481859

dev-tools/reconfigurator-cli/tests/output/cmds-expunge-newly-added-external-dns-stdout

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,13 +837,31 @@ blueprint source: edited directly with reconfigurator-cli
837837

838838

839839

840+
841+
> # Set the add_zones_with_mupdate_override planner config to ensure that zone
842+
> # adds happen despite zone image sources not being Artifact.
843+
> set planner-config --add-zones-with-mupdate-override true
844+
planner config updated:
845+
* add zones with mupdate override: false -> true
846+
847+
848+
840849
> # blueprint-plan will place a new external DNS zone, diff DNS to see the new zone has `ns<N>` and NS records.
841850
> blueprint-plan 366b0b68-d80e-4bc1-abd3-dc69837847e0
842851
INFO skipping noop image source check for all sleds, reason: no target release is currently set
843-
WARN cannot issue more MGS-driven updates (no current artifacts)
844852
generated blueprint 9c998c1d-1a7b-440a-ae0c-40f781dea6e2 based on parent blueprint 366b0b68-d80e-4bc1-abd3-dc69837847e0
845853
blueprint source: planner with report:
846854
planning report for blueprint 9c998c1d-1a7b-440a-ae0c-40f781dea6e2:
855+
planner config:
856+
add zones with mupdate override: true
857+
858+
* zone adds and updates are blocked:
859+
- sleds have deployment units with image sources not set to Artifact:
860+
- sled 711ac7f8-d19e-4572-bdb9-e9b50f6e362a: 15 zones
861+
- sled 9dc50690-f9bf-4520-bf80-051d0f465c2c: 15 zones
862+
- sled a88790de-5962-4871-8686-61c1fd5b7094: 15 zones
863+
864+
* adding zones despite being blocked, as specified by the `add_zones_with_mupdate_override` planner config option
847865
* discretionary zones placed:
848866
* external_dns zone on sled 711ac7f8-d19e-4572-bdb9-e9b50f6e362a from source install dataset
849867
* zone updates waiting on discretionary zones
@@ -1343,6 +1361,16 @@ parent: 366b0b68-d80e-4bc1-abd3-dc69837847e0
13431361

13441362
blueprint source: planner with report:
13451363
planning report for blueprint 9c998c1d-1a7b-440a-ae0c-40f781dea6e2:
1364+
planner config:
1365+
add zones with mupdate override: true
1366+
1367+
* zone adds and updates are blocked:
1368+
- sleds have deployment units with image sources not set to Artifact:
1369+
- sled 711ac7f8-d19e-4572-bdb9-e9b50f6e362a: 15 zones
1370+
- sled 9dc50690-f9bf-4520-bf80-051d0f465c2c: 15 zones
1371+
- sled a88790de-5962-4871-8686-61c1fd5b7094: 15 zones
1372+
1373+
* adding zones despite being blocked, as specified by the `add_zones_with_mupdate_override` planner config option
13461374
* discretionary zones placed:
13471375
* external_dns zone on sled 711ac7f8-d19e-4572-bdb9-e9b50f6e362a from source install dataset
13481376
* zone updates waiting on discretionary zones

dev-tools/reconfigurator-cli/tests/output/cmds-expunge-newly-added-internal-dns-stdout

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,13 +645,30 @@ external DNS:
645645

646646

647647

648+
> # Set the add_zones_with_mupdate_override planner config to ensure that zone
649+
> # adds happen despite zone image sources not being Artifact.
650+
> set planner-config --add-zones-with-mupdate-override true
651+
planner config updated:
652+
* add zones with mupdate override: false -> true
653+
654+
655+
648656
> # Planning a new blueprint will now replace the expunged zone, with new records for its replacement.
649657
> blueprint-plan 58d5e830-0884-47d8-a7cd-b2b3751adeb4
650658
INFO skipping noop image source check for all sleds, reason: no target release is currently set
651-
WARN cannot issue more MGS-driven updates (no current artifacts)
652659
generated blueprint af934083-59b5-4bf6-8966-6fb5292c29e1 based on parent blueprint 58d5e830-0884-47d8-a7cd-b2b3751adeb4
653660
blueprint source: planner with report:
654661
planning report for blueprint af934083-59b5-4bf6-8966-6fb5292c29e1:
662+
planner config:
663+
add zones with mupdate override: true
664+
665+
* zone adds and updates are blocked:
666+
- sleds have deployment units with image sources not set to Artifact:
667+
- sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c: 15 zones
668+
- sled 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6: 15 zones
669+
- sled d81c6a84-79b8-4958-ae41-ea46c9b19763: 15 zones
670+
671+
* adding zones despite being blocked, as specified by the `add_zones_with_mupdate_override` planner config option
655672
* discretionary zones placed:
656673
* internal_dns zone on sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c from source install dataset
657674
* zone updates waiting on discretionary zones

0 commit comments

Comments
 (0)