-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cisco.mso.mso_schema_site_anp_epg_staticport traceback on adding static ports in bulk (DCNE-86) #504
Comments
Hi @apellini, This seems to be ndo replying that the staticPort path in site ACME-PRODACI-01 anp epg is not unique. Since I do not know what is currently configured on NDO and I do not know what the config is that you are sending it is hard to determine what is going on. Are you sending a full list of static_ports or do you want to append an x amount of static ports? If you provide all the static ports instead of appending you should set the force_replace flag to true, see documentation: https://galaxy.ansible.com/ui/repo/published/cisco/mso/content/module/mso_schema_site_anp_epg_staticport/. Please provide us some more information on current state of ndo config and the send static ports if we need to do additional checks on what is causing this. |
Our requirements are to append so we have used force_replace to false. |
Hi Apellini, In our tests we test idempotency, https://github.com/CiscoDevNet/ansible-mso/blob/master/tests/integration/targets/mso_schema_site_anp_epg_staticport/tasks/main.yml#L951-L1034. Since I am trying to understand your issue better I would to request you once again for additional information of what it is you are actually configuring (pre-state, config send), could you please provide this? Another question do you only experience this 4.2.3e or you experienced this behaviour before? I have marked it as a bug and will move to the todo items, but providing us with the additional information would help us with a starting point to discover what is happening exactly. |
Below the log:
We have experienced on this version of NDO. |
Hi @apellini, From you provided output I notice that "current" has duplicates, and these duplicates are being send. With small python analysis on current output I see the following paths are send multiple times: ['topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_1_IPG]', 'topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_2_IPG]'] Are these two paths provided as input twice? |
The test is done with paths that already existing as static binding. |
Hi @apellini, Thank you for the elaborate response, I have done some testing and the only way I have been able to reproduce is by providing duplicate configuration on the input side when a path is not yet existing on NDO.
Which leads to the following error: So to me this seems as an input error on your side opposed to a bug. |
If you see in data there are static_ports requested:
and as you could see path is different. The only thing is that these ports are already existing as static_ports for this EPG. |
Hi @apellini, Yes I saw the path is different but like I said these are the only two that were present in your current two times. So it seems like the input provided has these items twice on the push toward NDO, since this is the only way I am able to reproduce it. When the paths are already existing they should be removed from the send payload ( which is also in the tests previously shared ) and I manually have the same results. Perhaps we should schedule a call to recreate it in your environment, to better understand what is happening? |
Community Note
Description
When we use module in subject we receive traceback using static_ports key with force_replace settled at false.
Affected Module Name(s):
MSO version and MSO Platform
APIC version and APIC Platform for Site Level Resources
Collection versions
Output/ Error message
reduced:
"data": [{"op": "replace", "path": "/sites/65a18392228bd7433388d221-AUTONOMOUS_BD-EPG-APP/anps/L2_APP/epgs/1401_Heartbeat_AAAA_EPG/staticPorts/0", "value": {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1001-1002/pathep-[VPC_1_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}}, {"op": "replace", "path": "/sites/65a18392228bd7433388d221-AUTONOMOUS_BD-EPG-APP/anps/L2_APP/epgs/1401_Heartbeat_AAAA_EPG/staticPorts/1", "value": {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1001-1002/pathep-[VPC_1_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}}], "info": {"body": "{"code":400,"message":"staticPort path in site: ACME-PRODACI-01 anp: epg: must be unique","info":null}", "connection": "close", "content-language": "en", "content-length": "103", "content-type": "application/json", "date": "Wed, 24 Jul 2024 15:44:07 GMT", "msg": "HTTP Error 400: Bad Request", "server": "nginx", "status": 400, "strict-transport-security": "max-age=31536000; includeSubDomains", "url": "https://11.1.1.1/api/v1/schemas/sfsdfdfd?validate=false", "x-ratelimit-limit": "-1", "x-ratelimit-remaining": "-1", "x-ratelimit-reset": "1559582945"}, "msg": "MSO Error 400: staticPort path in site: ACME-PRODACI-01 anp: epg: must be unique", "payload": {"code": 400, "info": null, "message": "staticPort path in site: ACME-PRODACI-01 anp: epg: must be unique"}, "status": 400}
*
Expected Behavior
We expect that Ansible configure static ports on EPG in bulk fashion,
Playbook tasks to Reproduce
name: Configure static_binding
hosts: ndo
connection: local
vars:
schema: 65a18392228bd7433388d221
site: ACME-PRODACI-01
template: AUTONOMOUS_BD-EPG-APP
anp: L2_APP
epg: 1401_Heartbeat_AAAA_EPG
static_ports:
- deploy_immediacy: immediate
vlan: 1401
mode: regular
path: eth1/1
leaf: 1001
pod: pod-1
tasks:
cisco.mso.mso_schema_site_anp_epg_staticport:
host: "{{ ansible_host }}"
username: "{{ ansible_user }}"
password: "{{ ansible_password }}"
schema: "{{ schema }}"
site: "{{ site }}"
template: "{{ template }}"
anp: "{{ anp }}"
epg: "{{ epg }}"
static_ports: "{{static_ports}}"
force_replace: false
state: present
validate_certs: false
use_proxy: false
delegate_to: localhost
retries: 3
until: static_port_port is not failed
register: static_port_port
check_mode: "{{ mock }}"
throttle: 1
Important Factoids
References
The text was updated successfully, but these errors were encountered: