Skip to content
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

omdb nexus blueprints target set --diff #6435

Merged
merged 5 commits into from
Aug 26, 2024
Merged

omdb nexus blueprints target set --diff #6435

merged 5 commits into from
Aug 26, 2024

Conversation

davepacheco
Copy link
Collaborator

This adds a --diff flag to omdb nexus blueprints target set that presents a diff against the current target blueprint and then prompts for confirmation before proceeding.

@davepacheco davepacheco requested a review from jgallagher August 26, 2024 16:43
@davepacheco
Copy link
Collaborator Author

davepacheco commented Aug 26, 2024

Tested against omicron-dev run-all using 201f303. I had to restart omicron-dev run-all each time I set a target blueprint here because the environment it runs in does not allow it to generate more than one blueprint. That's why the DNS port number and blueprint ids keep changing here.

First, we need a new blueprint:

$ OMDB_DNS_SERVER=[::1]:53206 cargo run --bin=omdb -- -w nexus blueprints regenerate
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.95s
     Running `target/debug/omdb -w nexus blueprints regenerate`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
generated new blueprint bc71109e-adf3-41fe-9e46-540016662cd8

Here's using the diff and aborting:

 $ OMDB_DNS_SERVER=[::1]:53206 cargo run --bin=omdb -- -w nexus blueprints target set --diff bc71109e-adf3-41fe-9e46-540016662cd8 disabled
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.97s
     Running `target/debug/omdb -w nexus blueprints target set --diff bc71109e-adf3-41fe-9e46-540016662cd8 disabled`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
from: blueprint 2fab7025-9823-4526-a96f-3285638cc378
to:   blueprint bc71109e-adf3-41fe-9e46-540016662cd8

 MODIFIED SLEDS:

  sled 039be560-54cc-49e3-88df-1a29dadbf913:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-1e05afaa-f16f-4fb0-81aa-3d5d1d7fb810
+   synthetic-vendor   synthetic-model   synthetic-serial-2cd5f506-9517-476f-8dd9-c107cc6894df
+   synthetic-vendor   synthetic-model   synthetic-serial-5f77556e-a3d6-4c6d-9428-1a42cb93505e
+   synthetic-vendor   synthetic-model   synthetic-serial-6dc45661-f5e8-4e39-b11f-29b4fbf84441
+   synthetic-vendor   synthetic-model   synthetic-serial-8b905ad1-cc9a-44b1-8e86-be8ae3f616bc
+   synthetic-vendor   synthetic-model   synthetic-serial-a297281b-ad33-47dc-ba9d-3ba3765755a8
+   synthetic-vendor   synthetic-model   synthetic-serial-a933d061-1792-41ac-9b68-f2b95939d3cc
+   synthetic-vendor   synthetic-model   synthetic-serial-b27dae36-4103-47ff-bd9f-c1d8c2f6910f
+   synthetic-vendor   synthetic-model   synthetic-serial-cdff6720-9487-45e1-889a-77a148f1d99a
+   synthetic-vendor   synthetic-model   synthetic-serial-e830f060-1c39-40b7-b287-e68050ff2c87


    omicron zones generation 2 -> 3:
    -------------------------------------------------------------------------------
    zone type      zone id                                disposition   underlay IP
    -------------------------------------------------------------------------------
+   internal_ntp   01707071-195c-44ef-a9f9-05f2ebda0a55   in service    ::21       


  sled b6d65341-167c-41df-9b5c-41cded99c229:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-0033fa00-f5cb-446c-88f8-334bb8914d78
+   synthetic-vendor   synthetic-model   synthetic-serial-00e685c6-c57d-4864-84eb-8b24231d4759
+   synthetic-vendor   synthetic-model   synthetic-serial-1c11f115-ed23-4d0d-ac01-9fec8939c2ca
+   synthetic-vendor   synthetic-model   synthetic-serial-2c421e26-1bf3-4e97-8365-a0548d298f64
+   synthetic-vendor   synthetic-model   synthetic-serial-36048b3b-b4e8-495b-8a4b-f60c67ca190a
+   synthetic-vendor   synthetic-model   synthetic-serial-9e6bc1cc-9277-4089-bda0-c2a464491240
+   synthetic-vendor   synthetic-model   synthetic-serial-d4b8b5b6-aa61-4416-b8c0-ff7e27b169a8
+   synthetic-vendor   synthetic-model   synthetic-serial-d878d4d5-22d6-4cce-a549-fab6e84a462f
+   synthetic-vendor   synthetic-model   synthetic-serial-dd6ec71b-e284-41b9-b227-470271c47d1f
+   synthetic-vendor   synthetic-model   synthetic-serial-e9707cc0-266e-40f7-889e-9fe904467c63


    omicron zones generation 2 -> 3:
    -----------------------------------------------------------------------------------
    zone type         zone id                                disposition    underlay IP
    -----------------------------------------------------------------------------------
*   clickhouse        c617fcc4-5f00-4aa8-9b09-4ef993bce38a   - in service   ::1        
     └─                                                      + expunged                
*   cockroach_db      fe08d5d0-b284-4858-b12a-63f00b61c5ad   - in service   ::1        
     └─                                                      + expunged                
*   crucible_pantry   6dbeae83-a23f-4205-a8b7-6ad9030b5c4c   - in service   ::1        
     └─                                                      + expunged                
*   external_dns      001a2072-fac4-40a4-97c8-2e259853c18d   - in service   ::1        
     └─                                                      + expunged                
*   internal_dns      68ce3500-ff7a-47e6-9f1c-43f5852a5b87   - in service   ::1        
     └─                                                      + expunged                
*   nexus             e6bff1ff-24fb-49dc-a54e-c6a350cd4d6c   - in service   ::1        
     └─                                                      + expunged                
+   internal_ntp      5e090bdc-8a18-41ee-919c-5ef6105f882f   in service     ::21       


 COCKROACHDB SETTINGS:
    state fingerprint:::::::::::::::::   d4d87aa2ad877a4cc2fddd0573952362739110de (unchanged)
    cluster.preserve_downgrade_option:   "22.1" (unchanged)

 METADATA:
    internal DNS version:   1 (unchanged)
    external DNS version:   2 (unchanged)



Do you want to make bc71109e-adf3-41fe-9e46-540016662cd8 the target blueprint?
y/N〉no
Error: Aborting, input did not match expected value

Here's using the diff and confirming:

$ OMDB_DNS_SERVER=[::1]:53206 cargo run --bin=omdb -- -w nexus blueprints target set --diff bc71109e-adf3-41fe-9e46-540016662cd8 disabled
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.98s
     Running `target/debug/omdb -w nexus blueprints target set --diff bc71109e-adf3-41fe-9e46-540016662cd8 disabled`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
from: blueprint 2fab7025-9823-4526-a96f-3285638cc378
to:   blueprint bc71109e-adf3-41fe-9e46-540016662cd8

 MODIFIED SLEDS:

  sled 039be560-54cc-49e3-88df-1a29dadbf913:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-1e05afaa-f16f-4fb0-81aa-3d5d1d7fb810
+   synthetic-vendor   synthetic-model   synthetic-serial-2cd5f506-9517-476f-8dd9-c107cc6894df
+   synthetic-vendor   synthetic-model   synthetic-serial-5f77556e-a3d6-4c6d-9428-1a42cb93505e
+   synthetic-vendor   synthetic-model   synthetic-serial-6dc45661-f5e8-4e39-b11f-29b4fbf84441
+   synthetic-vendor   synthetic-model   synthetic-serial-8b905ad1-cc9a-44b1-8e86-be8ae3f616bc
+   synthetic-vendor   synthetic-model   synthetic-serial-a297281b-ad33-47dc-ba9d-3ba3765755a8
+   synthetic-vendor   synthetic-model   synthetic-serial-a933d061-1792-41ac-9b68-f2b95939d3cc
+   synthetic-vendor   synthetic-model   synthetic-serial-b27dae36-4103-47ff-bd9f-c1d8c2f6910f
+   synthetic-vendor   synthetic-model   synthetic-serial-cdff6720-9487-45e1-889a-77a148f1d99a
+   synthetic-vendor   synthetic-model   synthetic-serial-e830f060-1c39-40b7-b287-e68050ff2c87


    omicron zones generation 2 -> 3:
    -------------------------------------------------------------------------------
    zone type      zone id                                disposition   underlay IP
    -------------------------------------------------------------------------------
+   internal_ntp   01707071-195c-44ef-a9f9-05f2ebda0a55   in service    ::21       


  sled b6d65341-167c-41df-9b5c-41cded99c229:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-0033fa00-f5cb-446c-88f8-334bb8914d78
+   synthetic-vendor   synthetic-model   synthetic-serial-00e685c6-c57d-4864-84eb-8b24231d4759
+   synthetic-vendor   synthetic-model   synthetic-serial-1c11f115-ed23-4d0d-ac01-9fec8939c2ca
+   synthetic-vendor   synthetic-model   synthetic-serial-2c421e26-1bf3-4e97-8365-a0548d298f64
+   synthetic-vendor   synthetic-model   synthetic-serial-36048b3b-b4e8-495b-8a4b-f60c67ca190a
+   synthetic-vendor   synthetic-model   synthetic-serial-9e6bc1cc-9277-4089-bda0-c2a464491240
+   synthetic-vendor   synthetic-model   synthetic-serial-d4b8b5b6-aa61-4416-b8c0-ff7e27b169a8
+   synthetic-vendor   synthetic-model   synthetic-serial-d878d4d5-22d6-4cce-a549-fab6e84a462f
+   synthetic-vendor   synthetic-model   synthetic-serial-dd6ec71b-e284-41b9-b227-470271c47d1f
+   synthetic-vendor   synthetic-model   synthetic-serial-e9707cc0-266e-40f7-889e-9fe904467c63


    omicron zones generation 2 -> 3:
    -----------------------------------------------------------------------------------
    zone type         zone id                                disposition    underlay IP
    -----------------------------------------------------------------------------------
*   clickhouse        c617fcc4-5f00-4aa8-9b09-4ef993bce38a   - in service   ::1        
     └─                                                      + expunged                
*   cockroach_db      fe08d5d0-b284-4858-b12a-63f00b61c5ad   - in service   ::1        
     └─                                                      + expunged                
*   crucible_pantry   6dbeae83-a23f-4205-a8b7-6ad9030b5c4c   - in service   ::1        
     └─                                                      + expunged                
*   external_dns      001a2072-fac4-40a4-97c8-2e259853c18d   - in service   ::1        
     └─                                                      + expunged                
*   internal_dns      68ce3500-ff7a-47e6-9f1c-43f5852a5b87   - in service   ::1        
     └─                                                      + expunged                
*   nexus             e6bff1ff-24fb-49dc-a54e-c6a350cd4d6c   - in service   ::1        
     └─                                                      + expunged                
+   internal_ntp      5e090bdc-8a18-41ee-919c-5ef6105f882f   in service     ::21       


 COCKROACHDB SETTINGS:
    state fingerprint:::::::::::::::::   d4d87aa2ad877a4cc2fddd0573952362739110de (unchanged)
    cluster.preserve_downgrade_option:   "22.1" (unchanged)

 METADATA:
    internal DNS version:   1 (unchanged)
    external DNS version:   2 (unchanged)



Do you want to make bc71109e-adf3-41fe-9e46-540016662cd8 the target blueprint?
y/N〉y
set target blueprint to bc71109e-adf3-41fe-9e46-540016662cd8

Here's without using it:

$ OMDB_DNS_SERVER=[::1]:46329 cargo run --bin=omdb -- -w nexus blueprints target set 2cc2dfb0-8f7d-4352-8b04-b8b43d79c398 disabled
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.01s
     Running `target/debug/omdb -w nexus blueprints target set 2cc2dfb0-8f7d-4352-8b04-b8b43d79c398 disabled`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
set target blueprint to 2cc2dfb0-8f7d-4352-8b04-b8b43d79c398

Since the code path around inherit changed, here's using inherit with no diff:

$ OMDB_DNS_SERVER=[::1]:51058 cargo run --bin=omdb -- -w nexus blueprints list
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.98s
     Running `target/debug/omdb -w nexus blueprints list`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
* no  11e6702c-1bc3-407f-a596-6c79c3516568 <none>                               2024-08-26T17:00:45.949Z 
      783bad26-13e0-4c34-ac2e-d396dd3d0fc4 11e6702c-1bc3-407f-a596-6c79c3516568 2024-08-26T17:01:01.641Z 

$ OMDB_DNS_SERVER=[::1]:51058 cargo run --bin=omdb -- -w nexus blueprints target set 783bad26-13e0-4c34-ac2e-d396dd3d0fc4 inherit
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.99s
     Running `target/debug/omdb -w nexus blueprints target set 783bad26-13e0-4c34-ac2e-d396dd3d0fc4 inherit`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
set target blueprint to 783bad26-13e0-4c34-ac2e-d396dd3d0fc4

$ OMDB_DNS_SERVER=[::1]:51058 cargo run --bin=omdb -- -w nexus blueprints list
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.03s
     Running `target/debug/omdb -w nexus blueprints list`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
      11e6702c-1bc3-407f-a596-6c79c3516568 <none>                               2024-08-26T17:00:45.949Z 
* no  783bad26-13e0-4c34-ac2e-d396dd3d0fc4 11e6702c-1bc3-407f-a596-6c79c3516568 2024-08-26T17:01:01.641Z 

Here's the same situation but where the parent was enabled:

$ OMDB_DNS_SERVER=[::1]:61229 cargo run --bin=omdb -- -w nexus blueprints list
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.99s
     Running `target/debug/omdb -w nexus blueprints list`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
* no  2b7b33c2-0bba-401c-b86d-dd4341bf2d3a <none>                               2024-08-26T17:03:10.342Z 
      eec88e42-16bf-4b88-bfa5-5be27b407f52 2b7b33c2-0bba-401c-b86d-dd4341bf2d3a 2024-08-26T17:03:27.651Z 

$ OMDB_DNS_SERVER=[::1]:61229 cargo run --bin=omdb -- -w nexus blueprints target enable 2b7b33c2-0bba-401c-b86d-dd4341bf2d3a
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.03s
     Running `target/debug/omdb -w nexus blueprints target enable 2b7b33c2-0bba-401c-b86d-dd4341bf2d3a`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
set target blueprint 2b7b33c2-0bba-401c-b86d-dd4341bf2d3a to enabled

$ OMDB_DNS_SERVER=[::1]:61229 cargo run --bin=omdb -- -w nexus blueprints list
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.98s
     Running `target/debug/omdb -w nexus blueprints list`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
* yes 2b7b33c2-0bba-401c-b86d-dd4341bf2d3a <none>                               2024-08-26T17:03:10.342Z 
      eec88e42-16bf-4b88-bfa5-5be27b407f52 2b7b33c2-0bba-401c-b86d-dd4341bf2d3a 2024-08-26T17:03:27.651Z 

$ OMDB_DNS_SERVER=[::1]:61229 cargo run --bin=omdb -- -w nexus blueprints target set eec88e42-16bf-4b88-bfa5-5be27b407f52 inherit
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.98s
     Running `target/debug/omdb -w nexus blueprints target set eec88e42-16bf-4b88-bfa5-5be27b407f52 inherit`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
set target blueprint to eec88e42-16bf-4b88-bfa5-5be27b407f52

$ OMDB_DNS_SERVER=[::1]:61229 cargo run --bin=omdb -- -w nexus blueprints list
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.96s
     Running `target/debug/omdb -w nexus blueprints list`
note: Nexus URL not specified.  Will pick one from DNS.
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
      2b7b33c2-0bba-401c-b86d-dd4341bf2d3a <none>                               2024-08-26T17:03:10.342Z 
* yes eec88e42-16bf-4b88-bfa5-5be27b407f52 2b7b33c2-0bba-401c-b86d-dd4341bf2d3a 2024-08-26T17:03:27.651Z 

@davepacheco davepacheco marked this pull request as ready for review August 26, 2024 17:05
@@ -1722,6 +1726,40 @@ async fn cmd_nexus_blueprints_target_set(
args: &BlueprintTargetSetArgs,
_destruction_token: DestructiveOperationToken,
) -> Result<(), anyhow::Error> {
let found_enabled = if args.diff
|| matches!(args.enabled, BlueprintTargetSetEnabled::Inherit)
Copy link
Contributor

Choose a reason for hiding this comment

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

This (and the unwrap) seem kinda awkward. Would it be too clever to stick "get the current target" in a tokio OnceCell? Something like

    // Helper to only fetch the current target once. We may need it immediately
    // if `args.diff` is true, or later if `args.enabled` is "inherit" (or
    // both).
    let current_target = OnceCell::new();
    let get_current_target = || async {
        current_target
            .get_or_try_init(|| client.blueprint_target_view())
            .await
            .context("failed to fetch current target blueprint")
    };

at which point we could drop the check for args.enabled entirely here:

-    let found_enabled = if args.diff
-        || matches!(args.enabled, BlueprintTargetSetEnabled::Inherit)
-    {
-        let current_target = client
-            .blueprint_target_view()
-            .await
-            .context("failed to fetch current target blueprint")?
-            .into_inner();
-
     if args.diff {
+        let current_target = get_current_target().await?;
         let blueprint1 = client
             .blueprint_view(&current_target.target_id)
             .await
@@ -1755,11 +1748,6 @@ async fn cmd_nexus_blueprints_target_set(
         prompt.read_and_validate("y/N", "y")?;
     }

-        Some(current_target.enabled)
-    } else {
-        None
-    };
-
     let enabled = match args.enabled {
         BlueprintTargetSetEnabled::Enabled => true,
         BlueprintTargetSetEnabled::Disabled => false,
@@ -1772,9 +1760,9 @@ async fn cmd_nexus_blueprints_target_set(
         // operator. (In the case of the current target blueprint being changed
         // entirely, that will result in a failure to set the current target
         // below, because its parent will no longer be the current target.)
-        //
-        // unwrap(): this is always `Some` due to the branch above.
-        BlueprintTargetSetEnabled::Inherit => found_enabled.unwrap(),
+        BlueprintTargetSetEnabled::Inherit => {
+            get_current_target().await?.enabled
+        }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. I tried and failed to do this before. I'll take a look at that diff and see if I can make it work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great! I like this much better. Done in f9beb4c.

@davepacheco
Copy link
Collaborator Author

davepacheco commented Aug 26, 2024

Testing on f9beb4c. Set up:

$ export OMDB_NEXUS_URL=http://[::1]:12221

First, verify you can just set a target with "inherit" the same as before:

$ ./target/debug/omdb -w nexus blueprints regenerate
note: using Nexus URL http://[::1]:12221
generated new blueprint cf21f8f8-122e-40ca-a251-72d3b861600c

$ ./target/debug/omdb -w nexus blueprints list
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
* no  cef69d11-850e-49b9-bbf1-e152b3a4fb5c <none>                               2024-08-26T18:08:33.772Z 
      cf21f8f8-122e-40ca-a251-72d3b861600c cef69d11-850e-49b9-bbf1-e152b3a4fb5c 2024-08-26T18:09:53.523Z 

$ ./target/debug/omdb -w nexus blueprints target set cf21f8f8-122e-40ca-a251-72d3b861600c inherit
note: using Nexus URL http://[::1]:12221
set target blueprint to cf21f8f8-122e-40ca-a251-72d3b861600c

$ ./target/debug/omdb -w nexus blueprints list
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
      cef69d11-850e-49b9-bbf1-e152b3a4fb5c <none>                               2024-08-26T18:08:33.772Z 
* no  cf21f8f8-122e-40ca-a251-72d3b861600c cef69d11-850e-49b9-bbf1-e152b3a4fb5c 2024-08-26T18:09:53.523Z 

Same, but this time enable the original target first:

$ ./target/debug/omdb -w nexus blueprints list
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT TIME_CREATED             
* no  009ab3d9-15cf-4350-a785-cd95e06c353b <none> 2024-08-26T18:12:08.164Z 
$ ./target/debug/omdb -w nexus blueprints target enable 009ab3d9-15cf-4350-a785-cd95e06c353b
note: using Nexus URL http://[::1]:12221
set target blueprint 009ab3d9-15cf-4350-a785-cd95e06c353b to enabled
$ ./target/debug/omdb -w nexus blueprints regenerate
note: using Nexus URL http://[::1]:12221
generated new blueprint 474572e1-3c92-4d88-8bcf-f2ba9669cfbc
$ ./target/debug/omdb -w nexus blueprints target set 474572e1-3c92-4d88-8bcf-f2ba9669cfbc inherit
note: using Nexus URL http://[::1]:12221
set target blueprint to 474572e1-3c92-4d88-8bcf-f2ba9669cfbc
$ ./target/debug/omdb -w nexus blueprints list
note: using Nexus URL http://[::1]:12221
T ENA ID                                   PARENT                               TIME_CREATED             
      009ab3d9-15cf-4350-a785-cd95e06c353b <none>                               2024-08-26T18:12:08.164Z 
* yes 474572e1-3c92-4d88-8bcf-f2ba9669cfbc 009ab3d9-15cf-4350-a785-cd95e06c353b 2024-08-26T18:12:24.051Z 

Now with diff, but abort:

$ ./target/debug/omdb -w nexus blueprints regenerate
note: using Nexus URL http://[::1]:12221
generated new blueprint 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9

$ ./target/debug/omdb -w nexus blueprints target set --diff 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9 enabled
note: using Nexus URL http://[::1]:12221
from: blueprint 22673a03-8d99-46fa-b343-e0a605f9a2f7
to:   blueprint 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9

 MODIFIED SLEDS:

  sled 039be560-54cc-49e3-88df-1a29dadbf913:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-0aa0e908-7947-4bc3-b8ca-77320b9a82c4
+   synthetic-vendor   synthetic-model   synthetic-serial-0b337c63-5bf4-4a42-8e26-040350d4d847
+   synthetic-vendor   synthetic-model   synthetic-serial-46ebbaf8-de5f-4e74-b845-4bc6cc7a1725
+   synthetic-vendor   synthetic-model   synthetic-serial-5f406667-2a90-4d47-a990-1339a0a673c9
+   synthetic-vendor   synthetic-model   synthetic-serial-60b4c535-2e81-4867-8506-9f460c302a46
+   synthetic-vendor   synthetic-model   synthetic-serial-72e1d5e7-eae2-4252-b465-2dc3f8ee15ee
+   synthetic-vendor   synthetic-model   synthetic-serial-8ed97027-002a-4907-8a68-29adc4267ccf
+   synthetic-vendor   synthetic-model   synthetic-serial-b3c394be-7539-4419-8062-dd77e31b1a12
+   synthetic-vendor   synthetic-model   synthetic-serial-c0580fa2-cc53-4e37-8795-705ef55d5986
+   synthetic-vendor   synthetic-model   synthetic-serial-d3476c60-303d-4c40-8714-7ea75022a9e5


    omicron zones generation 2 -> 3:
    -------------------------------------------------------------------------------
    zone type      zone id                                disposition   underlay IP
    -------------------------------------------------------------------------------
+   internal_ntp   b9e5c118-ad9e-402b-a2de-d11e55d80c6b   in service    ::21       


  sled b6d65341-167c-41df-9b5c-41cded99c229:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-0baa768f-119e-4894-9b66-3a89d6d13934
+   synthetic-vendor   synthetic-model   synthetic-serial-2c1c71ae-da9e-4e8a-8dfd-f27832e8f787
+   synthetic-vendor   synthetic-model   synthetic-serial-63ab1457-73c9-40dd-be19-86161033a5dd
+   synthetic-vendor   synthetic-model   synthetic-serial-71e85943-c814-425a-b284-0c858c7894a7
+   synthetic-vendor   synthetic-model   synthetic-serial-86c6ea51-57fd-4a61-b928-3a15e1946db0
+   synthetic-vendor   synthetic-model   synthetic-serial-9270d17e-21f5-4851-9d04-4eece48b5f59
+   synthetic-vendor   synthetic-model   synthetic-serial-967a12ca-7021-4376-9cff-603042ecb48b
+   synthetic-vendor   synthetic-model   synthetic-serial-c0ace7f2-d9a3-41ff-9b53-035504770e2e
+   synthetic-vendor   synthetic-model   synthetic-serial-d64ad9ec-862b-4b60-b91c-61be73d27403
+   synthetic-vendor   synthetic-model   synthetic-serial-e7f30bca-b801-40a7-bc68-3c3de15748b0


    omicron zones generation 2 -> 3:
    -----------------------------------------------------------------------------------
    zone type         zone id                                disposition    underlay IP
    -----------------------------------------------------------------------------------
*   clickhouse        8f748124-e0f8-44e2-8325-38b121c9c8d3   - in service   ::1        
     └─                                                      + expunged                
*   cockroach_db      d241d7f9-ac30-45ff-8d95-b8cb958ed121   - in service   ::1        
     └─                                                      + expunged                
*   crucible_pantry   3b1fc3e8-0ae2-40d4-bde0-9168b1119ef3   - in service   ::1        
     └─                                                      + expunged                
*   external_dns      51284ecc-3e83-4d2f-8fc7-0ed8b8e0b30f   - in service   ::1        
     └─                                                      + expunged                
*   internal_dns      1cf93c34-3ba5-49aa-bc83-e486c6b7f05e   - in service   ::1        
     └─                                                      + expunged                
*   nexus             e6bff1ff-24fb-49dc-a54e-c6a350cd4d6c   - in service   ::1        
     └─                                                      + expunged                
+   internal_ntp      85994d5b-f1fa-447a-b675-fff255a9064c   in service     ::21       


 COCKROACHDB SETTINGS:
    state fingerprint:::::::::::::::::   d4d87aa2ad877a4cc2fddd0573952362739110de (unchanged)
    cluster.preserve_downgrade_option:   "22.1" (unchanged)

 METADATA:
    internal DNS version:   1 (unchanged)
    external DNS version:   2 (unchanged)



Do you want to make 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9 the target blueprint?
y/N〉no
Error: Aborting, input did not match expected value

Now, with diff and confirm:

$ ./target/debug/omdb -w nexus blueprints target set --diff 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9 enabled
note: using Nexus URL http://[::1]:12221
from: blueprint 22673a03-8d99-46fa-b343-e0a605f9a2f7
to:   blueprint 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9

 MODIFIED SLEDS:

  sled 039be560-54cc-49e3-88df-1a29dadbf913:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-0aa0e908-7947-4bc3-b8ca-77320b9a82c4
+   synthetic-vendor   synthetic-model   synthetic-serial-0b337c63-5bf4-4a42-8e26-040350d4d847
+   synthetic-vendor   synthetic-model   synthetic-serial-46ebbaf8-de5f-4e74-b845-4bc6cc7a1725
+   synthetic-vendor   synthetic-model   synthetic-serial-5f406667-2a90-4d47-a990-1339a0a673c9
+   synthetic-vendor   synthetic-model   synthetic-serial-60b4c535-2e81-4867-8506-9f460c302a46
+   synthetic-vendor   synthetic-model   synthetic-serial-72e1d5e7-eae2-4252-b465-2dc3f8ee15ee
+   synthetic-vendor   synthetic-model   synthetic-serial-8ed97027-002a-4907-8a68-29adc4267ccf
+   synthetic-vendor   synthetic-model   synthetic-serial-b3c394be-7539-4419-8062-dd77e31b1a12
+   synthetic-vendor   synthetic-model   synthetic-serial-c0580fa2-cc53-4e37-8795-705ef55d5986
+   synthetic-vendor   synthetic-model   synthetic-serial-d3476c60-303d-4c40-8714-7ea75022a9e5


    omicron zones generation 2 -> 3:
    -------------------------------------------------------------------------------
    zone type      zone id                                disposition   underlay IP
    -------------------------------------------------------------------------------
+   internal_ntp   b9e5c118-ad9e-402b-a2de-d11e55d80c6b   in service    ::21       


  sled b6d65341-167c-41df-9b5c-41cded99c229:

    physical disks at generation 1:
    ------------------------------------------------------------------------------------------
    vendor             model             serial                                               
    ------------------------------------------------------------------------------------------
+   synthetic-vendor   synthetic-model   synthetic-serial-0baa768f-119e-4894-9b66-3a89d6d13934
+   synthetic-vendor   synthetic-model   synthetic-serial-2c1c71ae-da9e-4e8a-8dfd-f27832e8f787
+   synthetic-vendor   synthetic-model   synthetic-serial-63ab1457-73c9-40dd-be19-86161033a5dd
+   synthetic-vendor   synthetic-model   synthetic-serial-71e85943-c814-425a-b284-0c858c7894a7
+   synthetic-vendor   synthetic-model   synthetic-serial-86c6ea51-57fd-4a61-b928-3a15e1946db0
+   synthetic-vendor   synthetic-model   synthetic-serial-9270d17e-21f5-4851-9d04-4eece48b5f59
+   synthetic-vendor   synthetic-model   synthetic-serial-967a12ca-7021-4376-9cff-603042ecb48b
+   synthetic-vendor   synthetic-model   synthetic-serial-c0ace7f2-d9a3-41ff-9b53-035504770e2e
+   synthetic-vendor   synthetic-model   synthetic-serial-d64ad9ec-862b-4b60-b91c-61be73d27403
+   synthetic-vendor   synthetic-model   synthetic-serial-e7f30bca-b801-40a7-bc68-3c3de15748b0


    omicron zones generation 2 -> 3:
    -----------------------------------------------------------------------------------
    zone type         zone id                                disposition    underlay IP
    -----------------------------------------------------------------------------------
*   clickhouse        8f748124-e0f8-44e2-8325-38b121c9c8d3   - in service   ::1        
     └─                                                      + expunged                
*   cockroach_db      d241d7f9-ac30-45ff-8d95-b8cb958ed121   - in service   ::1        
     └─                                                      + expunged                
*   crucible_pantry   3b1fc3e8-0ae2-40d4-bde0-9168b1119ef3   - in service   ::1        
     └─                                                      + expunged                
*   external_dns      51284ecc-3e83-4d2f-8fc7-0ed8b8e0b30f   - in service   ::1        
     └─                                                      + expunged                
*   internal_dns      1cf93c34-3ba5-49aa-bc83-e486c6b7f05e   - in service   ::1        
     └─                                                      + expunged                
*   nexus             e6bff1ff-24fb-49dc-a54e-c6a350cd4d6c   - in service   ::1        
     └─                                                      + expunged                
+   internal_ntp      85994d5b-f1fa-447a-b675-fff255a9064c   in service     ::21       


 COCKROACHDB SETTINGS:
    state fingerprint:::::::::::::::::   d4d87aa2ad877a4cc2fddd0573952362739110de (unchanged)
    cluster.preserve_downgrade_option:   "22.1" (unchanged)

 METADATA:
    internal DNS version:   1 (unchanged)
    external DNS version:   2 (unchanged)



Do you want to make 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9 the target blueprint?
y/N〉y
set target blueprint to 2ddaa1bc-032e-46dd-b9f5-33bcb4db7cc9
$

@davepacheco davepacheco enabled auto-merge (squash) August 26, 2024 18:15
@davepacheco davepacheco merged commit 219121a into main Aug 26, 2024
22 checks passed
@davepacheco davepacheco deleted the dap/omdb-work branch August 26, 2024 19:46
nickryand pushed a commit to nickryand/omicron that referenced this pull request Aug 27, 2024
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.

2 participants