dellemc.os10 icon indicating copy to clipboard operation
dellemc.os10 copied to clipboard

os10_vlan role is slow

Open sc68cal opened this issue 3 years ago • 13 comments

We have a very large VLAN & Port configuration that we push to our switches using the os10_vlan role. It is one of the slowest roles to execute, and we would like to investigate ways to speed it up.

The main issue appears to be the number of commands sent, and the fact that OS10 takes a lot of time to process the commands.

I have created a sample repo that demonstrates the performance of this role at https://github.com/sc68cal/dellos-vlan-perf

We have seen execution times of around two minutes, to close to three for it to complete.

sc68cal avatar Jun 24 '21 16:06 sc68cal

The current role loops through every vlan defined in the YAML, and then for every port defined in the tagged_members and untagged_members attribute, emits an interface command that configures the port. So, for an example:

os10_vlan:
  vlan 10:
    tagged_members:
      - port: ethernet 1/1/1
 
  vlan 11:
    tagged_members:
      - port: ethernet 1/1/1

  vlan 12:
    tagged_members:
      - port: ethernet 1/1/1

The current template code would end up emitting three commands:

interface ethernet1/1/1
 switchport trunk allowed vlan 10

interface ethernet1/1/1
 switchport trunk allowed vlan 11

interface ethernet1/1/1
 switchport trunk allowed vlan 12

And then it depends on DellOS to merge these config commands into something like

interface ethernet1/1/1
  switchport trunk allowed vlan 10,11,12

Perhaps there's a way to invert this behavior, where we process the VLANs, create a mapping for all the allowed VLANs that a port is supposed to allow, and emit just the last command instead of depending on the OS to merge it.

sc68cal avatar Jun 24 '21 16:06 sc68cal

I have the same issue. We have over a hundred vlans and we have hit the ansible timeout more than once which has caused the config to fail partway through the vlan process.

lpereira1 avatar Jun 25 '21 17:06 lpereira1

This can be addressed in both approaches by leveraging the range commands

  1. Enhance os10_vlan to support range for tagged_members & keys
  2. Enhance os10_interface role to support new options (range & single) for trunk vlans

dharmaraj-gurusamy avatar Jul 13 '21 16:07 dharmaraj-gurusamy

Ranges will help but still if you have lots of ranges, it will still be slow because of the way the template loops through os10_vlan

sc68cal avatar Jul 15 '21 20:07 sc68cal

@sc68cal - I meant the range in both vlan keys & tagged_members as below

os10_vlan: range vlan 10-12: tagged_members: - port: range ethernet 1/1/1-1/1/12 state: present

The current template takes care of range for tagged_members already; but the vlan keys need to be enhanced to support range. The range enhancement shall be made as applicable for tagged_members & description only. Other configs virtual_gateway_ip, virtual_gateway_ipv6, ip_and_mask can be applied on single vlan instance only because the range is not supported. The range untagged_members is present already which also is applicable for single vlan instance only.

Hope this helps.

dharmaraj-gurusamy avatar Jul 16 '21 14:07 dharmaraj-gurusamy

Our interfaces can use a range, but our VLANs are not contiguous so while there are some speed improvements that will be made, we will still have many keys in our os10_vlan structure

sc68cal avatar Jul 16 '21 15:07 sc68cal

range identifiers (comma & hyphen) are available to handle contiguous & non-contiguous cases as below os10_vlan: range vlan 10-12,20: tagged_members: - port: range ethernet 1/1/1-1/1/3 state: present

dharmaraj-gurusamy avatar Jul 19 '21 10:07 dharmaraj-gurusamy

Ah, that's a good feature. Okay, that might fix it. Can we add some documentation around this to the role README ?

sc68cal avatar Jul 19 '21 17:07 sc68cal

I tried to do it with the above but I get this :

  command: interface vlanvlan
  msg: |-
    interface vlanvlan

lpereira1 avatar Nov 15 '21 20:11 lpereira1

I think this feature needs proper documentation for how to use

sc68cal avatar Nov 16 '21 21:11 sc68cal

range identifiers (comma & hyphen) are available to handle contiguous & non-contiguous cases as below os10_vlan: range vlan 10-12,20: tagged_members: - port: range ethernet 1/1/1-1/1/3 state: present

I have just tried this configuration on version 1.1.1 and the "range vlan 10-12,20" seems to have the same error as lpereira. msg: "interface vlanvlan\r\n% Error: Illegal parameter" Looks like it is not parsing the "range vlan" and just grabbing the second argument as the vlanID, i.e. "interface vlan" instead of "interface " where =range vlan 1-2,5. The tagged_members: - port: range ethernet 1/1/1-1/1/x seems to work fine. Can this be updated so that "range vlan" is supported? Currently every vlan has to be defined individually in blocks, which makes tagging the same ports for different vlans burdensome.

djlongy avatar Nov 08 '22 04:11 djlongy

we have the same issue of os10_vlan being slow. but we use netbox as a source of truth, so it is not straight forward to change that to interface and vlan ranges.

ronnyaa avatar May 03 '23 11:05 ronnyaa

when trying to make ranges manually we also see with hundred of ranges it is unsustainable. so os10_vlan support some kind of offline config generation, and replace the whole running config atomically. the offline config generation can be done in parallell for all devices. giving a massive speed boost.

ronnyaa avatar Dec 05 '23 17:12 ronnyaa