cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
545
Views
1
Helpful
7
Replies

Moquery for static endpoint mapping where no endpoint is learned.

Could you please provide me the moquery for getting the static endpoint mapping where no endpoint is learned?

1 Accepted Solution

Accepted Solutions

RedNectar
VIP
VIP

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

Notes:

  1. Note the subtle difference in the sed commands between the two (there's an extra ] character in the 1st one)
  2. Note the blank entries in the 2nd list - these entries represent endpoints that don't have a fabricPathDn value because they VMs deployed via VMM
  3. The fabricPathDn output in list_2 is slightly different to the output for the dn output in list_1 for the VPC because the dn includes BOTH leaves in the name, whereas the fabricPathDn shows an entry for EACH leaf.  You'd have to tweak the 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:

 

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

View solution in original post

7 Replies 7

RedNectar
VIP
VIP

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

Notes:

  1. Note the subtle difference in the sed commands between the two (there's an extra ] character in the 1st one)
  2. Note the blank entries in the 2nd list - these entries represent endpoints that don't have a fabricPathDn value because they VMs deployed via VMM
  3. The fabricPathDn output in list_2 is slightly different to the output for the dn output in list_1 for the VPC because the dn includes BOTH leaves in the name, whereas the fabricPathDn shows an entry for EACH leaf.  You'd have to tweak the 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:

 

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

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?

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

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

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?

Hi @shubhanshu_jaiswal ,

Ok - but you didn't say exactly WHEN you get the error. Is it

  1. When you do the moquery command (although you previously said "It does not return anything." so I guess not
  2. When you right click and open the Object Store Browser
    1. Side Q: Did you see ANYTHING when When you right clicked and opened the Object Store Browser?
  3. When you clicked on the fvRsPathAtt heading.

IF it was case #3 above:

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!

IF it was case #1 or2 above:

Then I guess you you try the same suggestions, but I'd need more detail to chase any further.

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

I created a list of dn for application EPGs and ran your moquery one by one. It worked. Thanks a lot.

Brilliant. Glad you got it figured.

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

Save 25% on Day-2 Operations Add-On License