Closed phil-dotchon closed 1 year ago
@phil-dotchon Thanks for providing the playbook, we are looking into this issue and will update with you once we fix it
@phil-dotchon we are trying to reproduce your issue and seems like that there are some configurations missing, like BD 'application_e-us1' and VMM Domains. Would you mind sharing these with us?
Hi @xinyuezhao, we have the BD and VRF in common tenant, which is created by a separate code base and is shared across all application instances. I am attaching the NDO schema extract for common tenant that shows the BD, though I have remove other elements. I'm also attaching extracts from the 2 site APICs that shows the vmm domains. I hope that helps and is enough, but let me know BDs and VMM domains.zip .
Hi @xinyuezhao , I'm wondering if you were able to recreate the issue?
HI @phil-dotchon, I was able to recreate the issue and am currently working on fixing it. I will keep you posted on my progress.
Hi @phil-dotchon,
I think I have isolated the issue to the deploymentImmediacy attribute in domainAssociations which is named different on response deployImmediacy. The assumption was made in the code that the retrieved response attributes of the child (domainAssociations) are equal to one in the POST, but it seems MSO has changed this somehow over time. So I think in every module where this child object is put in the replace operation the issue will occur, (verified this issue occurs on bot mso_schema_site_anp and mso_schema_site_anp_epg when domainAssociations is present).
The question now remains on where/how to solve this, since arguably this could be marked as MSO API bug. I will discuss this in my team and will see if I can get in touch with TAC, (saw you had a case opened already). I will get back to you on this as soon as I have more information.
Hi @akinross , I see you have created a PR but that it isn't yet merged; do you have an outlook for that? Thanks :) -phil
Hi @phil-dotchon, no I don't know any timelines for merge. Regards, Akini
Community Note
Description
We have a somewhat large and reasonably complex set of Ansible playbooks in development, and have recently discovered what appears to be an unexpected behaviour in this module.
The issue only occurs when the play is run for the second time; the issue does not occur on the first run of the play (after cleaning up NDO), but does occur on subsequent runs. The first run is successful and creates the tenant, schema, template and site anp, template and site epg, associates the vmm domain as expected. Without any other change a subsequent run will fail with the following error.
If we do not associate the EPG with a vmm domain the problem does not appear. I have created a minimal example playbook to demonstrate the problem
Affected Module Name(s):
MSO version and MSO Platform
APIC version and APIC Platform for Site Level Resources
Collection versions
Output/ Error message
failed: [e_us1_mso] (item=e-us-site1) => {"ansible_loop_var": "item", "changed": true, "current": {"anpRef": {"anpName": "recreate_bug", "schemaId": "62e812bc1f00007827a85276", "templateName": "e-us1"}, "epgs": [{"domainAssociations": [{"allowMicroSegmentation": false, "deployImmediacy": "lazy", "dn": "uni/vmmp-VMware/dom-dvs_tl2_bdc6_ci3b", "domainType": "vmmDomain", "epgLagPol": {"enhancedLagPol": {"dn": "uni/vmmp-VMware/dom-dvs_tl2_bdc6_ci3b/vswitchpolcont/enlacplagp-lag-pol-3b", "name": "lag-pol-3b"}}, "resolutionImmediacy": "pre-provision", "vlanEncapMode": "dynamic"}], "epgRef": "/schemas/62e812bc1f00007827a85276/templates/e-us1/anps/recreate_bug/epgs/Test_EPG", "selectors": [], "staticLeafs": [], "staticPorts": [], "subnets": [], "uSegAttrs": []}]}, "data": [{"op": "replace", "path": "/sites/60ec79a99e9dae6a5997ced9-e-us1/anps/recreate_bug", "value": {"anpRef": {"anpName": "recreate_bug", "schemaId": "62e812bc1f00007827a85276", "templateName": "e-us1"}, "epgs": [{"domainAssociations": [{"allowMicroSegmentation": false, "deployImmediacy": "lazy", "dn": "uni/vmmp-VMware/dom-dvs_tl2_bdc6_ci3b", "domainType": "vmmDomain", "epgLagPol": {"enhancedLagPol": {"dn": "uni/vmmp-VMware/dom-dvs_tl2_bdc6_ci3b/vswitchpolcont/enlacplagp-lag-pol-3b", "name": "lag-pol-3b"}}, "resolutionImmediacy": "pre-provision", "vlanEncapMode": "dynamic"}], "epgRef": "/schemas/62e812bc1f00007827a85276/templates/e-us1/anps/recreate_bug/epgs/Test_EPG", "selectors": [], "staticLeafs": [], "staticPorts": [], "subnets": [], "uSegAttrs": []}]}}], "info": {"body": {"code": 400, "message": "Bad Request: (0)(0)(0)(0)/deploymentImmediacy error.path.missing"}, "connection": "close", "content-language": "en", "content-length": "89", "content-type": "application/json", "error": {"code": -1, "message": {"code": 400, "message": "Bad Request: (0)(0)(0)(0)/deploymentImmediacy error.path.missing"}}, "method": "PATCH", "msg": "OK (89 bytes)", "server": "nginx", "status": 400, "strict-transport-security": "max-age=31536000; includeSubDomains", "url": "https://x.x.x.x:443/mso/api/v1/schemas/62e812bc1f00007827a85276?validate=false", "x-ratelimit-limit": "-1", "x-ratelimit-remaining": "-1", "x-ratelimit-reset": "1559582945"}, "item": "e-us-site1", "msg": "MSO Error 400: Bad Request: (0)(0)(0)(0)/deploymentImmediacy error.path.missing", "payload": {"code": 400, "message": "Bad Request: (0)(0)(0)(0)/deploymentImmediacy error.path.missing"}, "status": 400}
Expected Behavior
Actual Behavior
Playbook tasks to Reproduce
Important Factoids
References