-
Notifications
You must be signed in to change notification settings - Fork 48
[BGP] Implement EVPN Advanced Support in Terraform Provider #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[BGP] Implement EVPN Advanced Support in Terraform Provider #324
Conversation
- Add rewrite-evpn-rt-asn (boolean) for multi-AS EVPN deployments - Add nexthop trigger enable (boolean) as prerequisite for delay - Add nexthop trigger delay (uint8, 0-100) for nexthop tracking optimization YANG discovery revealed enable attribute is required due to when constraint. This implements 3 attributes (not 2) for complete YANG model support. Fixes #471
| tf_name: rewrite_evpn_rt_asn | ||
| example: true | ||
| - yang_name: l2vpn-evpn/bgp/nexthop/trigger/enable | ||
| tf_name: nexthop_trigger_enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we add the bgp_ prefix here for clarity?
| - yang_name: l2vpn-evpn/bgp/nexthop/trigger/enable | ||
| tf_name: nexthop_trigger_enable | ||
| example: true | ||
| default_value: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we set a default value here?
| example: true | ||
| default_value: true | ||
| - yang_name: l2vpn-evpn/bgp/nexthop/trigger/delay | ||
| tf_name: nexthop_trigger_delay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clicked wrong button, I am reviewing the suggestions above
|
Hi @danischm, thanks for the review! Re: Naming Convention (bgp_ prefix)Agreed - I'll add the
This aligns with the YANG path structure ( Re: Default Values & nexthop_trigger_enableGood catch on the defaults! After reviewing the YANG model and IOS-XE behavior: Proposed Solution: Remove Reasoning:
Updated Implementation: # BEFORE (3 attributes)
rewrite_evpn_rt_asn: true
nexthop_trigger_enable: true # ← Remove this
nexthop_trigger_delay: 10
# AFTER (2 attributes)
rewrite_evpn_rt_asn: true
bgp_nexthop_trigger_delay: 10 # ← Renamed with bgp_ prefixImpact: This simplifies the implementation and will require updates across the |
- Remove nexthop_trigger_enable (IOS-XE default is true) - Rename nexthop_trigger_delay -> bgp_nexthop_trigger_delay (add bgp_ prefix) - Simplifies user experience (only configure delay value) - Aligns with reviewer feedback on PR CiscoDevNet#324
Related Issue(s)
Fixes #471
Proposed Changes
This PR implements support for BGP L2VPN EVPN advanced configuration attributes, enabling fine-tuned control over EVPN routing behavior and nexthop tracking optimization.
Changes Made:
YANG Definition Updates (Manual):
gen/definitions/bgp_address_family_l2vpn.yaml- Added 3 new attributes for EVPN advanced configurationAuto-Generated Code Updates (via
make gen):Attributes Implemented:
rewrite_evpn_rt_asn(boolean)/native/router/ios-bgp:bgp/address-family/no-vrf/l2vpn/l2vpn-evpn/rewrite-evpn-rt-asnempty(mapped to boolean)nexthop_trigger_enable(boolean)/native/router/ios-bgp:bgp/address-family/no-vrf/l2vpn/l2vpn-evpn/bgp/nexthop/trigger/enablebooleantruenexthop_trigger_delay(integer)/native/router/ios-bgp:bgp/address-family/no-vrf/l2vpn/l2vpn-evpn/bgp/nexthop/trigger/delayuint8nexthop_trigger_enable = true(YANGwhenconstraint)Configuration Example:
Resulting IOS-XE Configuration:
Robot Test(s)
Test Environment:
Test Results:
Terraform Plan:
Terraform Apply:
Idempotency Test (Second Apply):
$ terraform apply -auto-approve iosxe_bgp_address_family_l2vpn.evpn_advanced_test: Refreshing state... No changes. Your infrastructure matches the configuration. Apply complete! Resources: 0 added, 0 changed, 0 destroyed.✓ Idempotency Verified: Provider correctly reads back configuration
Device Verification:
Test Artifacts:
Cisco IOS-XE Version
Developed Against: IOS-XE 17.x (CSR1000v)
YANG Module: Cisco-IOS-XE-bgp (revision 2024-07-01)
External Repo Link
This PR is part of a coordinated enhancement across three repositories:
Master Epic: #474 - Complete EVPN Advanced Configuration Support
Note: Issues #472 and #473 will be submitted as PRs for review and will be pending the release of this provider change.
Checklist
make gen)Additional Notes
Critical YANG Discovery:
During YANG model exploration, we discovered that the
nexthop trigger delayattribute has a YANGwhenconstraint:when ../enable = 'true'. This means users cannot configure the delay without the enable attribute being true.Issue Description specified 2 CLI commands:
YANG Model revealed 3 attributes are required:
While the
enableattribute defaults totrue, implementing all 3 attributes provides:Build Process:
Backwards Compatibility:
✓ This change is fully backwards compatible. Existing L2VPN EVPN configurations continue to work. The new attributes are optional and default to standard EVPN behavior.
Use Cases:
Multi-AS EVPN Deployments:
rewrite_evpn_rt_asn = trueenables RT rewriting when EVPN routes cross AS boundariesNexthop Tracking Optimization:
nexthop_trigger_enable = true(default) maintains standard nexthop trackingnexthop_trigger_delay = 10adds a 10-second delay before triggering nexthop tracking, useful for:Files Changed:
gen/definitions/bgp_address_family_l2vpn.yaml(manual edit)make gen:internal/provider/model_iosxe_bgp_address_family_l2vpn.gointernal/provider/resource_iosxe_bgp_address_family_l2vpn.gointernal/provider/data_source_iosxe_bgp_address_family_l2vpn.godocs/resources/bgp_address_family_l2vpn.mddocs/data-sources/bgp_address_family_l2vpn.mdexamples/resources/iosxe_bgp_address_family_l2vpn/resource.tfTotal: 9 files changed, +166 lines
This PR enables comprehensive EVPN advanced configuration support, providing network engineers with granular control over EVPN routing behavior and nexthop tracking optimization.