aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
290 stars 210 forks source link

Same VLAN ID can co-exist in svis and l2vlans #2407

Closed adietrich-ussignal closed 1 year ago

adietrich-ussignal commented 1 year ago

Issue Summary

When the same VLAN ID is configured in both svis and l2vlans, the conflict can cause un-wanted behavior that does not flood the VLAN across the BGP EVPN VXLAN fabric.

Which component(s) of AVD impacted

eos_designs

How do you run AVD ?

Ansible CLI with AVD Runner

Steps to reproduce

vrf_vni: 10
      svis:
         125:
            name: VLAN_125
            tags: [ tags ]
            enabled: true
            ip_address_virtual: 10.10.100.1/24
    l2vlans:
      125:
        name: VLAN125
        tags: [ tags ]

Relevant log output

The 'show interface vxlan 1' output based on this configuration. Note, VLAN125 is msising.

   110 10.255.24.7     10.255.24.11    10.255.24.9     10.255.24.5
   129 10.255.24.7     10.255.24.11    10.255.24.9     10.255.24.5


### Contributing Guide

- [X] I agree to follow this project's Code of Conduct
ClausHolbechArista commented 1 year ago

I have tested this and in the case of VLAN aware bundles this leads to the 125 being added to the VRF bundle and it's own "VLAN125" bundle. So indeed this is invalid configuration. I will work on detecting duplicate vlans and error out.

ClausHolbechArista commented 1 year ago

@adietrich-ussignal can I ask you to test PR #2411? It should error out if the duplicate VLAN IDs are deployed on a single device. Also catches duplicate VRF names and duplicate VNIs. Thanks.

adietrich-ussignal commented 1 year ago

LGTM.

Used the following data:

    USS_CE_SEC_MGMT:
        vrf_vni: 12
        svis:
        108:
            name: USS_CE_VXLAN
            tags: [ TAGS ]
            enabled: true
            ip_address_virtual: 10.10.10.1/24

    l2vlans:
      108:
        name: USS_CE_DIA_1
        tags: [ TAGS ]

Here's the output:

TASK [arista.avd.eos_designs : Generate device configuration in structured format] ****************************************************************************************************************************************************************************
ok: [celab-spine-01 -> localhost]
ok: [celab-spine-02 -> localhost]
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible_collections.arista.avd.plugins.plugin_utils.errors.errors.AristaAvdError: Duplicate VLAN ID '108' found in Tenant 'USS_CE' during configuration of L2VLAN.
[WARNING]: Failure using method (v2_runner_on_failed) in callback plugin (<ansible_collections.community.general.plugins.callback.yaml.CallbackModule object at 0x7fab59332fd0>): ('cannot represent an object', AristaAvdError("Duplicate VLAN ID '108' found
in Tenant 'USS_CE' during configuration of L2VLAN."))
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible_collections.arista.avd.plugins.plugin_utils.errors.errors.AristaAvdError: Duplicate VLAN ID '108' found in Tenant 'USS_CE' during configuration of L2VLAN.
changed: [celab-mmc-01b -> localhost]
changed: [celab-mmc-01a -> localhost]
changed: [celab-bl-01a -> localhost]
changed: [celab-bl-01b -> localhost]