Skip to content

Conversation

@jgallagher
Copy link
Contributor

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.

Base automatically changed from sunshowers/spr/meta-remove-remaining-uses-of-idmap-idmap-itself to main November 13, 2025 18:40
@jgallagher jgallagher force-pushed the john/refactor-rss-blueprint branch from 28adb88 to 95744c5 Compare November 14, 2025 21:53
Copy link
Collaborator

@smklein smklein left a comment

Choose a reason for hiding this comment

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

Happy to see the sled agent exposing a smaller interface, and using inventory when that works instead.

Copy link
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@jgallagher jgallagher force-pushed the john/refactor-rss-blueprint branch from f92b587 to 36f2a70 Compare November 17, 2025 22:44
@jgallagher jgallagher changed the base branch from main to zl/vmm-register-api-version-correction November 17, 2025 22:45
@jgallagher
Copy link
Contributor Author

Rebased on top of #9407 to let it get into main first (both it and this PR rev sled-agent's API).

Base automatically changed from zl/vmm-register-api-version-correction to main November 18, 2025 00:12
@jgallagher jgallagher force-pushed the john/refactor-rss-blueprint branch from 36f2a70 to fe50b8f Compare November 18, 2025 14:20
@jgallagher jgallagher merged commit 73fa662 into main Nov 18, 2025
16 checks passed
@jgallagher jgallagher deleted the john/refactor-rss-blueprint branch November 18, 2025 17:06
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.

4 participants