Skip to content

mrdavehill/ACI---Add-BD-EPG-and-Vlan-Pool

Repository files navigation

ACI---Add-BD-EPG-and-Vlan-Pool

Updated to run from a container, run this command:

docker run -it -v ~/ACI---Add-BD-EPG-and-Vlan-Pool:/code aci python /code/APICImporter.py

Cisco ACI automation

Creates EPGs, BDs, Vlan pools and POSTs them into the APICs REST API using JSON.

Here be screengrab

Use Case Description

I needed to create multiple Bridge Domains and End Point Groups in ACI for temporary bridges into legacy NXOS as we moved our VM estate.

The configs for each BD/EPG were pretty much the same so I created a script to save some clicking.

The screengrab below is the completed config on a Devnet APIC run from this script.

Here be mo screengrab

Installation

Clone to your machine, update credentials.py and listOfThings.py so it matches your environment.

Configuration

Get into that credentials.py file and add your details to the host, username and password objects.

It's currently set up to use a Cisco Devnet sandbox but you can change that to suit your environment.

username = 'admin'

password = 'ciscopsdt'

Then start on the listOfThings.py

This is also set up for the sandbox

host = 'sandboxapicdc.cisco.com'

domain = 'Domain_Core'

environment = 'common'

Usage

VM migrations over a layer 2 bridge.

DevNet Sandbox

Cisco has an 'always on' APIC here you can test this sript on.

It really does work; amaze!

How to test the software

You need the objects below on the sandbox, creat them using this bit of Terraform: https://github.com/mrdavehill/-Terraform-ACI--Domain-AAEP-VlanPool.

AEP - AEP_Core

Vlan Pool - Vlan_Pool_Core

Domain - Domain_Core

I've used the common tenant. You wouldn't do that in Prod but as the config on this APIC is a moving target I'll take whatever stability I can get.

Known issues

The credentials file doesn't fit best practices for hiding your username and password. I am truly sorry for this.

I could have used 'tenant' instead of 'environment' to clearer.

Getting help

Hit me up if you have any issues.

Author(s)

This project was written and is maintained by the following individuals:

published