05-04-2023 03:54 PM
Hello,
We are using APIC 5.2(4e). We would like to add EPG static ports using cli. Does APIC cli save automatically?
Thanks, Samantha
05-04-2023 08:28 PM - edited 05-04-2023 08:36 PM
Hi @samantha ,
Let me quote a passage from Charles Dickens' book David Copperfield.
Annual income twenty pounds, annual expenditure nineteen nineteen and six, result happiness.
Annual income twenty pounds, annual expenditure twenty pounds ought and six, result misery
And new I'll put it into context
Configure ACI using the GUI or APIs, result happiness.
Configure ACI using the CLI, result misery
The ACI CLI is a great tool for troubleshooting, but it takes shortcuts and at times needs to create HIDDEN OBJECTS that can be almost impossible to remove in the future, leading to the misery that I mentioned above.
I repeat
DO NOT USE THE CLI TO CONFIGURE ACI
Now, this is what you should do:
Configure the first static EPG port. Once it is done, right click on it and choose Save as...
Make sure you choose Only Configuration, Subtree, json (or xml if you prefer)
Open the file in a decent editor that will format the JSON (or xml) for you
It should looks something like
{ "totalCount": "1", "imdata": [ { "fvRsPathAtt": { "attributes": { "annotation": "", "descr": "", "dn": "uni/tn-<your_tenant>/ap-<your_app_prof>/epg-<your_epg>/rspathAtt-[topology/pod-1/paths-<your_switch>/pathep-[eth1/<your_port>]]", "encap": "vlan-<your_vlan>", "instrImedcy": "immediate", "mode": "<untagged or tagged>", "primaryEncap": "unknown", "tDn": "topology/pod-1/paths-<your_switch>/pathep-[eth1/<your_port>]", "userdom": "" } } } ] }
Now copy/paste/edit as many times as you like until you've got your static mappings. Save the file.
Now, back where you save the file, right-click again and choose Post
Make sure you set the Parent DN: to uni/
and then select your file and post it.
Job done.
Also, you should upgrade to ACI v5.2(7f) - there is a HUGE change in the way ACI works for Access Policies - the system takes care of many things that used to be a bit of a nightmare (you'll have to navigate to Access Policies > Interface Configuration and accept the invitation to fix up your policies for you to begin)
Oh. I almost forgot:
Does APIC cli save automatically?
Yes it does. But please don't do that
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide