ansible-collections / cisco.nxos

Ansible Network Collection for Cisco NXOS
GNU General Public License v3.0
115 stars 108 forks source link

make nxos_vlans module accept vlan ranges #109

Open woytekm opened 4 years ago

woytekm commented 4 years ago
SUMMARY

Deprecated nxos_vlan module had vlan_range option to provide string with vlan ranges to work on. New nxos_vlans does not have this ability. This makes nxos_vlans nearly unusable for large vlan sets. It's nearly 20 times slower to loop over single vlan instances with nxos_vlans than provide vlan range to nxos_vlan.

timing: vlan set: 351 non-contigous vlan id's, merging to 101 ranges. set vlans to active with nxos_vlan using ranged string: 61 seconds per device set vlans to active with nxos_vlans looping over list of single vlan id's: 1050 seconds per device (17 minutes)

Provide vlan_range: feature for nxos_vlans module and speed up operations on large vlan sets.

ISSUE TYPE
COMPONENT NAME

nxos_vlans module

ADDITIONAL INFORMATION

This would make nxos_vlans usable for large vlan sets that need to be checked/deployed on large number of devices.


  - name: "set vlans as active"
    nxos_vlans:
      config:
       - vlan_range: "3-5,7,80,121-130,800-850"
         enabled: true
      state: merged
Adam8005 commented 1 year ago

The vlans module is unbelievably slower than the removed vlan module. Anything that can improve the speed of this module would be appreciated