cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
747
Views
5
Helpful
3
Replies

Show VPC in ACI orphan or unused

Andres Baron
Level 1
Level 1

Greetings community, I would like to know if there is a Moquery-type command or  Python script that can deliver VPCs that are not in use.

It already uses the functionality of the acitoolkit Lint but it does not deliver this object.

3 Replies 3

Robert Burns
Cisco Employee
Cisco Employee

What do you mean by "not in use".  Are you looking for configured VPCs, but nothing physically connected?, Configured and connecteed but no EPGs mapped? etc.

Robert

HI Robert 

What I need to see are the VPC policy-groups that do not have associated physical interfaces (interface-selector), also the VPCs that do not have associated EPGs

Andres

Robert Burns
Cisco Employee
Cisco Employee

While I don't have cycles to create a script for you, this is something you should be able to figure out.   Best way would be a python script (no single API call will accomplish this).  I can point you in the right direction to get started.

Step1. Get a list of all objects of class 'infraAccBndlGrp' and pull them into an array/list

Step2. Using the list as input, run a loop using the following query for each Policy Group (infraAccBndleGrp) object in the list
Ex.
'/api/node/mo/uni/infra/funcprof/[infraAccBndlGrp_Array_Item].json?query-target=children&target-subtree-class=relnFrom'

Step3. Use some logic to determine if that PolicyGrp is in use.  If the returned objects = '0' then this is an orphaned object which you can then delete.  Else, if the returned Obects is >0, its being referenced (in use)

Here's a sample postman API call to grab all VPC Policy Groups from the fabric.  You'd just need the dn property from each returned object.

RobertBurns_1-1676659619159.png

Here's a postman API call to look for any relations to a specific AccBndlGrp object which happens to have no relations (orphaned

RobertBurns_4-1676660101754.png

Here's a postman API call to look for any relations to a specific AccBndlGrp object which happens to be in use (has 2 relations):

RobertBurns_0-1676659463782.png

If anyone else has a pre-made script or another method to accomplish this hopefully they'll share it.  If not, this shouldn't be too hard to figure out.

Hope this helps,
Robert

 

 

 

 

 

 

Review Cisco Networking for a $25 gift card

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