Repository navigation
Add sled-agent API for managing attached subnets - #9778
Merged
Merged
Conversation
bnaecker
commented
Feb 3, 2026
Collaborator
- Add APIs to the sled agent for attaching and detaching either a single subnet on an instance, or setting / clearing the entire set for an instance.
- Add list of attached subnets in the instance-creation request body, and fill that in from Nexus with the (currently-empty) set of attached subnets for the target instnace.
- Plumb attachment requests all the way through the sled-agent internals to the new APIs in OPTE.
- Add mapping of attached subnets per-instance to the simulated sled agent for testing.
- Fixes Add sled-agent API for attached external subnets #9702
- Add APIs to the sled agent for attaching and detaching either a single subnet on an instance, or setting / clearing the entire set for an instance. - Add list of attached subnets in the instance-creation request body, and fill that in from Nexus with the (currently-empty) set of attached subnets for the target instnace. - Plumb attachment requests all the way through the sled-agent internals to the new APIs in OPTE. - Add mapping of attached subnets per-instance to the simulated sled agent for testing. - Fixes #9702
bnaecker
force-pushed
the
sled-agent-attached-subnet-api
branch
from
February 3, 2026 00:53
7f014c4 to
5851b43
Compare
rcgoodfellow
reviewed
Feb 3, 2026
jgallagher
reviewed
Feb 3, 2026
FelixMcFelix
approved these changes
Feb 3, 2026
FelixMcFelix
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this Ben, the impl makes sense to me reading through. Just some nits in addition to the existing comments.
- Update instance's view of attached subnets based on what actually gets applied in OPTE. - Enum to describe attached subnet kind, instead of boolean. - Inline error chain, contains_key over get, and a few other minor fixes
rcgoodfellow
approved these changes
Feb 4, 2026
jgallagher
approved these changes
Feb 4, 2026
sunshowers
added a commit
that referenced
this pull request
Oct 22, 2026
When a VMM is registered in Sled Agent, the instance's attached subnets are sent in the `InstanceSledLocalConfig`. Previously (since #9778), we discarded them in Sled Agent and created the VMM's OPTE ports with no attached subnets. This meant that any traffic to and from the subnets was dropped at the OPTE port. This bug occurs on every VMM registration for an instance with attached subnets -- certainly starts and restarts, but also (once they are implemented) live migrations. The good news is that the buggy situation doesn't last very long, because the correct state is fully restored by the `attached_subnet_manager` background task, which is run every 60 seconds by every Nexus instance. Hooray for reconciliation loops, I guess? Of course, we should fix the bug. Do this by building the VMM's attached subnets from the registration requests. If a caller lists the same subnet more than once, we reject the registration with a 400. (In a subsequent commit, we'll add a new Sled Agent API version which expresses this constraint in the type system.) This bug was introduced in #9778, which shipped in v18.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.