About this Lab!
It has been some time now since the concept of Software Defined Networks (SDN) has entered the networking
industry and marketplace. The fundamental principle of SDN is to interact with networks programmatically to
deploy, control, change, and manage network devices using open interfaces. Over time, the tools for this
programmatic interaction have evolved into controllers and DevOps tools that have introduced a mindset shift
in the industry to representing network infrastructure as code. Two common terms for this in the industry
are Infrastructure as Code (IaC) and Network as Code (NaC). The mindset change brings the managing and
provisioning of infrastructure through software development practices and code instead of performing these tasks manually.
In this lab, you assume the role of a network automation engineer. You will use various automation and programmability tools
to develop Python scripts and Ansible playbooks to deploy and verify a VXLAN EVPN fabric using Cisco Open NX-OS in a staging
fabric before deploying and verifying a production (prod) fabric through NetDevOps methodology.
The lab environment makes use of
the Nexus 9000v in Cisco Modeling Labs (CML) to provide each student with a staging fabric and prod fabric consisting of five nodes: 2 x Spine switches and 3 x Leaf
switches. CML and the N9Kv were developed for purposes such as this lab — to test out topologies and the
programmable interfaces available for the Nexus 9000 series switches. Additionally, the N9Kv can be deployed in VMWare,
KVM, and Vagrant.
The lab will guide you through the following:
-
You will start with an NX-API overview to understand Open NX-OS' REST interface, various transports, and data structures.
-
With a firm understanding of these concepts, you will combine Python with the Requests package and Open NX-OS'
NX-API to provision the VXLAN EVPN Underlay. The Underlay will be deployed using OSPF as the IGP to advertise
Loopback addresses for iBGP EVPN peering and tunnel endpoint (TEP) advertisement later in the lab. PIM will
also be provisioned for multicast used for broadcast, unknown unicast, or multicast (data plane), also known
as BUM traffic.
-
Next, you will use DevOps tooling to deploy your VXLAN EVPN fabric onto your staging fabric with the use of Ansible
network resource modules. This will encompass developing reusable automation to deploy configuration changes
to your VXLAN fabric through declarative Ansible roles for use in a VXLAN playbook.
-
You will then write test automation using Cisco pyATS. This configuration and test automation will be integrated
into a NetDevOps Continuous Integration, Continuous Delivery (CI/CD) pipeline to perform a network change by
testing it against the staging fabric you have been developing against. Pending success in the pipeline,
you will be able to trigger the deployment and tests to your prod fabric.
-
You will transition to exploring the use of Terraform for NX-OS to manage your fabric in a declarative manner. The NX-OS Terraform provider uses the same underlying NX-API; specifically, NX-API REST using the DME.
-
Finally, you will explore a brand-new feature delivered in NX-OS 10.6(3) in tech preview called configuration session or configuration candidate as it is sometimes referred. This feature allows you to make configuration changes in a session by staging the configuration; allowing for config review, then configuration commit. Each commit creates a rollback point that you can return to if needed. This is a powerful feature for network automation and programmability as it allows for safe deployment of configuration changes with the ability to easily rollback to a known good state if needed.
-
Optionally, as a bonus to the lab, you will also have the opportunity to explore the use of YANG models with Model-Driven Programming (MDP) with Ansible NETCONF, Python NETCONF and RESTCONF, and gNMI with Ansible.
There are various implementation models for programming and automating networking devices or entire fabrics.
These include:
-
off-box interaction - where a program is executed remotely from the device over Telnet, SSH, or a REST API
-
on-box interaction - where a program is sent to the network device and executed directly on the network device
-
hybrid interaction - where the relationship is agent-based
This lab will focus on off-box interactions and predominantly make use of Ansible's agentless architecture (requiring no agent) for NX-OS and NDFC.
The lab, from a high level, has the following sections:
- Introduction
- Dev Setup
- NX-API Overview
- NX-API Python
- Ansible NXOS
- pyATS
- NetDevOps
- Terraform
- Config Session
- Bonus: YANG
- Reference: Postman
Please continue to set up your development environment!