ansible-dcnm
ansible-dcnm copied to clipboard
Timeout triggered when adding many interfaces
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.
I see no effect using:
[persistent_connection]
connect_timeout = 480
command_timeout = 480
in ansible.cfg
@tias77 Thanks for opening the issue. We are investigating and will reply back soon.
@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.
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
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.
@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.