Skip to content

nd_interface_vpc_trunk_host#280

Open
allenrobel wants to merge 2 commits into
nd_interface_vpc_accessfrom
nd_interface_vpc_trunk_host
Open

nd_interface_vpc_trunk_host#280
allenrobel wants to merge 2 commits into
nd_interface_vpc_accessfrom
nd_interface_vpc_trunk_host

Conversation

@allenrobel
Copy link
Copy Markdown
Collaborator

Related Issue(s)

Proposed Changes

  • Adds the nd_interface_vpc_trunk_host module, which manages vPC trunkVpcHost interfaces (template int_vpc_trunk_host) on Cisco Nexus Dashboard.
  • Adds TrunkVpcHostPolicyTypeEnum to plugins/module_utils/models/interfaces/enums.py so the model can frozen-pin its policy_type.
  • Inherits all CRUD, peer-serial resolution, per-interface DELETE, and query_all dedupe from VpcBaseOrchestrator (introduced in the nd_vpc_pair stack-grandparent PR).

Trunk-specific design (lab-verified on ND 4.2.1):

  • Single user-facing allowed_vlans and native_vlan fields fan out to peer1AllowedVlans / peer2AllowedVlans and peer1NativeVlan / peer2NativeVlan at payload-serialization time via a @model_serializer. ND collapses both per-peer pairs back to single allowedVlans / nativeVlan on 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. Tagged TODO(4.2.1).
  • Adds vlan_mapping and vlan_mapping_entries with shared AllowedVlans / CustomerVlanIdList validators (int→str coercion for the ND single-id echo, 1–4094 bounds, reversed-range rejection).
  • Per-peer peer1/peer2 member_ports / port_channel_id / port_channel_description / port_channel_configuration exposed (OpenAPI preserves these on read).
  • identifier_strategy = "single" on interface_name; switch_ip is routing-only and excluded from diff/payload.

Test Notes

  • 71 new unit tests (58 model + 13 orchestrator) plus a fixture JSON: 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).
  • Integration target tests/integration/targets/nd_interface_vpc_trunk_host/ with merged / replaced / overridden / deleted state 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_mapping cases gated on supports_vlan_mapping (Nexus 9000v rejects dot1q-tunnel).
  • ansible-test sanity --docker default --python 3.11 passes on the changed files.
  • Wire shape verified live: created vpc500 on 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

  • analyze
  • infa
  • manage
  • onemanage
  • other

Checklist

  • Latest commit is rebased from develop with merge conflicts resolved
  • New or updates to documentation has been made accordingly
  • Assigned the proper reviewers

@allenrobel allenrobel self-assigned this May 13, 2026
@allenrobel allenrobel changed the title nd_interface_vpc_trunk_host module nd_interface_vpc_trunk_host May 13, 2026
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from b03db99 to c3c54fd Compare May 14, 2026 03:11
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from c938a00 to 10c889c Compare May 14, 2026 03:11
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from c3c54fd to 2e09054 Compare May 14, 2026 18:42
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from 10c889c to b83fc22 Compare May 14, 2026 18:42
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 2e09054 to 0ddf68c Compare May 14, 2026 20:44
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from b83fc22 to 18e364b Compare May 14, 2026 20:44
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 0ddf68c to 9228400 Compare May 20, 2026 21:23
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from 18e364b to f4c5b9e Compare May 20, 2026 21:24
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 9228400 to 82a2549 Compare May 21, 2026 19:41
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from f4c5b9e to 7dc6ad5 Compare May 21, 2026 19:41
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 09aa4bd to a0c2186 Compare May 22, 2026 03:01
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from 7dc6ad5 to c11e3fd Compare May 22, 2026 03:01
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from a0c2186 to 31b969d Compare May 22, 2026 03:14
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from c11e3fd to a89d465 Compare May 22, 2026 03:14
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 31b969d to 3a61f1b Compare May 22, 2026 17:14
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from a89d465 to 3dd9544 Compare May 22, 2026 17:14
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 3a61f1b to 50f41b3 Compare May 28, 2026 17:34
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from 3dd9544 to ae72345 Compare May 28, 2026 17:34
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>
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 50f41b3 to 7e030b0 Compare May 28, 2026 18:16
@allenrobel allenrobel force-pushed the nd_interface_vpc_trunk_host branch from ae72345 to bcca758 Compare May 28, 2026 18:16
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.

1 participant