01-23-2024 01:39 AM
Could you please provide me the moquery for getting the static endpoint mapping where no endpoint is learned?
Solved! Go to Solution.
01-23-2024 12:48 PM - edited 03-27-2024 12:06 PM
Hi @shubhanshu_jaiswal ,
You can see the static endpoint mappings using
admin@apic1:~> moquery -c fvRsPathAtt
You can then use something like awk
or sed
to extract the paths that are used from the dn
field. Let's call this list_1. E.g.
admin@apic1:~> moquery -c fvRsPathAtt | egrep dn | sed 's/.*topology\(.*\)]]/\1/' | sort /pod-1/paths-2201/pathep-[eth1/11 /pod-1/paths-2201/pathep-[eth1/12 /pod-1/paths-2201/pathep-[eth1/13 /pod-1/paths-2201/pathep-[eth1/9 /pod-1/paths-2202/extpaths-192/pathep-[eth1/11 /pod-1/paths-2202/extpaths-192/pathep-[eth1/12 /pod-1/paths-2202/extpaths-192/pathep-[eth1/13 /pod-1/paths-2202/extpaths-192/pathep-[eth1/28 /pod-1/protpaths-2201-2202/pathep-[T01:L2201..2202:1:31_VPCIPG
Next, you could use the following to get a list of the static endpoints
admin@apic1:~> moquery -c fvCEp
Again, use something like awk
or sed
to extract the paths that have endpoints from the fabricPathDn
field. Let's call this list_2. E.g.
admin@apic1:~> moquery -c fvCEp | egrep fabricPathDn | sed 's/.*topology\(.*\)]/\1/' | sort
fabricPathDn : fabricPathDn : fabricPathDn : fabricPathDn : fabricPathDn : fabricPathDn : /pod-1/paths-2201/pathep-[eth1/11 /pod-1/paths-2201/pathep-[eth1/12 /pod-1/paths-2201/pathep-[eth1/28 /pod-1/paths-2201/pathep-[eth1/5 /pod-1/paths-2201/pathep-[eth1/9 /pod-1/paths-2201/pathep-[T01:L2201..2202:1:31_VPCIPG /pod-1/paths-2202/extpaths-192/pathep-[eth1/11 /pod-1/paths-2202/extpaths-192/pathep-[eth1/28 /pod-1/paths-2202/pathep-[eth1/10 /pod-1/paths-2202/pathep-[eth1/10 /pod-1/paths-2202/pathep-[T01:L2201..2202:1:31_VPCIPG
sed
expression a bit to cater for that. For every entry in list_2
remove the corresponding entry in list_1
done
Whatever entries you have left in list_1 will be a list of static endpoint mapping where no endpoint is learned
Unless this is something you want to do often, I'd be pasting list_1 and list_2 into two columns in Excel and sorting each, then use conditional formatting to highlight the relevant mappings. Like this:
01-23-2024 12:48 PM - edited 03-27-2024 12:06 PM
Hi @shubhanshu_jaiswal ,
You can see the static endpoint mappings using
admin@apic1:~> moquery -c fvRsPathAtt
You can then use something like awk
or sed
to extract the paths that are used from the dn
field. Let's call this list_1. E.g.
admin@apic1:~> moquery -c fvRsPathAtt | egrep dn | sed 's/.*topology\(.*\)]]/\1/' | sort /pod-1/paths-2201/pathep-[eth1/11 /pod-1/paths-2201/pathep-[eth1/12 /pod-1/paths-2201/pathep-[eth1/13 /pod-1/paths-2201/pathep-[eth1/9 /pod-1/paths-2202/extpaths-192/pathep-[eth1/11 /pod-1/paths-2202/extpaths-192/pathep-[eth1/12 /pod-1/paths-2202/extpaths-192/pathep-[eth1/13 /pod-1/paths-2202/extpaths-192/pathep-[eth1/28 /pod-1/protpaths-2201-2202/pathep-[T01:L2201..2202:1:31_VPCIPG
Next, you could use the following to get a list of the static endpoints
admin@apic1:~> moquery -c fvCEp
Again, use something like awk
or sed
to extract the paths that have endpoints from the fabricPathDn
field. Let's call this list_2. E.g.
admin@apic1:~> moquery -c fvCEp | egrep fabricPathDn | sed 's/.*topology\(.*\)]/\1/' | sort
fabricPathDn : fabricPathDn : fabricPathDn : fabricPathDn : fabricPathDn : fabricPathDn : /pod-1/paths-2201/pathep-[eth1/11 /pod-1/paths-2201/pathep-[eth1/12 /pod-1/paths-2201/pathep-[eth1/28 /pod-1/paths-2201/pathep-[eth1/5 /pod-1/paths-2201/pathep-[eth1/9 /pod-1/paths-2201/pathep-[T01:L2201..2202:1:31_VPCIPG /pod-1/paths-2202/extpaths-192/pathep-[eth1/11 /pod-1/paths-2202/extpaths-192/pathep-[eth1/28 /pod-1/paths-2202/pathep-[eth1/10 /pod-1/paths-2202/pathep-[eth1/10 /pod-1/paths-2202/pathep-[T01:L2201..2202:1:31_VPCIPG
sed
expression a bit to cater for that. For every entry in list_2
remove the corresponding entry in list_1
done
Whatever entries you have left in list_1 will be a list of static endpoint mapping where no endpoint is learned
Unless this is something you want to do often, I'd be pasting list_1 and list_2 into two columns in Excel and sorting each, then use conditional formatting to highlight the relevant mappings. Like this:
01-29-2024 01:05 AM
Thanks for the detailed answered; however for some reason, I am getting stuck when I entered the command:
moquery -c fvRsPathAtt
It does not return anything.
Do I need to provide any DN as well. I would like to get the details for the whole fabric endpoint in one go. But it seems not happening. Does it have to do with Version of APIC?
01-29-2024 01:49 AM - edited 01-29-2024 01:55 AM
Hi @shubhanshu_jaiswal ,
[Edit: I've just had a thought - maybe you aren't doing static mappings, but mapping up from the AAEP rather than doing Static Mappings. If that is the case, that's a whole new ball-game and much harder to TS.]
Re the version of ACI, I've just tested the command on 4.2(7r) and 5.2(7g) - and it worked in both cases
And you definitely don't need to add a dn - that would only restrict the result to the particular dn you specified
So to check - find a static mapping, right-click on it and choose Open in Object Store Browser - you should then see an instance of a fvRsPathAtt object. If you then click on the fvRsPathAtt heading, you should see all instance of that class (the same as moquery)
Let me know how that goes. Here's a video
01-29-2024 01:57 AM
I appreciate you helping me out. I am getting the following error:
"Unable to process the query, result dataset is too big"
Do you know workaround for this?
01-29-2024 12:30 PM
Hi @shubhanshu_jaiswal ,
Ok - but you didn't say exactly WHEN you get the error. Is it
you have at least proved that there are objects of type fvRsPathAtt, and may explain why you got no output from moquery.
I think the next trick to try is to use icurl instead of moquery, but if indeed the result dataset is too big, this may not work either.
Tip: | Enter icurl commands from the bash command line rather than the APIC command line - this makes it MUCH easier to use the ? character in your query |
apic1# bash
admin@apic1:~> icurl -k -s 'https://localhost/api/node/class/fvRsPathAtt.json' | jq
If this also shows no results or the result dataset is too big error, then your idea of using a dn may in fact be on the right track.
To test this, choose your smallest tenant - lets call it Tenant01, (or use the common tenant) and try this command.
admin@apic1:~> moquery -c fvRsPathAtt -d uni/tn-Tenant01
If that gives you some output, then you can keep repeating for each tenant until you've built your spreadsheet!
Then I guess you you try the same suggestions, but I'd need more detail to chase any further.
01-30-2024 01:08 AM
I created a list of dn for application EPGs and ran your moquery one by one. It worked. Thanks a lot.
01-30-2024 01:28 AM
Brilliant. Glad you got it figured.
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