dellemc.os10
dellemc.os10 copied to clipboard
os10_vlan role is slow
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.
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.
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.
This can be addressed in both approaches by leveraging the range commands
- Enhance os10_vlan to support range for tagged_members & keys
- Enhance os10_interface role to support new options (range & single) for trunk vlans
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 - 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.
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
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
Ah, that's a good feature. Okay, that might fix it. Can we add some documentation around this to the role README ?
I tried to do it with the above but I get this :
command: interface vlanvlan
msg: |-
interface vlanvlan
I think this feature needs proper documentation for how to use
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
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.
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.