CiscoDevNet / ansible-mso

Cisco MSO Ansible Collection
https://galaxy.ansible.com/cisco/mso
GNU General Public License v3.0
25 stars 30 forks source link

cisco.mso.mso_schema_site_anp_epg_staticport traceback on adding static ports in bulk (DCNE-86) #504

Open apellini opened 1 month ago

apellini commented 1 month ago

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

References

akinross commented 1 month ago

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.

apellini commented 1 month ago

Our requirements are to append so we have used force_replace to false. I think that failing when configuration exists is anthitetic with Ansible idempotency concepts. I suggest to you to specify on documentation, or adding idempotent also to bulk to respect Ansible guideline.

akinross commented 1 month ago

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.

apellini commented 1 month ago

Below the log:

fatal: [NDOHOST|SCHEMA|TEMPLATE|SITE1|L2_APP|1401_Heartbeat_AAAA_EPG|present -> localhost]: FAILED! => {"attempts": 3, "changed": true, "current": [{"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1123/pathep-[eth1/8/4]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1124/pathep-[eth1/8/4]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1125/pathep-[eth1/1/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1125/pathep-[eth1/1/4]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1125/pathep-[eth1/9/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1126/pathep-[eth1/1/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1126/pathep-[eth1/2/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1126/pathep-[eth1/5/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1126/pathep-[eth1/9/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1135/pathep-[eth1/4/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1135/pathep-[eth1/4/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1135/pathep-[eth1/5/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1135/pathep-[eth1/5/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1135/pathep-[eth1/6/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1135/pathep-[eth1/6/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1136/pathep-[eth1/4/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1136/pathep-[eth1/4/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1136/pathep-[eth1/5/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1136/pathep-[eth1/5/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1136/pathep-[eth1/6/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/paths-1136/pathep-[eth1/6/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1157/pathep-[eth1/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1160/pathep-[eth1/11]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1160/pathep-[eth1/13]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1161/pathep-[eth1/41]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/paths-1161/pathep-[eth1/44]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00074_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00074_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00075_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00075_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00076_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00076_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00077_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00077_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00078_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00078_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00079_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV00079_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV0007A_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV0007A_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV0007B_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1101-1102/pathep-[VPC_02SRV0007B_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002A_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002A_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002B_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002B_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002C_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002C_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002D_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002D_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002E_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002E_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002F_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002F_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002G_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002G_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002H_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV0002H_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-1/protpaths-1113-1114/pathep-[VPC_02SRV006FY_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00026_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00026_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00027_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00027_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00028_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00028_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00029_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1115-1116/pathep-[VPC_02SRV00029_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002W_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002W_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002X_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002X_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002Y_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002Y_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002Z_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-1123-1124/pathep-[VPC_02SRV0002Z_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-1/protpaths-451-452/pathep-[VPC_C7010-CGB-POD1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1221/pathep-[eth1/20/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1221/pathep-[eth1/24/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1222/pathep-[eth1/20/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1222/pathep-[eth1/24/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1223/pathep-[eth1/8/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1224/pathep-[eth1/16/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1224/pathep-[eth1/16/4]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1224/pathep-[eth1/8/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1225/pathep-[eth1/2/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/paths-1225/pathep-[eth1/2/4]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/paths-1225/pathep-[eth1/3/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1225/pathep-[eth1/8/2]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1225/pathep-[eth1/8/4]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1226/pathep-[eth1/2/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/paths-1226/pathep-[eth1/2/4]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/paths-1226/pathep-[eth1/3/1]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1226/pathep-[eth1/8/3]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/paths-1258/pathep-[eth1/17]", "portEncapVlan": 1401, "type": "port"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006O_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006O_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006P_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006P_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006Q_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006Q_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006R_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006R_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006S_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006S_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006T_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006T_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006U_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006U_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006V_40G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1203-1204/pathep-[VPC_02SRV0006V_40G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1217-1218/pathep-[VPC_02SRV0001B_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1217-1218/pathep-[VPC_02SRV0001B_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1217-1218/pathep-[VPC_02SRV0001C_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1217-1218/pathep-[VPC_02SRV0001C_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV00015_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV00015_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV00016_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV00016_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV00019_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV00019_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV0001A_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV0001A_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/protpaths-1221-1222/pathep-[VPC_02SRV005FW_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00014_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00014_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV0001W_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV0001W_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV0001X_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV0001X_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001D_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001D_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001E_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001E_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001F_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001F_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001G_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001G_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001H_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001H_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001I_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001I_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001J_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0001J_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0007G_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV0007G_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV004RK_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1225-1226/pathep-[VPC_02SRV004RL_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/protpaths-1257-1258/pathep-[VPC_02ILO001AX_1G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "untagged", "path": "topology/pod-2/protpaths-1257-1258/pathep-[VPC_02ILO001AZ_1G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}, {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-461-462/pathep-[VPC_C7010-CGB-POD2_IPG]", "portEncapVlan": 1401, "type": "vpc"}], "data": [{"op": "replace", "path": "/sites/65a18392228bd7433388d221-TEMPLATE/anps/L2_APP/epgs/1401_Heartbeat_AAAA_EPG/staticPorts/0", "value": {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc"}}, {"op": "replace", "path": "/sites/65a18392228bd7433388d221-TEMPLATE/anps/L2_APP/epgs/1401_Heartbeat_AAAA_EPG/staticPorts/1", "value": {"deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc"}}], "info": {"body": "{\"code\":400,\"message\":\"staticPort path in site: SITE1 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/65f7fe94691d76b3f3c52bd3?validate=false", "x-ratelimit-limit": "-1", "x-ratelimit-remaining": "-1", "x-ratelimit-reset": "1559582945"}, "msg": "MSO Error 400: staticPort path in site: SITE1 anp: epg: must be unique", "payload": {"code": 400, "info": null, "message": "staticPort path in site: SITE1 anp: epg: must be unique"}, "status": 400}

We have experienced on this version of NDO.

akinross commented 1 month ago

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? Are these path already existing in NDO?

apellini commented 1 month ago

The test is done with paths that already existing as static binding.

akinross commented 1 month ago

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.

    - name: Set static ports
      cisco.mso.mso_schema_site_anp_epg_staticport:
        <<: *mso_info
        schema: abr_schema
        template: Template1
        site: ansible_test
        anp: abr_ap
        epg: abr_epg
        static_ports:
        - pod: pod-1
          leaf: 101
          path: eth1/1
          vlan: 126
        - pod: pod-1
          leaf: 101
          path: eth1/1
          vlan: 126
        state: present

Which leads to the following error: "msg": "MSO Error 400: staticPort path in site: ansible_test anp: epg: must be unique",

So to me this seems as an input error on your side opposed to a bug.

apellini commented 1 month ago

If you see in data there are static_ports requested:

"data": [ { "op": "replace", "path": "/sites/65a18392228bd7433388d221-TEMPLATE/anps/L2_APP/epgs/1401_Heartbeat_AAAA_EPG/staticPorts/0", "value": { "deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_1_IPG]", "portEncapVlan": 1401, "type": "vpc" } }, { "op": "replace", "path": "/sites/65a18392228bd7433388d221-TEMPLATE/anps/L2_APP/epgs/1401_Heartbeat_AAAA_EPG/staticPorts/1", "value": { "deploymentImmediacy": "immediate", "mode": "regular", "path": "topology/pod-2/protpaths-1223-1224/pathep-[VPC_02SRV00013_10G_2_IPG]", "portEncapVlan": 1401, "type": "vpc" } } ]

and as you could see path is different.

The only thing is that these ports are already existing as static_ports for this EPG.

akinross commented 1 month ago

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?