Skip to content

[inventory] Add full OmicronSledConfig and fields for upcoming config reconciler #8188

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

Merged

Conversation

jgallagher
Copy link
Contributor

The primary change here is replacing these inventory fields (a subset of OmicronSledConfig):

    pub omicron_zones: OmicronZonesConfig,
    pub omicron_physical_disks_generation: Generation,

with these:

    pub ledgered_sled_config: Option<OmicronSledConfig>,
    pub reconciler_status: ConfigReconcilerInventoryStatus,
    pub last_reconciliation: Option<ConfigReconcilerInventory>,

Once #8064 lands, all three of these will be filled in meaningfully; as of this PR, only ledgered_sled_config is populated. (reconciler_status is always NotYetRun and last_reconciliation is always None, since there is no reconciler yet.) The rest of the changes are all fallout from changing inventory:

  • Update omdb printing
  • Update sled-agent to report the new inventory fields
  • Update consumers of inventory (tests, reconfigurator planner, one Nexus RPW) - these all just look at ledgered_sled_config for now, but will need to be updated on [sled-agent] Integrate config-reconciler #8064 once other fields are populated
  • Update database schema, model, and queries (the bulk of the diff). This requires dropping all preexisting collections, since there's no way to migrate from just omicron_zones to a full OmicronSledConfig. The first few schema migrations take care of this.

Before merging I'll go through an upgrade on a racklette and confirm things come back up okay after the schema migration blows away all the pre-update inventory collections. (We think this is fine, but it'd be good to confirm.) But I think this is close enough that it's reviewable.

Couple other minor changes that came along for the ride:

@jgallagher
Copy link
Contributor Author

Just went through an upgrade to this branch on dublin. After the mupdate, while Nexus is blocked waiting for schema migrations, we had a few collections from before the update:

root@oxz_switch0:~# omdb db inventory collections list
WARN: found schema version 142.0.0, expected 143.0.0
It's possible the database is running a version that's different from what this
tool understands.  This may result in errors or incorrect output.
ID                                   STARTED              TOOK     NSPS NERRORS
fe03b67b-02a9-4a1d-a028-3a8166f8fb28 2025-05-20T14:08:46Z 12206 ms 7    18
98979dff-6c80-44fc-bb22-211eacecb371 2025-05-20T14:18:45Z 10703 ms 7    18
2f4757d5-bc3d-4594-98e6-6658515598bd 2025-05-20T14:18:46Z 12236 ms 7    18
45b9a90b-afec-4a63-967c-3e1d55b9400f 2025-05-20T14:28:45Z 10153 ms 7    18
0fb62096-4adb-470e-ad50-5656454ffb04 2025-05-20T14:28:46Z 12451 ms 7    18

After performing the schema migration, all of them were removed (as expected). About 2 minutes later, the first post-upgrade collection showed up. (I think from watching Nexus logs, most of that 2 minutes was in Nexus's backoff waiting for the schema migration.)

This is what the omdb output for one sled of one collection made on this branch looks like (newer bits toward the bottom):

sled aae1c213-8557-4dda-aad1-cfab45adad57 (role = Scrimlet, serial BRM42220026)
    found at:    2025-05-20 18:37:36.958150 UTC from http://[fd00:1122:3344:101::1]:12345
    address:     [fd00:1122:3344:101::1]:12345
    usable hw threads:   128
    usable memory (GiB): 1011
    reservoir (GiB):     809
    physical disks:
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079DE55" } in 0
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079E567" } in 1
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079E665" } in 2
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079E3AD" } in 3
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079DF08" } in 4
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079E3D2" } in 5
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079DF02" } in 6
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079DDE7" } in 7
      U2: DiskIdentity { vendor: "1b96", model: "WUS4C6432DSP3X3", serial: "A079DDCC" } in 8
      M2: DiskIdentity { vendor: "1344", model: "Micron_7300_MTFDHBG1T9TDF", serial: "20213280E319" } in 17
      M2: DiskIdentity { vendor: "1344", model: "Micron_7300_MTFDHBG1T9TDF", serial: "20213280E401" } in 18
    zpools
      0e090202-9544-4180-9216-75c173f9aa58: total size: 2976 GiB
      19f7cec7-ae1b-4454-bd1c-db318350f6a3: total size: 2976 GiB
      528c8bd3-c854-4fa4-b798-3c0400046a13: total size: 2976 GiB
      5b8c3852-39c6-4414-a9ce-e65a60f52904: total size: 2976 GiB
      638b0da3-31a0-4e89-983b-873aa2f601e9: total size: 2976 GiB
      9dce28a6-90db-4c1c-9664-b3d0932b6f33: total size: 2976 GiB
      de76774c-f5a9-4710-8ee5-d50d128593d0: total size: 2976 GiB
      e9a78a20-e7ca-42b5-a3c9-642ec868a74b: total size: 2976 GiB
      ec88784a-e95f-4e6f-8fe4-7ee528c47591: total size: 2976 GiB
    datasets:
      oxp_0e090202-9544-4180-9216-75c173f9aa58 - id: none, compression: off
        available: 3020704612 KiB, used: 2339996 KiB
        reservation: None, quota: None
      oxp_0e090202-9544-4180-9216-75c173f9aa58/crucible - id: bedd6e10-568a-4396-8959-63fa17179c29, compression: off
        available: 3020704612 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_0e090202-9544-4180-9216-75c173f9aa58/crypt - id: none, compression: off
        available: 3020704612 KiB, used: 2333924 KiB
        reservation: None, quota: None
      oxp_0e090202-9544-4180-9216-75c173f9aa58/crypt/debug - id: b60ffa8b-9000-415b-8bd0-dad650c393bf, compression: gzip-9
        available: 102876340 KiB, used: 1981260 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_0e090202-9544-4180-9216-75c173f9aa58/crypt/zone - id: none, compression: off
        available: 3020704612 KiB, used: 352416 KiB
        reservation: None, quota: None
      oxp_0e090202-9544-4180-9216-75c173f9aa58/crypt/zone/oxz_crucible_42cdce98-9f99-4560-bf2c-5e7eeea00ad9 - id: none, compression: off
        available: 3020704612 KiB, used: 352208 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3 - id: none, compression: off
        available: 3019277084 KiB, used: 3767524 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crucible - id: 51f04886-893b-4553-86fa-595b8e76b9a7, compression: off
        available: 3019277084 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt - id: none, compression: off
        available: 3019277084 KiB, used: 3738328 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/cockroachdb - id: dc92e311-45e2-4110-b4f2-35f3b2648701, compression: off
        available: 3019277084 KiB, used: 1914716 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/debug - id: 052b92e8-b133-4e8a-9e59-3cd7c9480413, compression: gzip-9
        available: 104813176 KiB, used: 44424 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/external_dns - id: 238abb62-8318-4c0a-8f8d-7893a97c0fcf, compression: off
        available: 3019277084 KiB, used: 744 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/internal_dns - id: abe8b25d-bf93-462f-a6b2-14c0d08f074d, compression: off
        available: 3019277084 KiB, used: 744 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone - id: none, compression: off
        available: 3019277084 KiB, used: 1777452 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_cockroachdb_38629b65-1842-48a1-b4e2-e812affcb3fc - id: none, compression: off
        available: 3019277084 KiB, used: 712660 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_crucible_eb22e552-8d0e-460d-a1c4-9efe5bcabec8 - id: none, compression: off
        available: 3019277084 KiB, used: 352136 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_external_dns_9275ae6f-faab-48db-a934-f4965e5a1edc - id: none, compression: off
        available: 3019277084 KiB, used: 355216 KiB
        reservation: None, quota: None
      oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_internal_dns_e32f25a5-34f6-497b-8578-bca425379d8b - id: none, compression: off
        available: 3019277084 KiB, used: 357096 KiB
        reservation: None, quota: None
      oxp_528c8bd3-c854-4fa4-b798-3c0400046a13 - id: none, compression: off
        available: 3022675384 KiB, used: 369224 KiB
        reservation: None, quota: None
      oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crucible - id: e57dbcfc-25e6-4dbd-b0eb-4f579bba5c16, compression: off
        available: 3022675384 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crypt - id: none, compression: off
        available: 3022675384 KiB, used: 352856 KiB
        reservation: None, quota: None
      oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crypt/debug - id: dbc7f100-448d-4cdf-94ee-ea0e99dbe786, compression: gzip-9
        available: 104857400 KiB, used: 200 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crypt/zone - id: none, compression: off
        available: 3022675384 KiB, used: 352408 KiB
        reservation: None, quota: None
      oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crypt/zone/oxz_crucible_f9ae0434-43b8-47c8-b662-f58f19cae548 - id: none, compression: off
        available: 3022675384 KiB, used: 352200 KiB
        reservation: None, quota: None
      oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904 - id: none, compression: off
        available: 3022353348 KiB, used: 691260 KiB
        reservation: None, quota: None
      oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crucible - id: 663ce1a4-2861-47ea-ac4c-8f7b5869a000, compression: off
        available: 3022353348 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt - id: none, compression: off
        available: 3022353348 KiB, used: 685572 KiB
        reservation: None, quota: None
      oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/debug - id: 59613caa-7848-47b5-906a-3f4b0f75904e, compression: gzip-9
        available: 104857400 KiB, used: 200 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/zone - id: none, compression: off
        available: 3022353348 KiB, used: 685124 KiB
        reservation: None, quota: None
      oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/zone/oxz_crucible_9a3b9860-142a-4295-8201-7bffafeadfcc - id: none, compression: off
        available: 3022353348 KiB, used: 352168 KiB
        reservation: None, quota: None
      oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/zone/oxz_crucible_pantry_f35c2621-99e9-449d-a1c4-2be2828c5b78 - id: none, compression: off
        available: 3022353348 KiB, used: 332692 KiB
        reservation: None, quota: None
      oxp_638b0da3-31a0-4e89-983b-873aa2f601e9 - id: none, compression: off
        available: 3022673876 KiB, used: 370732 KiB
        reservation: None, quota: None
      oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crucible - id: 38737ec7-b46a-4d9f-9103-89c575fab247, compression: off
        available: 3022673876 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crypt - id: none, compression: off
        available: 3022673876 KiB, used: 352984 KiB
        reservation: None, quota: None
      oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crypt/debug - id: 545913f9-7fbe-4690-ac8e-a0aa5327e245, compression: gzip-9
        available: 104857400 KiB, used: 200 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crypt/zone - id: none, compression: off
        available: 3022673876 KiB, used: 352536 KiB
        reservation: None, quota: None
      oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crypt/zone/oxz_crucible_46bfc14a-624b-4b81-9264-850e7682473d - id: none, compression: off
        available: 3022673876 KiB, used: 352328 KiB
        reservation: None, quota: None
      oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33 - id: none, compression: off
        available: 3022685712 KiB, used: 358896 KiB
        reservation: None, quota: None
      oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crucible - id: 8acb2965-fc32-4d28-bd6b-14cebf0a2947, compression: off
        available: 3022685712 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crypt - id: none, compression: off
        available: 3022685712 KiB, used: 352920 KiB
        reservation: None, quota: None
      oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crypt/debug - id: a77fec9c-0344-447b-a5f8-0f043932c30a, compression: gzip-9
        available: 104857400 KiB, used: 200 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crypt/zone - id: none, compression: off
        available: 3022685712 KiB, used: 352472 KiB
        reservation: None, quota: None
      oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crypt/zone/oxz_crucible_f4dbddeb-d0c4-4a4c-8258-5c892eb2d263 - id: none, compression: off
        available: 3022685712 KiB, used: 352264 KiB
        reservation: None, quota: None
      oxp_de76774c-f5a9-4710-8ee5-d50d128593d0 - id: none, compression: off
        available: 3022379364 KiB, used: 665244 KiB
        reservation: None, quota: None
      oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crucible - id: 01615396-4c6e-41c6-a20f-a854d6c1cdd4, compression: off
        available: 3022379364 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt - id: none, compression: off
        available: 3022379364 KiB, used: 656676 KiB
        reservation: None, quota: None
      oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/debug - id: 00bafe9b-749e-4a7c-b802-0db78737adf7, compression: gzip-9
        available: 104838484 KiB, used: 19116 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/zone - id: none, compression: off
        available: 3022379364 KiB, used: 637312 KiB
        reservation: None, quota: None
      oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/zone/oxz_crucible_d4efa625-8d03-4f18-af74-73e30b42a97a - id: none, compression: off
        available: 3022379364 KiB, used: 352008 KiB
        reservation: None, quota: None
      oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/zone/oxz_ntp_6ef5318a-6295-4abb-94fd-b7e5f1e5b087 - id: none, compression: off
        available: 3022379364 KiB, used: 285056 KiB
        reservation: None, quota: None
      oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b - id: none, compression: off
        available: 3022685296 KiB, used: 359312 KiB
        reservation: None, quota: None
      oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crucible - id: a7e2645f-8a79-47d5-b233-30273dca058d, compression: off
        available: 3022685296 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crypt - id: none, compression: off
        available: 3022685296 KiB, used: 352952 KiB
        reservation: None, quota: None
      oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crypt/debug - id: 50bb5910-5e68-409b-bea7-d5314332628a, compression: gzip-9
        available: 104857400 KiB, used: 200 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crypt/zone - id: none, compression: off
        available: 3022685296 KiB, used: 352504 KiB
        reservation: None, quota: None
      oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crypt/zone/oxz_crucible_bef3ec3b-1628-4918-8c50-8e8387232f53 - id: none, compression: off
        available: 3022685296 KiB, used: 352296 KiB
        reservation: None, quota: None
      oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591 - id: none, compression: off
        available: 3022256928 KiB, used: 787680 KiB
        reservation: None, quota: None
      oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crucible - id: 72c04f08-e3e5-4c84-88a4-547ab92438b6, compression: off
        available: 3022256928 KiB, used: 192 KiB
        reservation: None, quota: None
      oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt - id: none, compression: off
        available: 3022256928 KiB, used: 781740 KiB
        reservation: None, quota: None
      oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/debug - id: 17583984-9e07-4af2-befa-592638d34d86, compression: gzip-9
        available: 104857400 KiB, used: 200 KiB
        reservation: None, quota: Some(ByteCount(107374182400))
      oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/zone - id: none, compression: off
        available: 3022256928 KiB, used: 781292 KiB
        reservation: None, quota: None
      oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/zone/oxz_crucible_0986e6d9-678a-4cc7-b27e-20bdaa2cc66f - id: none, compression: off
        available: 3022256928 KiB, used: 352296 KiB
        reservation: None, quota: None
      oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/zone/oxz_oximeter_66dec707-8f0c-47e2-a81d-36d49fed5cc3 - id: none, compression: off
        available: 3022256928 KiB, used: 428748 KiB
        reservation: None, quota: None

LEDGERED SLED CONFIG
    generation: 5
    remove_mupdate_override: None
    DISKS: 9
        ID                                           ZPOOL_ID                                     VENDOR         MODEL                   SERIAL
        3d0f4cdf-2d14-4605-88d4-cd48a61dfd18         19f7cec7-ae1b-4454-bd1c-db318350f6a3         1b96           WUS4C6432DSP3X3         A079E3D2
        43bdf4c0-3514-4a87-8616-2bfd4b6dd1ea         0e090202-9544-4180-9216-75c173f9aa58         1b96           WUS4C6432DSP3X3         A079DF02
        4f4770da-1e46-4cde-bbe5-5594f6d7f293         e9a78a20-e7ca-42b5-a3c9-642ec868a74b         1b96           WUS4C6432DSP3X3         A079E567
        75ea717b-0bb4-4612-a4ad-12f3b5ed4261         528c8bd3-c854-4fa4-b798-3c0400046a13         1b96           WUS4C6432DSP3X3         A079DDCC
        7980ca85-f70c-4ee9-b17b-cc80c701551a         5b8c3852-39c6-4414-a9ce-e65a60f52904         1b96           WUS4C6432DSP3X3         A079DE55
        87d1d2c3-3eec-4a12-ace5-d69c9355e079         de76774c-f5a9-4710-8ee5-d50d128593d0         1b96           WUS4C6432DSP3X3         A079E665
        9d900ee8-c97c-407b-b8e8-7d98f44fb1ba         9dce28a6-90db-4c1c-9664-b3d0932b6f33         1b96           WUS4C6432DSP3X3         A079DDE7
        bededced-5aa1-4473-95af-2859b13838db         638b0da3-31a0-4e89-983b-873aa2f601e9         1b96           WUS4C6432DSP3X3         A079DF08
        e86cbc77-4cfe-466d-b67a-13ed1cb6ce66         ec88784a-e95f-4e6f-8fe4-7ee528c47591         1b96           WUS4C6432DSP3X3         A079E3AD
    DATASETS: 45
        ID                                           NAME                                                                                                                 COMPRESSION         QUOTA           RESERVATION
        00bafe9b-749e-4a7c-b802-0db78737adf7         oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/debug                                                                 gzip-9              100 GiB         none
        01615396-4c6e-41c6-a20f-a854d6c1cdd4         oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crucible                                                                    off                 none            none
        052b92e8-b133-4e8a-9e59-3cd7c9480413         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/debug                                                                 gzip-9              100 GiB         none
        0be2f3f8-af0b-4186-b106-afd203738013         oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/zone                                                                  off                 none            none
        0ef141fe-d06b-43a0-9d59-515acb21e53c         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_crucible_eb22e552-8d0e-460d-a1c4-9efe5bcabec8                off                 none            none
        127469f5-9e62-4606-b99e-728c7e67d98f         oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/zone/oxz_crucible_pantry_f35c2621-99e9-449d-a1c4-2be2828c5b78         off                 none            none
        17583984-9e07-4af2-befa-592638d34d86         oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/debug                                                                 gzip-9              100 GiB         none
        1c47cce7-294c-417f-be52-cf8bd1273bea         oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/zone/oxz_oximeter_66dec707-8f0c-47e2-a81d-36d49fed5cc3                off                 none            none
        1d60bcba-1453-48c6-9ff0-c97785f87f6f         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone                                                                  off                 none            none
        206cd8c9-0f5c-4faa-b398-572362993681         oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/zone/oxz_crucible_0986e6d9-678a-4cc7-b27e-20bdaa2cc66f                off                 none            none
        238abb62-8318-4c0a-8f8d-7893a97c0fcf         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/external_dns                                                          off                 none            none
        297448b4-e789-452d-9737-a6e60a6fe285         oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crypt/zone/oxz_crucible_bef3ec3b-1628-4918-8c50-8e8387232f53                off                 none            none
        38737ec7-b46a-4d9f-9103-89c575fab247         oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crucible                                                                    off                 none            none
        3a42d971-328e-4d22-9407-d9f501d1b2dc         oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/zone/oxz_crucible_9a3b9860-142a-4295-8201-7bffafeadfcc                off                 none            none
        444e2a3b-892c-418a-ad58-452ace7772d3         oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crypt/zone/oxz_crucible_46bfc14a-624b-4b81-9264-850e7682473d                off                 none            none
        50bb5910-5e68-409b-bea7-d5314332628a         oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crypt/debug                                                                 gzip-9              100 GiB         none
        51f04886-893b-4553-86fa-595b8e76b9a7         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crucible                                                                    off                 none            none
        526ecb4c-b526-423c-8ae0-365e6ce06e44         oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crypt/zone/oxz_crucible_f9ae0434-43b8-47c8-b662-f58f19cae548                off                 none            none
        545913f9-7fbe-4690-ac8e-a0aa5327e245         oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crypt/debug                                                                 gzip-9              100 GiB         none
        59613caa-7848-47b5-906a-3f4b0f75904e         oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/debug                                                                 gzip-9              100 GiB         none
        5a963e3d-1da2-426e-988d-02a220d200d9         oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/zone/oxz_crucible_d4efa625-8d03-4f18-af74-73e30b42a97a                off                 none            none
        663ce1a4-2861-47ea-ac4c-8f7b5869a000         oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crucible                                                                    off                 none            none
        72c04f08-e3e5-4c84-88a4-547ab92438b6         oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crucible                                                                    off                 none            none
        7747b1a4-abd4-430b-813d-0ad776ceee5e         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_cockroachdb_38629b65-1842-48a1-b4e2-e812affcb3fc             off                 none            none
        7df97693-27e8-4df9-9180-cc39a56462f6         oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crypt/zone                                                                  off                 none            none
        8acb2965-fc32-4d28-bd6b-14cebf0a2947         oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crucible                                                                    off                 none            none
        8b54895d-9482-4183-b262-0214481d43cf         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_internal_dns_e32f25a5-34f6-497b-8578-bca425379d8b            off                 none            none
        8e57215a-3132-46ac-8df0-59395c8188a4         oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crypt/zone                                                                  off                 none            none
        9e16b044-a51f-4bfa-b2bd-0195948d5199         oxp_5b8c3852-39c6-4414-a9ce-e65a60f52904/crypt/zone                                                                  off                 none            none
        a77fec9c-0344-447b-a5f8-0f043932c30a         oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crypt/debug                                                                 gzip-9              100 GiB         none
        a7e2645f-8a79-47d5-b233-30273dca058d         oxp_e9a78a20-e7ca-42b5-a3c9-642ec868a74b/crucible                                                                    off                 none            none
        abe8b25d-bf93-462f-a6b2-14c0d08f074d         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/internal_dns                                                          off                 none            none
        b05313ea-a918-4de0-872e-43e8b5c6cefe         oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crypt/zone                                                                  off                 none            none
        b60ffa8b-9000-415b-8bd0-dad650c393bf         oxp_0e090202-9544-4180-9216-75c173f9aa58/crypt/debug                                                                 gzip-9              100 GiB         none
        b6584ec9-46a8-42e2-a625-7f20e140fd3a         oxp_0e090202-9544-4180-9216-75c173f9aa58/crypt/zone                                                                  off                 none            none
        be4fb1c3-3859-448a-9488-6579d86f7aa8         oxp_638b0da3-31a0-4e89-983b-873aa2f601e9/crypt/zone                                                                  off                 none            none
        be7553d6-5eba-4102-956b-a90c8bc3297f         oxp_de76774c-f5a9-4710-8ee5-d50d128593d0/crypt/zone/oxz_ntp_6ef5318a-6295-4abb-94fd-b7e5f1e5b087                     off                 none            none
        bedd6e10-568a-4396-8959-63fa17179c29         oxp_0e090202-9544-4180-9216-75c173f9aa58/crucible                                                                    off                 none            none
        d23fd5d2-b3b4-4e05-8f10-64bfec44f41b         oxp_9dce28a6-90db-4c1c-9664-b3d0932b6f33/crypt/zone/oxz_crucible_f4dbddeb-d0c4-4a4c-8258-5c892eb2d263                off                 none            none
        dbbd7039-4da2-4002-ab54-31595fb28546         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/zone/oxz_external_dns_9275ae6f-faab-48db-a934-f4965e5a1edc            off                 none            none
        dbc7f100-448d-4cdf-94ee-ea0e99dbe786         oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crypt/debug                                                                 gzip-9              100 GiB         none
        dc92e311-45e2-4110-b4f2-35f3b2648701         oxp_19f7cec7-ae1b-4454-bd1c-db318350f6a3/crypt/cockroachdb                                                           off                 none            none
        e57dbcfc-25e6-4dbd-b0eb-4f579bba5c16         oxp_528c8bd3-c854-4fa4-b798-3c0400046a13/crucible                                                                    off                 none            none
        edb5c8c3-6662-4235-bc88-1a6183a7ce76         oxp_0e090202-9544-4180-9216-75c173f9aa58/crypt/zone/oxz_crucible_42cdce98-9f99-4560-bf2c-5e7eeea00ad9                off                 none            none
        f1cc0276-9ba4-4d1e-abd6-b8201341ae49         oxp_ec88784a-e95f-4e6f-8fe4-7ee528c47591/crypt/zone                                                                  off                 none            none
    ZONES: 15
        ID                                           KIND                    IMAGE_SOURCE
        0986e6d9-678a-4cc7-b27e-20bdaa2cc66f         crucible                install-dataset
        38629b65-1842-48a1-b4e2-e812affcb3fc         cockroach_db            install-dataset
        42cdce98-9f99-4560-bf2c-5e7eeea00ad9         crucible                install-dataset
        46bfc14a-624b-4b81-9264-850e7682473d         crucible                install-dataset
        66dec707-8f0c-47e2-a81d-36d49fed5cc3         oximeter                install-dataset
        6ef5318a-6295-4abb-94fd-b7e5f1e5b087         boundary_ntp            install-dataset
        9275ae6f-faab-48db-a934-f4965e5a1edc         external_dns            install-dataset
        9a3b9860-142a-4295-8201-7bffafeadfcc         crucible                install-dataset
        bef3ec3b-1628-4918-8c50-8e8387232f53         crucible                install-dataset
        d4efa625-8d03-4f18-af74-73e30b42a97a         crucible                install-dataset
        e32f25a5-34f6-497b-8578-bca425379d8b         internal_dns            install-dataset
        eb22e552-8d0e-460d-a1c4-9efe5bcabec8         crucible                install-dataset
        f35c2621-99e9-449d-a1c4-2be2828c5b78         crucible_pantry         install-dataset
        f4dbddeb-d0c4-4a4c-8258-5c892eb2d263         crucible                install-dataset
        f9ae0434-43b8-47c8-b662-f58f19cae548         crucible                install-dataset
    reconciler task status: not yet run

Copy link
Contributor

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

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

(partway through reviewing)

@@ -196,6 +197,18 @@ pub struct OmicronSledConfig {
pub remove_mupdate_override: Option<MupdateOverrideUuid>,
}

impl Default for OmicronSledConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on deriving this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, that would require Generation to impl Default, which it currently does not. I can't think of a reason why it shouldn't, but will ask around.

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 generated a lot of discussion. 😅 Generation not implementing Default is intentional, so I'll leave this as-is.

@@ -851,6 +859,158 @@ impl DataStore {
}
}

// Insert rows for the all the sled configs we found.
Copy link
Contributor

Choose a reason for hiding this comment

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

deeply admire your tenacity

Copy link
Contributor

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

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

This is absolutely incredible work.

Accepting modulo a few comments.

@@ -0,0 +1,2 @@
ALTER TABLE omicron.public.inv_sled_agent
ADD COLUMN IF NOT EXISTS reconciler_status_kind inv_config_reconciler_status_kind NOT NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to set a default value (not-yet-run?) in this migration, and then remove the default in a future one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was worried it might, but it doesn't, because we've explicitly removed all the rows from inv_sled_agent in up01.sql.

@@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS omicron.public.inv_omicron_sled_config_zone_nic (
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess these are just copied from inv_omicron_zone_nic etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes: a few of these "new" tables are really the old table with a new column, except that new column is part of the primary key. I think it's easier to reason about the migration as "drop the table, recreate the new table" instead of having to deal with migrating the primary key indices.

@jgallagher jgallagher merged commit 02d8cd5 into main May 22, 2025
18 checks passed
@jgallagher jgallagher deleted the john/sled-agent-config-reconciler-inventory-integration branch May 22, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to store zone image source for inventory zones Combine inv_sled_omicron_zones with inv_sled_agent
2 participants