Cisco NX-OS / ACI โ Management
Day-2 inventory, facts and config management for Cisco NX-OS / ACI data center fabrics (VXLAN/EVPN). Part of the multi-vendor Data Center automation guide.
Setup, key commands & run examples
Describe each Cisco device once โ role, mgmt IP and VTEP โ so the same workflow targets it and every other vendor in the fabric.
leaf21:
role: leaf
vendor: cisco
mgmt: 10.0.0.21
vtep: 10.255.0.21
napalm: nxos_sshOpen a session to a Cisco NX-OS / ACI device. NAPALM normalizes facts across vendors using driver "nxos_ssh".
import napalm
# Cisco NX-OS / ACI โ NAPALM driver "nxos_ssh"
driver = napalm.get_network_driver("nxos_ssh")
dev = driver(hostname="10.0.0.21", username="admin", password="secret")
dev.open()The day-2 management read-outs you will automate on Cisco: version, EVPN peers and interface state.
# inventory & health snapshot โ Cisco NX-OS / ACI
show version
show interface status
show bgp l2vpn evpn summaryBest practices
One intent model, many renderers
Keep a single fabric description and render Cisco config from it โ never SSH in to edit CLI by hand.
Prefer structured APIs
Use NAPALM getters (get_facts, get_interfaces, get_bgp_neighbors) so Cisco returns the same shapes as the rest of the fleet.
Version your inventory
Treat fabric.yml as the source of truth in git; every change is a reviewable PR.
Idempotent runs
Management scripts should be safe to re-run โ collect, compare, only change what drifted.
Hands-on exercises
Guided practice tasks โ copy the starter snippet, run it against a lab device, and extend it to meet the goal.
Goal: Connect to the leaf, pull version + model and print one inventory row.
import napalm
# Cisco NX-OS / ACI โ NAPALM driver "nxos_ssh"
driver = napalm.get_network_driver("nxos_ssh")
dev = driver(hostname="10.0.0.21", username="admin", password="secret")
dev.open()
# TODO: print hostname, model and OS versionGoal: Compare live interface admin/oper state against the intended list and report mismatches.
intended = {"Ethernet1", "Ethernet2"}
# TODO: read live interfaces and report any intended port that is downCurated videos & guides
Checklist โ pitfalls, gotchas & verification
Common pitfalls
- โขScreen-scraping Cisco CLI when a structured API exists โ output formats change between releases.
- โขStoring credentials in the script instead of a vault / env vars.
- โขEditing boxes by hand so the inventory no longer matches reality.
Gotchas to watch
- โขNAPALM driver "nxos_ssh" must match transport โ confirm SSH/API is enabled on the device.
- โขManagement VRF: make sure your reachability is over the mgmt VRF, not the data plane.
Verify it works
- โขRe-run the report and confirm every device returns facts.
- โขConfirm the inventory row matches the physical device (model, serial, OS).