nd_interface_vpc_trunk_host#280
Open
allenrobel wants to merge 2 commits into
Open
Conversation
b03db99 to
c3c54fd
Compare
c938a00 to
10c889c
Compare
c3c54fd to
2e09054
Compare
10c889c to
b83fc22
Compare
2e09054 to
0ddf68c
Compare
b83fc22 to
18e364b
Compare
0ddf68c to
9228400
Compare
18e364b to
f4c5b9e
Compare
9228400 to
82a2549
Compare
f4c5b9e to
7dc6ad5
Compare
09aa4bd to
a0c2186
Compare
7dc6ad5 to
c11e3fd
Compare
a0c2186 to
31b969d
Compare
c11e3fd to
a89d465
Compare
31b969d to
3a61f1b
Compare
a89d465 to
3dd9544
Compare
3a61f1b to
50f41b3
Compare
3dd9544 to
ae72345
Compare
Manages vPC trunkVpcHost interfaces (template int_vpc_trunk_host) on Cisco Nexus Dashboard, mirroring nd_interface_vpc_access and inheriting CRUD, peer-serial resolution, per-interface DELETE, and query_all dedupe from VpcBaseOrchestrator. Trunk-specific design: - Single user-facing allowed_vlans / native_vlan fields that fan out to peer1/peer2 keys at payload-serialization time. Lab-verified on ND 4.2.1 (vpc500 on S1_LE1/LE2): GET collapses both pairs to single fields, and POST/PUT rejects divergent peer values with HTTP 400. Marked TODO(4.2.1) on the model_serializer. - Adds vlan_mapping + vlan_mapping_entries with shared AllowedVlans / CustomerVlanIdList validators (int->str coercion, 1..4094 bounds, reversed-range rejection). - Keeps per-peer peer1/peer2 member_ports / port_channel_id / port_channel_description / port_channel_configuration as the OpenAPI schema preserves these on read. - Identifier strategy is single (interface_name only); switch_ip is routing-only and excluded from diff/payload. Includes: - TrunkVpcHostPolicyTypeEnum in models/interfaces/enums.py. - 71 unit tests (58 model + 13 orchestrator) with fan-out, validator, identifier, and round-trip coverage plus a fixture JSON mirroring the vpc_access orchestrator fixtures. - Integration target with merged / replaced / overridden / deleted state blocks, vlan_mapping gated on supports_vlan_mapping (9000v rejects dot1q-tunnel), 300s module timeout, and vPC pair setup/teardown via nd_vpc_pair. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
50f41b3 to
7e030b0
Compare
ae72345 to
bcca758
Compare
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)
Proposed Changes
nd_interface_vpc_trunk_hostmodule, which manages vPCtrunkVpcHostinterfaces (templateint_vpc_trunk_host) on Cisco Nexus Dashboard.TrunkVpcHostPolicyTypeEnumtoplugins/module_utils/models/interfaces/enums.pyso the model can frozen-pin itspolicy_type.query_alldedupe fromVpcBaseOrchestrator(introduced in thend_vpc_pairstack-grandparent PR).Trunk-specific design (lab-verified on ND 4.2.1):
allowed_vlansandnative_vlanfields fan out topeer1AllowedVlans/peer2AllowedVlansandpeer1NativeVlan/peer2NativeVlanat payload-serialization time via a@model_serializer. ND collapses both per-peer pairs back to singleallowedVlans/nativeVlanon GET, AND wire-side rejects divergent peer values with HTTP 400"…should be consistent"— so there is no use case for exposing the per-peer keys. TaggedTODO(4.2.1).vlan_mappingandvlan_mapping_entrieswith sharedAllowedVlans/CustomerVlanIdListvalidators (int→str coercion for the ND single-id echo, 1–4094 bounds, reversed-range rejection).peer1/peer2member_ports/port_channel_id/port_channel_description/port_channel_configurationexposed (OpenAPI preserves these on read).identifier_strategy = "single"oninterface_name;switch_ipis routing-only and excluded from diff/payload.Test Notes
python -m pytest tests/unit/module_utils/models/test_vpc_trunk_host_interface.py tests/unit/module_utils/orchestrators/test_vpc_trunk_host_interface.py -q. Full repo suite stays green (926 pass, no regressions).tests/integration/targets/nd_interface_vpc_trunk_host/withmerged/replaced/overridden/deletedstate coverage, exercised against ND 4.2.1 on the SITE1 lab (S1_LE1 / S1_LE2):ansible-test integration --docker nd_interface_vpc_trunk_host -vv.vlan_mappingcases gated onsupports_vlan_mapping(Nexus 9000v rejectsdot1q-tunnel).ansible-test sanity --docker default --python 3.11passes on the changed files.vpc500on S1_LE1/S1_LE2 with distinct then matching per-peer VLANs to confirm ND's consistency-enforcement + collapse-on-GET; clean per-interface DELETE cascades to both peers.Cisco Nexus Dashboard Version
4.2.1
Related ND API Resource Category
Checklist