Skip to content

Commit 73fa662

Browse files
authored
RSS: Refactor how we construct the blueprint we hand off to Nexus (#9399)
This is mostly a refactor of how RSS generates the blueprint it hands off to Nexus. At the point we need to construct a blueprint, we have a `ServicePlan` and a `SledPlan` (both renamed imports from `Plan` structs in other modules). We have to combine these to construct the blueprint: `ServicePlan` contains all the sled configs but not the sled IDs, and `SledPlan` contains all the sled IDs. Both contained maps keyed by each sled's underlay address, so constructing a blueprint was a two step process: * Call `build_sled_configs_by_id(sled_plan, service_plan)` to match up the two maps via sled underlay addresses, producing a single map containing both sled IDs and sled configs * Pass that combined map into a helper function that actually constructed the blueprint However, this is largely unnecessary: `ServicePlan` did originally know all the sled IDs too - it just threw that information away. This PR changes `ServicePlan` to keep track of the sled IDs also, removing the need to join it against `SledPlan` later. The helper function that constructs a blueprint is now a `to_blueprint()` method on `ServicePlan` itself. (The motivator for this change is that I want to add some additional fields to `BlueprintSledConfig` that are also available to `ServicePlan`, and doing so is a lot easier if we already have this refactor in place.) There should be no behavioral changes in this PR, except for an extra small change that snuck in while I was here: Previously, RSS was asking each sled for its inventory and then separately asking for its role (i.e., scrimlet vs gimlet). But at some point we added the role to the inventory, so this PR removes the `get_sled_role` endpoint altogether, and RSS reads the role from the inventory it just fetched. (I did double check that the `inventory` and `get_sled_role` handlers read from exactly the same bit of information to determine the sled's role.) This is staged on top of #9391 to avoid merge conflicts touching some of these same bits.
1 parent 6bb047d commit 73fa662

File tree

8 files changed

+8986
-327
lines changed

8 files changed

+8986
-327
lines changed

nexus/mgs-updates/src/test_util/host_phase_2_test_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl HostPhase2TestContext {
127127
.version_policy(dropshot::VersionPolicy::Dynamic(Box::new(
128128
dropshot::ClientSpecifiesVersionInHeader::new(
129129
omicron_common::api::VERSION_HEADER,
130-
sled_agent_api::VERSION_MULTICAST_SUPPORT,
130+
sled_agent_api::latest_version(),
131131
),
132132
)))
133133
.start()

0 commit comments

Comments
 (0)