Skip to content

Conversation

@camschaecisco
Copy link
Contributor

This PR migrates VLAN EVPN instance configuration to the current YANG path and adds support for EVPN instance profile-based configuration, enabling automated EVPN instance management through L2 profiles.

Breaking Changes

Rename evpn_instance to evpn_instance_legacy for IOS-XE versions < 17.15 (deprecated YANG path)
Rename evpn_instance_vni to evpn_instance_vni_legacy for IOS-XE versions < 17.15 (deprecated YANG path)
Update iosxe_vlan_configuration resource path from vlan/configuration to vlan/configuration-entry to align with current YANG model

New Features

Add evpn_instance, evpn_instance_vni, and evpn_instance_protected attributes using the current YANG path (member/evi-member/evpn-instance/manual-evi-config) for IOS-XE >= 17.15
Add evpn_instance_profile attribute for auto EVI configuration (CLI: member evpn-instance profile )
Add evpn_instance_profile_protected attribute for enabling local peer-to-peer blocking in profile-based configurations

Migration Path

Users on IOS-XE < 17.15 should use evpn_instance_legacy and evpn_instance_vni_legacy attributes. Users on IOS-XE >= 17.15 can continue using evpn_instance and evpn_instance_vni which now map to the current YANG path.

@camschaecisco camschaecisco force-pushed the feature/vlan-evpn-instance-profile-support branch 8 times, most recently from 5a2f720 to b14b1f6 Compare November 8, 2025 09:58
@camschaecisco
Copy link
Contributor Author

camschaecisco commented Nov 8, 2025

CI/CD git diff Validation Issue - Request for Guidance

I'm encountering a git diff --exit-code failure in the CI/CD pipeline that I'd appreciate guidance on resolving.

Context

This PR implements a legacy migration pattern similar to the DHCP snooping_vlans_legacy enhancement (commit f4f06551), where existing attributes are renamed with a _legacy suffix and new attributes are added on an updated YANG path.

The Issue

The CI/CD pipeline is failing on git diff --exit-code with formatting differences that appear to be generator version inconsistencies:

1. Documentation formatting:

# CI/CD generator wants:
vlan_id = "123"    # String with quotes

# My local generator produces:
vlan_id = 123      # Number without quotes

2. provider.go import formatting inconsistency:

My local environment produces different provider.go formatting depending on which tool runs last:

  • When I run goimports: Adds helpers import, removes slices/strings
  • When I run generator: Adds slices/strings, removes helpers
  • CI/CD generator output doesn't match either of my local outputs consistently

This creates a cycle where I commit one format, CI/CD wants another, I change it, CI/CD wants the original format back.

Key Discovery

The DHCP snooping_vlans_legacy migration (commit f4f06551, July 2025) did not encounter this issue because:

  • DHCP PR: 12 files changed, provider.go was NOT modified
  • My PR: 13 files changed, provider.go gets reformatted by generator

The provider.go formatting complexity was introduced later with the selected_devices feature (commit 0c5b34af, Sept 2025) which added slices/strings imports.

What I've Done

  1. ✅ Ran go run gen/generator.go vlan_configuration - produces git diff = 0 locally
  2. ✅ Ran go run golang.org/x/tools/cmd/goimports -w internal/provider/
  3. ✅ Selectively committed only VLAN-related files (discarded 600+ formatting changes on other resources)
  4. ✅ All functional testing passes (acceptance tests, Robot Framework, local testing)

Why Legacy Migration PRs Have This Challenge

New Feature PRs (Creating New Resources):

  • Run go run gen/generator.go [new_resource_name]
  • Generates ONLY the new resource files (typically 5-10 files)
  • Minimal changes = No merge conflicts
  • Provider.go either not touched OR minimal changes
  • ✅ Clean, isolated changes

Legacy Migration PRs (Modifying Existing Resources):

  • Resource files already exist in codebase
  • Specific generator (go run gen/generator.go [resource]) cannot add new attributes
  • Must run FULL generator (go run gen/generator.go) to add attributes
  • Full generator reformats ALL 616 files across all resources
  • Creates merge conflicts with any recent upstream changes
  • Must selectively commit ONLY your resource files
  • Discard 600+ formatting changes on unrelated files
  • ❌ More complex, higher chance of formatting inconsistencies

The original snooping_vlans_legacy migration (July 2025) didn't modify provider.go because the selected_devices feature (which added slices/strings imports) wasn't added until September 2025. This PR is navigating both:

  1. The full generator requirement (for adding attributes to existing resources)
  2. The new provider.go formatting complexity from selected_devices

This combination creates the infinite formatting loop we're experiencing.

Request

Could you advise on:

  1. How to ensure my local generator output matches CI/CD's expected format?
  2. Should provider.go formatting be handled differently for legacy migration PRs?

The feature code itself is fully tested and working - this is purely a generator output consistency challenge.

Thank you!

@camschaecisco
Copy link
Contributor Author

The related PR for the Terraform module can be found here: netascode/terraform-iosxe-nac-iosxe#88

These will need to be merged together due to the breaking change.

@aitestino aitestino added the enhancement New feature or request label Nov 9, 2025
---
name: VLAN Configuration
path: Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:configuration=%v
path: Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:configuration-entry=%v
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is configuration-entry fully supported on 17.12?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration-entry is supported in 17.12 but not fully supported. The profile is not added until 17.15

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but all the functionality that was there before is still working under 17.12 with this new path, right?

@danischm
Copy link
Member

Please use the make targets documented here (https://github.com/CiscoDevNet/terraform-provider-iosxe/blob/main/CONTRIBUTING.md#code-generation) to generate the code.

…port

BREAKING CHANGES:
- Rename evpn_instance to evpn_instance_legacy for IOS-XE < 17.15
- Rename evpn_instance_vni to evpn_instance_vni_legacy for IOS-XE < 17.15
- Update VLAN configuration path from 'configuration' to 'configuration-entry'

NEW FEATURES:
- Add evpn_instance, evpn_instance_vni, evpn_instance_protected for IOS-XE >= 17.15
- Add evpn_instance_profile and evpn_instance_profile_protected for auto EVI
- Support for 'member evpn-instance profile <profile-name>' CLI command

Generated using: make gen NAME="vlan_configuration"
@camschaecisco camschaecisco force-pushed the feature/vlan-evpn-instance-profile-support branch from 7ced02b to 14140fc Compare November 10, 2025 14:04
@camschaecisco camschaecisco force-pushed the feature/vlan-evpn-instance-profile-support branch from 0485d90 to 5128dde Compare November 10, 2025 14:34
@camschaecisco camschaecisco force-pushed the feature/vlan-evpn-instance-profile-support branch from 78480bb to 7b63ffb Compare November 10, 2025 14:41
@camschaecisco
Copy link
Contributor Author

Please use the make targets documented here (https://github.com/CiscoDevNet/terraform-provider-iosxe/blob/main/CONTRIBUTING.md#code-generation) to generate the code.

Thanks Daniel my apologies, I was using go run command instead of the make gen command. Make gen has resolved the issue.

Breaking Change

The related PR for the Terraform module can be found here: netascode/terraform-iosxe-nac-iosxe#88

These will need to be merged together due to the breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants