[ND 4.2+] Add Interface Groups Module - #495
Open
nikhilsrikrishna wants to merge 16 commits into
Open
Conversation
nikhilsrikrishna
marked this pull request as ready for review
August 19, 2026 06:03
nikhilsrikrishna
requested review from
akinross,
allenrobel,
anvitha-jain,
gmicol,
lhercot,
mikewiebe,
mtarking,
sajagana,
samiib and
shrsr
as code owners
August 19, 2026 06:03
nikhilsrikrishna
marked this pull request as draft
August 19, 2026 11:06
nikhilsrikrishna
marked this pull request as ready for review
August 21, 2026 08:42
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.
Related Issue(s)
Closes #326
Proposed Changes
Adds the
cisco.nd.nd_manage_interface_groupmodule for managing Interface Groups in Cisco Nexus Dashboard fabrics.Module capabilities
merged,replaced,overridden,deleted, andgatheredstates.any,ethernetCustom,ethernetWithPolicy,ethernetWithoutPolicy,portChannel, andvpc.NDOutput, including verbosity-based request diagnostics.deploy: false.State behavior
mergedis additive for networks, switch interfaces, Ethernet attributes, and custom-template inputs. Existing values omitted from the task are preserved.replacedauthoritatively manages explicitly supplied fields while preserving omitted network and interface collections. Explicit empty lists clear those collections.overriddenapplies the requested authoritative configuration and removes Interface Groups omitted from the task.replacedandoverriddenare validated before mutation and performed in the required remove-then-add order.anygroup can contain Ethernet, port-channel, and vPC members. Member additions are submitted in homogeneous batches where required by the controller.The additive nested-list handling is implemented specifically for Interface Groups so that
state=mergeddoes not remove existing networks or members omitted from the task.Shared state-machine extension
This PR adds an optional
prepare_mutations()hook to the shared orchestrator state machine.The existing state-machine flow performs validation and then proceeds directly to normal create/update reconciliation. Interface Groups require an additional ordered step when moving an interface between groups:
Adding the interface to the target first can fail because the controller still considers it owned by the source group. Performing the removal during normal target reconciliation is also too late.
The new hook runs after all preflight validation succeeds but before create/update reconciliation begins. This ensures that no prerequisite mutation is attempted until the complete task has passed validation.
The base
NDBaseOrchestratorimplementation is a no-op, so existing modules retain their current behavior. Interface Groups override the hook to perform the required source-group detachment.In check mode, the hook does not call the controller. It updates only the in-memory state so that the predicted
after,changed, and subsequent reconciliation results represent the complete move.The hook can also support future modules that require ordered prerequisite mutations before their normal resource updates, without requiring those modules to replace or duplicate the shared reconciliation flow.
Validation and error handling
changed: falsewhen no mutation occurred.Deployment behavior
cisco.nd.nd_manage_networkswhen network deployment must be handled separately.deploy: falsestages the Interface Group intent without issuing a deployment request.Integration-test harness
The Interface Groups integration suite follows the check-mode, apply, idempotency, and read-only controller-validation pattern proposed in #337.
Because #337 is still in flight, this PR includes a lightweight interim version of the harness containing the functionality required by the Interface Groups suite. It will be aligned with the final shared implementation if #337 changes before merging.
For negative scenarios, this suite provides a lightweight task-level equivalent of the proposed per-phase message validation by asserting that the returned failure message contains the expected text. The reusable
msg_containsharness option and non-GET call-count expectation proposed on #337 are not introduced as shared harness features in this PR.Test Notes
Unit-test coverage includes:
The integration-test target includes:
any, and optional vPC membershipdeploy: falsemerged,replaced,overridden,deleted, andgatheredEnvironment-dependent vPC and custom-template cases can be enabled through the integration configuration when the required fixtures are available.
Related ND API Resource Category
Checklist