CiscoDevNet / ansible-dcnm

Apache License 2.0
45 stars 36 forks source link

Timeout triggered when adding many interfaces #58

Closed tias77 closed 4 months ago

tias77 commented 3 years ago

Creating one or two vPC interfaces is no problem. Adding 40+ seems to be working looking at interfaces in DCNM webui, but ansible triggers timeout. Rerunning the same task works fine. I'll add more data as I find it.

tias77 commented 3 years ago

I see no effect using:

[persistent_connection]
connect_timeout = 480
command_timeout = 480

in ansible.cfg

mikewiebe commented 3 years ago

@tias77 Thanks for opening the issue. We are investigating and will reply back soon.

dsx1123 commented 3 years ago

@tias77 do you mind share your playbook of creating vpc part? we have seen a similar issue when creating too many networks at the same time, one of the ways to ease it is to create them in batch, of course, it will slow down the whole play.

tias77 commented 3 years ago

Sure, here's my playbook:

---

- hosts: dcnm_controllers
  gather_facts: false
  connection: ansible.netcommon.httpapi

  tasks:
    - name: Create vPC interfaces
      cisco.dcnm.dcnm_interface: &vpc_merge
        fabric: fabric1
        state: replaced                         # only choose from [merged, replaced, deleted, overridden, query]
        config:
          - name: vpc1
            type: vpc
            switch:
              - "le1"
              - "le3"
            deploy: true                       # choose from [true, false]
            profile:
              admin_state: true                ## choose from [true, false]
              mode: trunk                      # choose from [trunk, access]
              peer1_members:                   ## member interfaces on peer 1
                - e1/1
              peer2_members:                   ## member interfaces on peer 2
                - e1/1
              pc_mode: 'active'                ## choose from ['on', 'active', 'passive']
              bpdu_guard: true                 ## choose from [true, false, 'no']
              port_type_fast: true             ## choose from [true, false]
              mtu: jumbo                       ## choose from [default, jumbo]
              peer1_description: "VPC acting as trunk peer1 - modified"
              peer2_description: "VPC acting as trunk peer2 - modified"

and then repeat that for all 48 interfaces

micruzz82 commented 3 years ago

this might not be efficient but don't suppose you'd be willing to add:

- 
  name: "Sleep for 3 seconds and timeout"
  tags: sleep3
  wait_for: 
    delay: 3
    timeout: 0

this will just introduce a 3 sec delay before running the next task that way if needed.

mmudigon commented 3 years ago

@tias77

I tried increasing the timeout to a higher value and it worked. Can you please try increasing the timeout value to around 1 hour and retry. Adding these many VPCs may take time due to deploy operations from DCNM.