When you run the application, the system determines if the node exists and, if not, adds it. If the node exists, the system registers it.
The application uses the
APIC-Challenge tokenfor a stronger API session security. To learn more about the challenge token, see Requiring a Challenge Token for an API Session.
- Directory Structure
- Overview
- Fabric Node Discovery Statuses
- Installation
- Register Fabric Nodes
- Bonus (Cobra SDK)
The directory contains the following files:
│ main.py
│ apic.py
│ nodes.py
│ apic_cobra.py
│ Fabric-Nodes.xlsx
| requirements.txt
│ README.md
│ LICENSE
│ .gitignore
├───assets
│ apic_nodes.jpg
│ registered_nodes.jpg
└───
apic.pymodule contains the APIC functions to connect and have access to the APIC Controller.nodes.pymodule contains the functions to read nodes to be registered and register those nodes.main.pymodule contains the main function to run the application.Fabric-Nodes.xlsxis an MS Excel spreadsheet with four nodes to be registered (All Columns are validated using Excel data validation feature to restrict duplicate or invalid data and to show an error alert even before registering the nodes).- For
apic_cobra.pymodule, check Bonus section.
After a switch/node is registered with the APIC, the switch is a part of the APIC-managed fabric inventory. With the ACI fabric, the APIC is the single point of provisioning, management, and monitoring for switches in the infrastructure.
Switches in the Nodes Pending Registration tab table can have the following conditions:
- A newly discovered but unregistered node has a node ID of 0 and has no assigned IP address.
- A manually entered (in APIC) but unregistered switch has an original status of
Undiscovereduntil it is physically connected to the network. Once connected, the status changes toDiscovered.
Note: After the node ID is assigned, it cannot be updated/edited.
| Status | Description |
|---|---|
| Unknown | Node is discovered but no Node ID policy is configured. |
| Undiscovered | Node ID configured but is not yet discovered. |
| Discovering | Node is discovered but IP is not yet assigned. |
| Unsupported | Node is not a supported model. |
| Disabled | Node has been decommissioned. |
| Inactive | No IP connectivity. |
| Active | Node is active. |
- Download the repo from GitHub using
Codebutton. - Unzip the repo.
- Create a Python virtual environment and activate it.
- Install requirements.
register-fabric-nodes-main> python -m venv .venv --upgrade-deps
register-fabric-nodes-main> .\.venv\Scripts\Activate.ps1
register-fabric-nodes-main> python -m pip install wheel
register-fabric-nodes-main> python -m pip install -r requirements.txt- Clone the repo from GitHub.
- Create a Python virtual environment and activate it.
- Install requirements.
$ git clone https://github.com/Tes3awy/register-fabric-nodes.git
$ cd register-fabric-nodes
$ python3 -m venv .venv --upgrade-deps
$ source .venv/bin/activate
$ python3 -m pip install wheel
$ python3 -m pip install -r requirements.txtAn Excel file is already attached in the repo and is prepopulated with two leafs and two spines from Getting Started with Cisco ACI 5.2 v1 from Cisco dCloud.
For non Cisco partners, you can use the application with the ACI Simulator 5.2 from Cisco DevNet Sandbox. (Requires reservation)
Add your ACI fabric nodes to Fabric-Nodes.xlsx.
In Node Type column (Column A), you can select only one of the following four valid node types:
unspecifiedtier-2-leafremote-wan-leafvirtual
If you don't know which value to select from the
Node Typecolumn, chooseunspecified.
In Node Role column (Column B), you can select only one of the following three valid node roles:
spineleafunspecified
After filling out all columns in Fabric-Nodes.xlsx, double check your entries, save the Excel file, and exit MS Excel.
Finally, run the application.
Windows
> py main.py
# or
> py -m mainNix or macOS
$ python3 main.py
# or
$ python3 -m mainYou will be prompted to enter Excel file, APIC URL, username, and password.
Example:
Nodes Excel file: Fabric-Nodes.xlsx
APIC IP Address: sandboxapicdc.cisco.com
Username: admin
Password:Note: After a successful run, the node is removed from the
Nodes Pending Registrationtab table toRegistered Nodestab table and you cannot by any means update/edit neither thenode typenor thenode id.
If you have downloaded and installed the Cobra SDK (i.e., acicobra and acimodel wheel files), you can run the application using apic_cobra.py. It's faster than the regular application (Around 1.8x faster).
$ python apic_cobra.py
# or
$ python -m apic_cobra
