Skip to content

[ansible] Adding support for multi vlans#1353

Merged
tahmed-dev merged 9 commits intosonic-net:masterfrom
tahmed-dev:taahme/add-vlan-support
Jan 29, 2020
Merged

[ansible] Adding support for multi vlans#1353
tahmed-dev merged 9 commits intosonic-net:masterfrom
tahmed-dev:taahme/add-vlan-support

Conversation

@tahmed-dev
Copy link
Contributor

@tahmed-dev tahmed-dev commented Jan 23, 2020

Adding Vlan configuration section to existing topology configuration files. The vlan configuration has default default_vlan_cfg attribute which defines which vlan cfg to use. The behavior can be overridden by supplying vlan_cfg flag via cli.

one_vlan_a configuration will create single vlan with the name Vlan1000. This will not break existing test cases. Once existing test cases are able to handle different vlans, this behavior should be removed.

How to verify:

  1. Minigraph generation for a single Vlan; Vlan1000:
    ansible-playbook config_sonic_basedon_testbed.yml -i str -l -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true
    or
    ansible-playbook config_sonic_basedon_testbed.yml -i str -l -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true -e vlan_config=one_vlan_a

  2. Minigraph based on config file:
    ansible-playbook config_sonic_basedon_testbed.yml -i str -l -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true -e vlan_config=two_vlan_a
    The above configuration file provide example of setting two vlans on T0 DUT.

signed-off-by: Tamer Ahmed [email protected]

@lguohan
Copy link
Contributor

lguohan commented Jan 23, 2020

can you describe the step to run the test? It is not clear here.

@tahmed-dev
Copy link
Contributor Author

can you describe the step to run the test? It is not clear here.

added paragraph on verification and how to generate minigraphs. I will attach sample files.

@tahmed-dev
Copy link
Contributor Author

Here is sample of the output:

minigraphs.zip

Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

I'd better to put vlan configuration into topologies.

@tahmed-dev
Copy link
Contributor Author

I'd better to put vlan configuration into topologies.

I view the vlan to be orthogonal to the underlying topology. If someone would like to have 2, 3, or 4 vlans with T0, this is down by adding 4 configuration file. These configuration could be combined with different T0 topos.

@pavel-shirshov
Copy link
Contributor

@tahmed-dev ok. In this case you need to introduce vlan configurations for all possible port configurations: 32 ports, 64 ports, 116 ports and so on.

@tahmed-dev
Copy link
Contributor Author

@tahmed-dev ok. In this case you need to introduce vlan configurations for all possible port configurations: 32 ports, 64 ports, 116 ports and so on.

I get your point here. I was attempting of having !!python expression in the yaml file, however I dropped it for another iteration. For testing, this could be modeled by some relation such as every 10 interface in a vlan or every nth interface in a vlan. Or we could use j2 to template the dividing interfaces across vlans.

The other point I will debate is it is simpler to split the two and the change is limited this way.

@tahmed-dev tahmed-dev requested a review from jleveque January 27, 2020 17:26
@pavel-shirshov
Copy link
Contributor

@tahmed-dev In this case we must put this logic to all tests which are using vlans. The tests need to know how each physical port is used by vlans

Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

as comments

id: 100
intfs: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
tag: 100
subnets: 192.168.100.0/21
Copy link
Contributor

Choose a reason for hiding this comment

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

Address should be '.1'
<Prefix>192.168.0.1/21</Prefix>

Copy link
Contributor Author

@tahmed-dev tahmed-dev Jan 28, 2020

Choose a reason for hiding this comment

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

my bad. good catch. will fix it. Now, I think subnet name is confusing too!

id: 200
intfs: [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
tag: 200
subnets: 192.168.200.0/21
Copy link
Contributor

Choose a reason for hiding this comment

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

Address should be .1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack

id: 100
intfs: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
tag: 100
subnets: 192.168.100.0/21
Copy link
Contributor

Choose a reason for hiding this comment

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

Also I'd suggest to rename subnets to prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see it is done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this file is part of Option A. will take it out

Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

looks good to me

@tahmed-dev tahmed-dev changed the title [ansible] Adding support for droplet vlans [ansible] Adding support for multi vlans Jan 29, 2020
@tahmed-dev tahmed-dev merged this pull request into sonic-net:master Jan 29, 2020
tahmed-dev added a commit to tahmed-dev/sonic-mgmt that referenced this pull request Jan 29, 2020
…port

[ansible] Adding support for droplet vlans

Adding Vlan configuration section to existing topology configuration files.
The vlan configuration has default default_vlan_cfg attribute which defines
which vlan cfg to use. The behavior can be overridden by supplying vlan_cfg
flag via cli.

one_vlan_a configuration will create single vlan with the name Vlan1000.
This will not break existing test cases. Once existing test cases are able
to handle different vlans, this behavior should be removed.

How to verify:

1. Minigraph generation for a single Vlan; Vlan1000:
   ansible-playbook config_sonic_basedon_testbed.yml -i str -l
   -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true
   or
   ansible-playbook config_sonic_basedon_testbed.yml -i str -l
   -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true -e vlan_config=one_vlan_a

2. Minigraph based on config file:
   ansible-playbook config_sonic_basedon_testbed.yml -i str -l
   -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true -e vlan_config=two_vlan_a

signed-off-by: Tamer Ahmed <[email protected]>
lguohan pushed a commit that referenced this pull request Jan 29, 2020
[ansible] Adding support for droplet vlans

Adding Vlan configuration section to existing topology configuration files.
The vlan configuration has default default_vlan_cfg attribute which defines
which vlan cfg to use. The behavior can be overridden by supplying vlan_cfg
flag via cli.

one_vlan_a configuration will create single vlan with the name Vlan1000.
This will not break existing test cases. Once existing test cases are able
to handle different vlans, this behavior should be removed.

How to verify:

1. Minigraph generation for a single Vlan; Vlan1000:
   ansible-playbook config_sonic_basedon_testbed.yml -i str -l
   -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true
   or
   ansible-playbook config_sonic_basedon_testbed.yml -i str -l
   -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true -e vlan_config=one_vlan_a

2. Minigraph based on config file:
   ansible-playbook config_sonic_basedon_testbed.yml -i str -l
   -e testbed_name= --vault-password-file= -e testbed_file= -e local_minigraph=true -e vlan_config=two_vlan_a

signed-off-by: Tamer Ahmed <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
* c2fb282 2021-01-29 | [ecnconfig] Allow ecn unit test to run without sudo (sonic-net#1390) [Neetha John]
* 6cc635b 2021-01-29 | [sonic-installer] Add information to syslog (sonic-net#1369) [Dmytro]
* 7a8024a 2021-01-27 | Prevent user from adding more then a single untagged VLAN to an interface (sonic-net#1382) [Eran Dahan]
* 41e62c6 2021-01-26 | [pcieutil] Add 'pcie-aer' sub-command to display AER stats (sonic-net#1169) [Arun Saravanan Balachandran]
* 47f412b 2021-01-26 | Improve robustness of consutil plugin loading (sonic-net#1353) [Samuel Angebault]
* 64aa1b8 2021-01-25 | [show] Fix warnings, related to gearbox, while show commands execution (sonic-net#1343) [maksymbelei95]
* ff226d0 2021-01-25 | Prevent configuring IP interface on a port which is a member of VLAN (sonic-net#1374) [Eran Dahan]
* f1522b9 2021-01-21 | [config_mgmt.py]: Set leaf-list to empty list while port breakout. (sonic-net#1268) [Praveen Chaudhary]
* 99c05d5 2021-01-21 | add vlan_intf_object only if there are ipv4 or ipv6 mappings (sonic-net#1377) [Sumukha Tumkur Vani]
* b082684 2021-01-21 | [ecn] Add tests for ecnconfig command (sonic-net#1372) [Neetha John]
* 23e0920 2021-01-21 | [sfpshow] Enhance QSFP-DD DOM information (sonic-net#1207) [shlomibitton]
* f4edba1 2021-01-20 | [ecnconfig] handle backend port names when extracting port I/F ID from the port name (sonic-net#1361) [Mahesh Maddikayala]

Signed-off-by: Danny Allen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants