-
Notifications
You must be signed in to change notification settings - Fork 48
[sled-agent] Report boot partition contents of M.2 drives in inventory (PR 2/2) #8451
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
Conversation
From testing on
After uploading this same commit's TUF repo, we can confirm that the artifact hash and size is correct, and that it's been distributed to every sled:
|
7777e64
to
325544c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
-- Move any non-NULL `last_reconciled_config` values out of `inv_sled_agent` | ||
-- and into new rows in `inv_sled_config_reconciler`. We fill in the rest of the | ||
-- columns with dummy errors for old collections that don't have data. | ||
INSERT INTO omicron.public.inv_sled_config_reconciler ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -2505,6 +2505,151 @@ fn after_155_0_0<'a>(ctx: &'a MigrationContext<'a>) -> BoxFuture<'a, ()> { | |||
}) | |||
} | |||
|
|||
mod migration_156 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test!
This is stacked on top of #8450. It adds a
BootPartitionContents
structure to the inventory reported by the sled-agent-config-reconciler which contains:each of which is a
Result
in case we failed to determine any of those three items. In practice, I'd expect us to basically never fail to report which slot we booted from, and to only fail on the contents of a slot if that slot doesn't have a valid phase 2 image in it.Almost all of the changes here are related to updating the db schema to store this new information (and updating the queries to insert/read/delete the new tables).
up3.sql
is worth a particularly close look, because we've moved a field out ofinv_sled_agent
and into a new table, so that part of the migration attempts to ensure we create rows in the new table for each row ininv_sled_agent
that had a value for that field. There's a data migration test that covers this.