Skip to content
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

Refactor(eos_cli_config_gen): Add support to set vlan and vni ranges in vxlan interface #4749

Open
wants to merge 20 commits into
base: devel
Choose a base branch
from

Conversation

laxmikantchintakindi
Copy link
Contributor

@laxmikantchintakindi laxmikantchintakindi commented Nov 21, 2024

Change Summary

Add support to set vlan and vni ranges in vxlan interface

Related Issue(s)

Fixes #4664

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

Add support to set vlan and vni ranges in vxlan interface.

How to test

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4749
# Activate the virtual environment
source test-avd-pr-4749/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@refactor/eos_cli/vxlan_vni#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,refactor/eos_cli/vxlan_vni --force
# Optional: Install AVD examples
cd test-avd-pr-4749
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated labels Nov 21, 2024
@Shivani-gslab Shivani-gslab marked this pull request as ready for review November 22, 2024 12:49
@Shivani-gslab Shivani-gslab requested review from a team as code owners November 22, 2024 12:49
@Shivani-gslab Shivani-gslab marked this pull request as draft November 22, 2024 12:56
@laxmikantchintakindi
Copy link
Contributor Author

laxmikantchintakindi commented Nov 29, 2024

Shall I add ability to set multicast_group on vlan ranges?

vxlan_interface:
  vxlan1:
    description: DC1-LEAF2A_VTEP
    vxlan:
        - id: 113,115-118
          vni: 10113,10115-10118
          multicast_group: 239.1.1.1

This will result in below commands:

vxlan vlan 113,115-118 vni 10113,10115-10118
vxlan vlan 113 multicast group 239.1.1.1
vxlan vlan 115 multicast group 239.1.1.1
vxlan vlan 116 multicast group 239.1.1.1
vxlan vlan 117 multicast group 239.1.1.1
vxlan vlan 118 multicast group 239.1.1.1

@gmuloc @ClausHolbechArista

@laxmikantchintakindi laxmikantchintakindi force-pushed the refactor/eos_cli/vxlan_vni branch 6 times, most recently from 3b5ee1c to 01469f9 Compare December 2, 2024 15:10
@Shivani-gslab Shivani-gslab marked this pull request as ready for review December 3, 2024 13:11
@Vibhu-gslab Vibhu-gslab marked this pull request as ready for review January 10, 2025 07:31
type: dict
description: |-
Set VNI on range of vlans.
If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.
Copy link
Contributor

Choose a reason for hiding this comment

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

vxlan_interface.vxlan1.vxlan.vlans is duplicated

Suggested change
If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.
If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlan_range`.

@@ -35,6 +35,9 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multicast_group</samp>](## "vxlan_interface.vxlan1.vxlan.vlans.[].multicast_group") | String | | | | IP Multicast Group Address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flood_vteps</samp>](## "vxlan_interface.vxlan1.vxlan.vlans.[].flood_vteps") | List, items: String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "vxlan_interface.vxlan1.vxlan.vlans.[].flood_vteps.[]") | String | | | | Remote VTEP IP Address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vlan_range</samp>](## "vxlan_interface.vxlan1.vxlan.vlan_range") | Dictionary | | | | Set VNI on range of vlans.<br>If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.<br>Number of VLANs must equal number of VNIs. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vlan_range</samp>](## "vxlan_interface.vxlan1.vxlan.vlan_range") | Dictionary | | | | Set VNI on range of vlans.<br>If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.<br>Number of VLANs must equal number of VNIs. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vlan_range</samp>](## "vxlan_interface.vxlan1.vxlan.vlan_range") | Dictionary | | | | Set VNI on range of vlans.<br>If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlan_range`.<br>Number of VLANs must equal number of VNIs. |

@@ -70,6 +73,9 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;multicast_group</samp>](## "vxlan_interface.Vxlan1.vxlan.vlans.[].multicast_group") | String | | | | IP Multicast Group Address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flood_vteps</samp>](## "vxlan_interface.Vxlan1.vxlan.vlans.[].flood_vteps") | List, items: String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "vxlan_interface.Vxlan1.vxlan.vlans.[].flood_vteps.[]") | String | | | | Remote VTEP IP Address. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vlan_range</samp>](## "vxlan_interface.Vxlan1.vxlan.vlan_range") | Dictionary | | | | Set VNI on range of vlans.<br>If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.<br>Number of VLANs must equal number of VNIs. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vlan_range</samp>](## "vxlan_interface.Vxlan1.vxlan.vlan_range") | Dictionary | | | | Set VNI on range of vlans.<br>If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.<br>Number of VLANs must equal number of VNIs. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vlan_range</samp>](## "vxlan_interface.Vxlan1.vxlan.vlan_range") | Dictionary | | | | Set VNI on range of vlans.<br>If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlan_range`.<br>Number of VLANs must equal number of VNIs. |

@@ -129,6 +135,18 @@

# Remote VTEP IP Address.
- <str>

# Set VNI on range of vlans.
# If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.
# If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlan_range`.

@@ -194,6 +212,18 @@

# Remote VTEP IP Address.
- <str>

# Set VNI on range of vlans.
# If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlans`.
# If vni is set on the vlan in `vxlan_interface.vxlan1.vxlan.vlans`, it should not overlap with `vxlan_interface.vxlan1.vxlan.vlan_range`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I change vxlan_interface.vxlan1.vxlan.vlan_range to vxlan_interface.vxlan1.vxlan.vlan_range.vlans?

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, this is probably even better

@laxmikantchintakindi laxmikantchintakindi marked this pull request as draft January 13, 2025 05:06
@laxmikantchintakindi laxmikantchintakindi marked this pull request as ready for review January 13, 2025 06:20
@@ -3787,6 +3787,7 @@ interface Vxlan1
vxlan flood vtep learned data-plane
vxlan vlan 110 vni 10110
vxlan vlan 111 vni 10111
vxlan vlan 113,115-118 vni 10113,10115-10118
Copy link
Contributor

Choose a reason for hiding this comment

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

discussion on PR review call: what happens with many tokens 1,3,5,7,9,11,... to see if EOS will wrap it.
We may need to be able to give multiple ranges if EOS wraps to make it possible to match the output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

s1-host1(config-if-Vx1)#sh active 
interface Vxlan1
   vxlan udp-port 4789
   vxlan vlan 10-13,17-20 vni 10010-10013,10017-10020

s1-host1(config-if-Vx1)#vxlan vlan add 25-30 vni 10025-10030

s1-host1(config-if-Vx1)#sh active 
interface Vxlan1
   vxlan udp-port 4789
   vxlan vlan 10-13,17-20,25-30 vni 10010-10013,10017-10020,10025-10030

Yes it is supporting multiple ranges and wraps all individual and ranges in a single line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For long input of vlan/vnis the command doesnt change.

s1-leaf1(config-if-Vx1)#Vxlan vlan 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31 vni 10001,10003,10005,10007,10009,10011,10013,10015,10017,10019,10021,10023,10025,10027,10029,10031
s1-leaf1(config-if-Vx1)#sh active 
interface Vxlan1
   vxlan udp-port 4789
   vxlan vlan 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31 vni 10001,10003,10005,10007,10009,10011,10013,10015,10017,10019,10021,10023,10025,10027,10029,10031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add range support for Vxlan vlan vni mapping under interface vxlan 1
6 participants