Skip to content

Conversation

peter8498
Copy link
Collaborator

@peter8498 peter8498 commented Jul 16, 2025

Using jinja logic to loop through breakout_interfaces and build up breakout cli string.

Related Issue(s)

No issue raised

Related Collection Role

  • cisco.nac_dc_vxlan.validate
  • [ x] cisco.nac_dc_vxlan.dtc.create
  • cisco.nac_dc_vxlan.dtc.deploy
  • cisco.nac_dc_vxlan.dtc.remove
  • other

Related Data Model Element

  • vxlan.fabric
  • vxlan.global
  • [x ] vxlan.topology
  • vxlan.underlay
  • vxlan.overlay
  • vxlan.overlay_extensions
  • vxlan.policy
  • vxlan.multisite
  • defaults.vxlan
  • other

Proposed Changes

Added new logic based off the flag breakout.enable_during_bootstrap in the data model (already defined) to
loop through the breakout_interaces and build up the CLI string that is then passed into the inventory module
to support the breakout of pre-provisioned switches.
Using the existing breakout structure on pre-prov does not work and even if you created the trunk interface first
and breakout, it errors in both the GUI and the module.

There is a possibility of doing the CLI logic in Python, but thought it was more maintainable to it in the jinja template, but
open to reviews on this.

Need to add some explanation in the documentation of how this flag works and the way it differs and why we need it on pre-prov switches. Also once the switch has been added you cannot update or delete this config. That shoudl then be done with breakout with the flag set to false (or no included).

Test Notes

Tested with data liek this:

---
vxlan:
  topology:
    switches:
      #Spines
      - name: XX-FAB-SPN01A
        serial_number: xxxxxx
        role: border_gateway_spine
        management:
          default_gateway_v4: 11.1.1.1
          management_ipv4_address: 1.1.1.1
          subnet_mask_ipv4: 24
        poap:
          bootstrap: false
          preprovision:
            serial_number: xxxxxxxx
            model: N9K-C9364D-GX2A
            version: 10.4(4)
            modulesModel: ["N9K-C9364D-GX2A"]
        interface_breakouts:
          - module: 1
            from: 3
            map: 100g-4x
            enable_during_bootstrap: true
          - module: 1
            from: 35
            map: 100g-4x
            enable_during_bootstrap: true
        routing_loopback_id: 0
        vtep_loopback_id: 1

Cisco NDFC Version

12.2.2

Checklist

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

Using jinja logic to loop through breakout_interfaces and build up breakout cli string.
@peter8498 peter8498 requested a review from a team as a code owner July 16, 2025 09:14
@peter8498 peter8498 added the ready for review PR Ready for Review label Jul 16, 2025
Updated this check so that it defaults to false if not provided
Changed the remove role so that it includes the pre-provisioned switches and then the overridden method of the interface module will then inculde these pre-prov interfaces
Added into the code to check if the switch is unreachable to pop out any breakout interfaces for that switch as they will fail. Need to wait for the switch to poap and create the breakouts first
Updated after some testing where no breakouts are provided
Updated to reverse condition
@mikewiebe mikewiebe added the 0.5.0 Release 0.5.0 label Aug 21, 2025
peter8498 and others added 6 commits September 11, 2025 12:57
Don't need the when clause as it would not get triggered for pre-prov which is what we need this structure for
No need for this clause as we always need to create this list. If nothing to add it will be instantiated as an empty list
No longer needed as handled by the module now
@juburnet
Copy link
Collaborator

@mikewiebe - On the call today, @peter8498 said he tested this and that it is working.

@mtarking mtarking merged commit 042fc82 into develop Sep 17, 2025
8 checks passed
@mtarking mtarking deleted the fix_breakout_preprov branch September 17, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.5.0 Release 0.5.0 ready for review PR Ready for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants