SlideShare a Scribd company logo
1 of 29
Copyright © 2015 World Wide Technology, Inc. All rights reserved.
Programmability and Automation
in Data Center Networks
One tool, two fabrics: Nexus 9000 Configuration Management with
Ansible.
22 October 2015 Joel W. King Engineering and Innovations
Enterprise Networking Solutions
Introduction
Topic Brief:
Ansible is an automation and configuration management technology used to provision, deploy, and manage
compute infrastructure across cloud, virtual, and physical environments. This talk demonstrates how to use
Ansible to automate the configuration of Nexus 9000 series switches in either NX-OS using the NX-API or through
the Application Centric Infrastructure (ACI) controller (APIC).
Speaker Bio:
Joel W. King is a network architect at World Wide Technology (WWT) focused on engineering innovation in
enterprise SDN and network programmability.
Participated on Networking Panel at AnsibleFest NYC 2015
joel.king@wwt.com
@joel_w_king
www.slideshare.net/joelwking
github.com/joelwking/
Agenda
What is Ansible?
Using Ansible for Cisco Nexus 9000 series fabric deployments
 NX-OS using the NX-API (MP-BGP EVPN VXLAN Fabric Design)
 Application Centric Infrastructure
Cisco Data Center Switching
• If you are looking to Cisco for a Data Center switch, it will be a Nexus 9000.
• Nexus 9000 runs in either of two modes:
• NX-OS
• Application Centric Infrastructure – ACI
• Networks need Automation & Programmability.
• NX-API enables a northbound REST interface on individual NX-OS switches
• Nexus 3000 NX-API supported NX-OS 6.0(2)U4(1).
• NX-OS release 7.x enables NX-API on Cisco Nexus 5000 and 6000
• APIC is the Software Defined Networking controller for ACI
Introduction to Ansible
SIMPLE AGENTLESS POWERFUL
• Ansible uses
SSH instead of
agents.
• Python
modules run
locally or on
target systems
• Deploy
applications
• Configuration
management
• Network
provisioning
• Playbooks are
both human
and machine
readable.
• Large library of
modules.
Ansible and Cisco Data Center Networking
SSH – TCP/22
Users, API
NTP – UDP / 123
HTTP(s) TCP/80:443:22
HTTP(s) TCP/80:443
SSH – TCP/22
GitHub
HTTPS TCP/443
LDAP – TCP / 389
ESX
Server
Windows
Systems
Linux
DockerAmazon
Web Services
Agentless
Ansible / Tower
REST API
connection: local
feature nx-api
Nexus 3000 | 9000
Nexus 9000
ACI
github.com/joelwking/
PARAMIKO
APIC-EM
Cisco IOS
Push Based
• Chef and Puppet are “pull-based”
• The agent on the server periodically checks with the central server for configuration
information. (Chef agent by default checks with Chef server every 30 minutes)
• Chef uses a “convergent” model of configuration. As changes propagate through the
nodes, the network as a whole converges to the desired configuration state.
• Ansible is “push-based”
• You run the playbook,
• Ansible modules connect to the target servers and executes the modules
• Push based approach - you control when the changes are made on the server!
• No need to wait for a timer to fire.
Source: Ansible Up & Running & www.chef.io/solutions/configuration-management/
Lexicon
• Inventory A file grouping host names and (optionally) variables.
• Playbooks A design plan of tasks to act on one or more hosts.
• YAML Markup language, more human readable than XML / JSON.
• Facts Variables describing the target system.
• Tasks An activity to be carried out, e.g. install package, configure interface.
• Modules Python code to implement tasks.
• Idempotent Producing the same results if executed once or multiple times.
• Jinja2 Templating language converting templates to configuration files.
• Vault Encrypts sensitive data, passwords, use --ask-vault to prompt.
• Roles Directory structure to provide abstraction, think include files.
Why Learn Ansible?
• Simple, powerful automation tool
• Agentless
• Automation without programming
• Exposes you to Markup Languages
• Forces you to think like a programmer
• Low barrier to entry – Open Source, runs in a VM on your laptop
• Ansible Tower
• centralize and control your infrastructure
• visual dashboard,
• role-based access control,
• job scheduling,
• graphical inventory management.
What are Markup Languages?
• Markup Languages are implementations of
Data Serialization formats | standards | languages
• Cisco IOS configuration files are a proprietary form of
Markup Language
• Examples
• CSV Comma Separated Values
• XML Extensible Markup Language
• JSON JavaScript Object Notation
• YAML YAML ain’t Markup Language
Why Learn Markup Languages?
• Represent structured data to define a network configuration.
• Less emphasis on Command Line Interface (CLI) and IOS config files
Cisco ACI controller (APIC)
will generate and accept both
JSON and XML to save and upload
configurations
NETCONF protocol uses an XML
for configuration data and output messages.
Cisco IOS XR software has an XML
application programming interface (API).
NX-OS Programmability for MP-BGP EVPN
VXLAN Fabric Design
NX-OS Programmabilty
• ******* [ customer name removed ] *******************
• MP-BGP EVPN VXLAN Fabric Design
• Nexus 9500 spines (4)
• Nexus 9300 leafs (40)
• NX-OS configuration is complex
775 lines of config per leaf
WWT Integration Technology Center (ITC)
Cisco Virtual Topology System (VTS)
Cisco Prime Data Center Network Manager
(DCNM)
Process Flow
Group Variables
(All Leafs)
Host Variables
(Individual Switch)
Jinja Template
L2 Port Configuration
CSV
L3 Port Configuration
CSV
Switch
Configuration
Configuring your network from Excel
kingjoe@rocket:~/ansible/roles/excel_nxos/templates$ cat leaf_uplinks.j2
#
# Template for leaf uplinks
#
{% for row in spreadsheet %}
interface {{row.SourcePort}}
description {{row.Description}}
mtu 9216
load-interval counter 1 5
ip address {{row.SourceIP}}
no ipv6 redirects
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 {{OSPF.message_digest_key}}
ip ospf network point-to-point
ip router ospf {{OSPF.processID}} area 0.0.0.0
ip pim sparse-mode
no shutdown
!
{% endfor %}
end
#
# group_vars/leaf
#
OSPF:
message_digest_key: DEADBEEF
processID: 64800
group_vars/leaf
#
# group_vars/leaf
#
OSPF:
message_digest_key: DEADBEEF
processID: 64800
BGP:
as: 64800
neighbor:
- {ip_address: 10.181.63.1, password: DEADBEEF}
- {ip_address: 10.181.63.2, password: DEADBEEF}
- {ip_address: 10.181.63.3, password: DEADBEEF}
- {ip_address: 10.181.63.4, password: DEADBEEF}
vrf:
- PROD
- ACPT
- BACKUP
- MNGMT
host_vars/13leafzn01-rp01y
#
# host_vars/13leafzn01-rp01y
#
Vlan100:
ip_address: 10.181.0.250/31
loopback0:
ip_address: 10.181.63.11
mask: "/32"
s_ip_address: 10.181.63.100
s_mask: "/32"
#
# vPC peer information
#
peer_keepalive:
destination: 10.192.64.12
source: 10.192.64.11
channel_group_number: 10
channel_group:
- interface: "Ethernet2/11"
description: "13leafzn01-rp01z_E2/11"
- interface: "Ethernet2/12"
description: "13leafzn01-rp01z_E2/12"
13leafzn02-rp01.csv
13leafzn02-rp01_uplinks.csv
Ethernet 1/1 - 48
(layer2 port configuration)
Ethernet 2/1 – 4
(layer3 port configuration)
Render the Configuration
#
# Template for leaf uplinks
#
interface Ethernet2/1
description 13spine-rp01_E1/1
mtu 9216
load-interval counter 1 5
ip address 10.181.0.1/31
no ipv6 redirects
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 DEADBEEF
ip ospf network point-to-point
ip router ospf 64800 area 0.0.0.0
ip pim sparse-mode
no shutdown
!
! [ interfaces E2/2 E2/3 and E2/4 removed for brevity ]
!
end
Each column headers are variable names,
cell contents are assigned to these variables.
Variables are then used to render configuration.
Network engineer controls column header names
https://github.com/joelwking/ansible-nxapi/blob/master/csv_to_facts.py
Ansible Directory Structure
/home/kingjoe/ansible/roles:
DAILY_BACKUP
NTP
/playbooks:
xml
templates
hosts
ansible.cfg
*.yml
Inventory file
Configuration file
Playbooks
Static and Dynamic XML
Jinja2 Templates
kingjoe@rocket:~$ tail -3 .profile
#
export ANSIBLE_CONFIG="$HOME/ansible/playbooks/ansible.cfg"
#
inventory = $HOME/ansible/playbooks/hosts
library = /usr/share/ansible/
excel_nxos
Python modules
ACI
NX-OS
Playbook to install modules demonstrated
#
# Copyright (c) 2015 World Wide Technology, Inc.
# All rights reserved.
#
# Author: joel.king@wwt.com
#
# Usage: ansible-playbook download_wwt_modules.yml
#
# Assuming you are running this playbook from the 'administrator' account with sudo permissions,
# before running the first time, set the directory up with proper permissions
#
# sudo rm -rf /usr/share/ansible
# sudo mkdir /usr/share/ansible
# sudo chown administrator /usr/share/ansible
# sudo chgrp administrator /usr/share/ansible
#
# Revision history:
# 12 October 2015 | 1.0 - initial release
#
- name: Update WWT Ansible modules for automating Cisco routers and switches
hosts: localhost
connection: local
gather_facts: no
vars:
path:
target: "/usr/share/ansible/"
source: "https://raw.githubusercontent.com/joelwking/"
programs:
- {repo: "ansible-nxapi/master/", fn: nxapi_install_config.py}
- {repo: "ansible-nxapi/master/", fn: csv_to_facts.py}
- {repo: "ansible-aci/master/", fn: aci_install_config.py}
- {repo: "ansible-aci/master/", fn: AnsibleACI.py}
- {repo: "ansible-aci/master/", fn: aci_gather_facts.py}
- {repo: "ansible-ios/master/", fn: cisco_ios_install_config.py}
- {repo: "ansible-apic-em/master/", fn: apic_em_gather_facts.py}
tasks:
- name: Download the software
uri:
method: GET
url: "{{path.source}}{{item.repo}}{{item.fn}}"
dest: "{{path.target}}"
validate_certs: no
with_items: "{{programs}}"
- name: dos2unix
command: "/usr/bin/dos2unix {{path.target}}{{item.fn}}"
with_items: "{{programs}}"
- name: chmod
command: "/bin/chmod 755 {{path.target}}{{item.fn}}"
with_items: "{{programs}}"
download_wwt_modules.yml
NX-OS Programmability for MP-BGP EVPN
VXLAN Fabric Design
Demonstration
Application Centric Infrastructure
Why do I need automation with ACI?
• Using the ACI GUI is time consuming and prone to human error.
• WWT Integration Technology Center
(ITC) is the hub of our
global deployments and
supply chain programs.
• Customers use the ITC to
stage their data center
infrastructure prior to
deployment.
ACI Demonstrations
• Published demos
• Find the MAC address
https://youtu.be/t03ty5Y295U
• Apply ACI policDemo: Apply ACI policy, run Docker app
https://youtu.be/t03ty5Y295U?t=1m49s
• Today’s demo
• Use Ansible Roles to configure ACI fabric
• Specify NTP servers in CSV file
• Create XML files from templates
• Configure NTP and Daily Backups
Process Flow
vars
Jinja Template (s)
XML
ntp_server.csv
NTP
DAILY_BACKUP
REST API
---
- name: Example of a site.yml file running two roles
hosts: aci
gather_facts: no
roles:
- NTP
- DAILY_BACKUP
Application Centric Infrastructure
Demonstration
Configuring your ACI network from Excel
http://erjosito.tumblr.com/post/129878491127/configuring-your-network-from-excel
Summary
• One tool, two fabrics - ACI or NX-OS.
• Next generation networks, configurations less CLI, more Markup Languages.
• Network Engineers can ‘program’ the network without writing programs.
One tool, two fabrics: Ansible and Nexus 9000

More Related Content

What's hot

NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
Cisco DevNet
 

What's hot (20)

NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
 
StarlingX - A Platform for the Distributed Edge | Ildiko Vancsa
StarlingX - A Platform for the Distributed Edge | Ildiko VancsaStarlingX - A Platform for the Distributed Edge | Ildiko Vancsa
StarlingX - A Platform for the Distributed Edge | Ildiko Vancsa
 
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
 
Accelerating with Ansible
Accelerating with AnsibleAccelerating with Ansible
Accelerating with Ansible
 
Network Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with AnsibleNetwork Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with Ansible
 
Network automation (NetDevOps) with Ansible
Network automation (NetDevOps) with AnsibleNetwork automation (NetDevOps) with Ansible
Network automation (NetDevOps) with Ansible
 
AnsibleFest London 2016 - managing your cisco datacenter network with ansible
AnsibleFest London 2016 - managing your cisco datacenter network with ansibleAnsibleFest London 2016 - managing your cisco datacenter network with ansible
AnsibleFest London 2016 - managing your cisco datacenter network with ansible
 
Kubecon 2017 Zero Touch Kubernetes
Kubecon 2017 Zero Touch KubernetesKubecon 2017 Zero Touch Kubernetes
Kubecon 2017 Zero Touch Kubernetes
 
Zero Code Multi-Cloud Automation with Ansible and Terraform
Zero Code Multi-Cloud Automation with Ansible and TerraformZero Code Multi-Cloud Automation with Ansible and Terraform
Zero Code Multi-Cloud Automation with Ansible and Terraform
 
#SREcon Immutable Infrastructure: rethinking configuration mgmt
#SREcon Immutable Infrastructure: rethinking configuration mgmt#SREcon Immutable Infrastructure: rethinking configuration mgmt
#SREcon Immutable Infrastructure: rethinking configuration mgmt
 
OpenStack QA Tooling & How to use it for Production Cloud Testing | Ghanshyam...
OpenStack QA Tooling & How to use it for Production Cloud Testing | Ghanshyam...OpenStack QA Tooling & How to use it for Production Cloud Testing | Ghanshyam...
OpenStack QA Tooling & How to use it for Production Cloud Testing | Ghanshyam...
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
 
[OpenStack Days Korea 2016] Track1 - Red Hat enterprise Linux OpenStack Platform
[OpenStack Days Korea 2016] Track1 - Red Hat enterprise Linux OpenStack Platform[OpenStack Days Korea 2016] Track1 - Red Hat enterprise Linux OpenStack Platform
[OpenStack Days Korea 2016] Track1 - Red Hat enterprise Linux OpenStack Platform
 
Hostvn ceph in production v1.1 dungtq
Hostvn   ceph in production v1.1 dungtqHostvn   ceph in production v1.1 dungtq
Hostvn ceph in production v1.1 dungtq
 
ONAP SDC - Model driven design
ONAP SDC - Model driven designONAP SDC - Model driven design
ONAP SDC - Model driven design
 
Bringing DevOps to Routing with evolved XR: an overview
Bringing DevOps to Routing with evolved XR: an overviewBringing DevOps to Routing with evolved XR: an overview
Bringing DevOps to Routing with evolved XR: an overview
 
Kubernetes 1.16 and rancher 2.3 enhancements
Kubernetes 1.16 and rancher 2.3 enhancementsKubernetes 1.16 and rancher 2.3 enhancements
Kubernetes 1.16 and rancher 2.3 enhancements
 
OpenStack Summit Vancouver: Lessons learned on upgrades
OpenStack Summit Vancouver:  Lessons learned on upgradesOpenStack Summit Vancouver:  Lessons learned on upgrades
OpenStack Summit Vancouver: Lessons learned on upgrades
 
Tối ưu hiệu năng đáp ứng các yêu cầu của hệ thống 4G core
Tối ưu hiệu năng đáp ứng các yêu cầu của hệ thống 4G coreTối ưu hiệu năng đáp ứng các yêu cầu của hệ thống 4G core
Tối ưu hiệu năng đáp ứng các yêu cầu của hệ thống 4G core
 

Viewers also liked

[세미나] Vagrant 이지원
[세미나] Vagrant 이지원[세미나] Vagrant 이지원
[세미나] Vagrant 이지원
지원 이
 

Viewers also liked (19)

Automating with NX-OS: Let's Get Started!
Automating with NX-OS: Let's Get Started!Automating with NX-OS: Let's Get Started!
Automating with NX-OS: Let's Get Started!
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops Overview
 
Juniper Network Automation for KrDAG
Juniper Network Automation for KrDAGJuniper Network Automation for KrDAG
Juniper Network Automation for KrDAG
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
$10,000 Phantom App & Playbook Contest - F5 and Cisco Meraki
$10,000 Phantom App & Playbook Contest - F5 and Cisco Meraki$10,000 Phantom App & Playbook Contest - F5 and Cisco Meraki
$10,000 Phantom App & Playbook Contest - F5 and Cisco Meraki
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015
 
Extending ansible
Extending ansibleExtending ansible
Extending ansible
 
Extending Ansible - Ansible Benelux meetup - Amsterdam 11-02-2016
Extending Ansible - Ansible Benelux meetup - Amsterdam 11-02-2016Extending Ansible - Ansible Benelux meetup - Amsterdam 11-02-2016
Extending Ansible - Ansible Benelux meetup - Amsterdam 11-02-2016
 
Phantom app: Ansible Tower
Phantom app:  Ansible TowerPhantom app:  Ansible Tower
Phantom app: Ansible Tower
 
Goodbye CLI, hello API: Leveraging network programmability in security incid...
Goodbye CLI, hello API:  Leveraging network programmability in security incid...Goodbye CLI, hello API:  Leveraging network programmability in security incid...
Goodbye CLI, hello API: Leveraging network programmability in security incid...
 
TIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersTIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containers
 
Ansible & Vagrant
Ansible & VagrantAnsible & Vagrant
Ansible & Vagrant
 
Managing sensitive data with Ansible vault
Managing sensitive data with Ansible vaultManaging sensitive data with Ansible vault
Managing sensitive data with Ansible vault
 
Flexible, simple deployments with OpenStack-Ansible
Flexible, simple deployments with OpenStack-AnsibleFlexible, simple deployments with OpenStack-Ansible
Flexible, simple deployments with OpenStack-Ansible
 
Ansible for Enterprise
Ansible for EnterpriseAnsible for Enterprise
Ansible for Enterprise
 
[세미나] Vagrant 이지원
[세미나] Vagrant 이지원[세미나] Vagrant 이지원
[세미나] Vagrant 이지원
 
OpenStack-Ansible Security
OpenStack-Ansible SecurityOpenStack-Ansible Security
OpenStack-Ansible Security
 
Fake IT, until you make IT
Fake IT, until you make ITFake IT, until you make IT
Fake IT, until you make IT
 
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
 

Similar to One tool, two fabrics: Ansible and Nexus 9000

OpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANGOpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANG
Tail-f Systems
 
Beginner's guide to net devops with cisco devnet and ansible
Beginner's guide to net devops with cisco devnet and ansibleBeginner's guide to net devops with cisco devnet and ansible
Beginner's guide to net devops with cisco devnet and ansible
cong tuan
 
Design and implementation of a reliable and cost-effective cloud computing in...
Design and implementation of a reliable and cost-effective cloud computing in...Design and implementation of a reliable and cost-effective cloud computing in...
Design and implementation of a reliable and cost-effective cloud computing in...
Francesco Taurino
 

Similar to One tool, two fabrics: Ansible and Nexus 9000 (20)

Managing Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with AnsibleManaging Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with Ansible
 
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
 
Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK Ceph Day Taipei - Accelerate Ceph via SPDK
Ceph Day Taipei - Accelerate Ceph via SPDK
 
Simulating Networks Using Cisco Modeling Labs (TechWiseTV Workshop)
Simulating Networks Using Cisco Modeling Labs (TechWiseTV Workshop)Simulating Networks Using Cisco Modeling Labs (TechWiseTV Workshop)
Simulating Networks Using Cisco Modeling Labs (TechWiseTV Workshop)
 
Ansible x napalm x nso 解説・比較パネルディスカッション nso
Ansible x napalm x nso 解説・比較パネルディスカッション nsoAnsible x napalm x nso 解説・比較パネルディスカッション nso
Ansible x napalm x nso 解説・比較パネルディスカッション nso
 
OpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANGOpenFlow Switch Management using NETCONF and YANG
OpenFlow Switch Management using NETCONF and YANG
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
Application hosting in the Intelligent WAN
Application hosting in the Intelligent WANApplication hosting in the Intelligent WAN
Application hosting in the Intelligent WAN
 
PLNOG14: Service orchestration in provider network, Tail-f - Przemysław Borek
PLNOG14: Service orchestration in provider network, Tail-f - Przemysław BorekPLNOG14: Service orchestration in provider network, Tail-f - Przemysław Borek
PLNOG14: Service orchestration in provider network, Tail-f - Przemysław Borek
 
Beginner's guide to net devops with cisco devnet and ansible
Beginner's guide to net devops with cisco devnet and ansibleBeginner's guide to net devops with cisco devnet and ansible
Beginner's guide to net devops with cisco devnet and ansible
 
Data models-and-automation-jp
Data models-and-automation-jpData models-and-automation-jp
Data models-and-automation-jp
 
World Wide Technology | Red Hat Ansible for Networking Workshop
World Wide Technology | Red Hat Ansible for Networking WorkshopWorld Wide Technology | Red Hat Ansible for Networking Workshop
World Wide Technology | Red Hat Ansible for Networking Workshop
 
PLNOG19 - Krzysztof Mazepa - Yang Development Kit – stwórz swój pierwszy prog...
PLNOG19 - Krzysztof Mazepa - Yang Development Kit – stwórz swój pierwszy prog...PLNOG19 - Krzysztof Mazepa - Yang Development Kit – stwórz swój pierwszy prog...
PLNOG19 - Krzysztof Mazepa - Yang Development Kit – stwórz swój pierwszy prog...
 
Design and implementation of a reliable and cost-effective cloud computing in...
Design and implementation of a reliable and cost-effective cloud computing in...Design and implementation of a reliable and cost-effective cloud computing in...
Design and implementation of a reliable and cost-effective cloud computing in...
 
Differences of the Cisco Operating Systems
Differences of the Cisco Operating SystemsDifferences of the Cisco Operating Systems
Differences of the Cisco Operating Systems
 
Puppet devops wdec
Puppet devops wdecPuppet devops wdec
Puppet devops wdec
 
Apresentações | Jantar Exclusivo Cisco e Netapp | 27 de Junho de 2012 | Spett...
Apresentações | Jantar Exclusivo Cisco e Netapp | 27 de Junho de 2012 | Spett...Apresentações | Jantar Exclusivo Cisco e Netapp | 27 de Junho de 2012 | Spett...
Apresentações | Jantar Exclusivo Cisco e Netapp | 27 de Junho de 2012 | Spett...
 
OpenStack Scale-out Networking Architecture
OpenStack Scale-out Networking ArchitectureOpenStack Scale-out Networking Architecture
OpenStack Scale-out Networking Architecture
 
Show and Tell: Building Applications on Cisco Open SDN Controller
Show and Tell: Building Applications on Cisco Open SDN Controller Show and Tell: Building Applications on Cisco Open SDN Controller
Show and Tell: Building Applications on Cisco Open SDN Controller
 
OS for AI: Elastic Microservices & the Next Gen of ML
OS for AI: Elastic Microservices & the Next Gen of MLOS for AI: Elastic Microservices & the Next Gen of ML
OS for AI: Elastic Microservices & the Next Gen of ML
 

More from Joel W. King

More from Joel W. King (20)

DevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptxDevNetCreate_2021_joelwking.pptx
DevNetCreate_2021_joelwking.pptx
 
BRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptxBRKEVT-2311_joeking_pbr.pptx
BRKEVT-2311_joeking_pbr.pptx
 
Introduction to GraphQL using Nautobot and Arista cEOS
Introduction to GraphQL using Nautobot and Arista cEOSIntroduction to GraphQL using Nautobot and Arista cEOS
Introduction to GraphQL using Nautobot and Arista cEOS
 
NetDevOps Development Environments
NetDevOps Development EnvironmentsNetDevOps Development Environments
NetDevOps Development Environments
 
DevNet Associate : Python introduction
DevNet Associate : Python introductionDevNet Associate : Python introduction
DevNet Associate : Python introduction
 
Using Batfish for Network Analysis
Using Batfish for Network AnalysisUsing Batfish for Network Analysis
Using Batfish for Network Analysis
 
Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.
 
Cisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design GuideCisco IP Video Surveillance Design Guide
Cisco IP Video Surveillance Design Guide
 
Meraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk PhantomMeraki Virtual Hackathon: app for Splunk Phantom
Meraki Virtual Hackathon: app for Splunk Phantom
 
Business Ready Teleworker Design Guide
Business Ready Teleworker Design GuideBusiness Ready Teleworker Design Guide
Business Ready Teleworker Design Guide
 
Data manipulation for configuration management using Ansible
Data manipulation for configuration management using AnsibleData manipulation for configuration management using Ansible
Data manipulation for configuration management using Ansible
 
DevNet Study Group: Using a SDK
DevNet Study Group: Using a SDKDevNet Study Group: Using a SDK
DevNet Study Group: Using a SDK
 
Foray into Ansible Content Collections
Foray into Ansible Content CollectionsForay into Ansible Content Collections
Foray into Ansible Content Collections
 
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
Analytics for Application Security and Policy Enforcement in Cloud Managed Ne...
 
Enabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with AnsibleEnabling policy migration in the Data Center with Ansible
Enabling policy migration in the Data Center with Ansible
 
Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...Using Tetration for application security and policy enforcement in multi-vend...
Using Tetration for application security and policy enforcement in multi-vend...
 
Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...Using Ansible Tower to implement security policies and telemetry streaming fo...
Using Ansible Tower to implement security policies and telemetry streaming fo...
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of Truth
 
Super-NetOps Source of Truth
Super-NetOps Source of TruthSuper-NetOps Source of Truth
Super-NetOps Source of Truth
 
Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

One tool, two fabrics: Ansible and Nexus 9000

  • 1. Copyright © 2015 World Wide Technology, Inc. All rights reserved. Programmability and Automation in Data Center Networks One tool, two fabrics: Nexus 9000 Configuration Management with Ansible. 22 October 2015 Joel W. King Engineering and Innovations Enterprise Networking Solutions
  • 2. Introduction Topic Brief: Ansible is an automation and configuration management technology used to provision, deploy, and manage compute infrastructure across cloud, virtual, and physical environments. This talk demonstrates how to use Ansible to automate the configuration of Nexus 9000 series switches in either NX-OS using the NX-API or through the Application Centric Infrastructure (ACI) controller (APIC). Speaker Bio: Joel W. King is a network architect at World Wide Technology (WWT) focused on engineering innovation in enterprise SDN and network programmability. Participated on Networking Panel at AnsibleFest NYC 2015 joel.king@wwt.com @joel_w_king www.slideshare.net/joelwking github.com/joelwking/
  • 3. Agenda What is Ansible? Using Ansible for Cisco Nexus 9000 series fabric deployments  NX-OS using the NX-API (MP-BGP EVPN VXLAN Fabric Design)  Application Centric Infrastructure
  • 4. Cisco Data Center Switching • If you are looking to Cisco for a Data Center switch, it will be a Nexus 9000. • Nexus 9000 runs in either of two modes: • NX-OS • Application Centric Infrastructure – ACI • Networks need Automation & Programmability. • NX-API enables a northbound REST interface on individual NX-OS switches • Nexus 3000 NX-API supported NX-OS 6.0(2)U4(1). • NX-OS release 7.x enables NX-API on Cisco Nexus 5000 and 6000 • APIC is the Software Defined Networking controller for ACI
  • 5. Introduction to Ansible SIMPLE AGENTLESS POWERFUL • Ansible uses SSH instead of agents. • Python modules run locally or on target systems • Deploy applications • Configuration management • Network provisioning • Playbooks are both human and machine readable. • Large library of modules.
  • 6. Ansible and Cisco Data Center Networking SSH – TCP/22 Users, API NTP – UDP / 123 HTTP(s) TCP/80:443:22 HTTP(s) TCP/80:443 SSH – TCP/22 GitHub HTTPS TCP/443 LDAP – TCP / 389 ESX Server Windows Systems Linux DockerAmazon Web Services Agentless Ansible / Tower REST API connection: local feature nx-api Nexus 3000 | 9000 Nexus 9000 ACI github.com/joelwking/ PARAMIKO APIC-EM Cisco IOS
  • 7. Push Based • Chef and Puppet are “pull-based” • The agent on the server periodically checks with the central server for configuration information. (Chef agent by default checks with Chef server every 30 minutes) • Chef uses a “convergent” model of configuration. As changes propagate through the nodes, the network as a whole converges to the desired configuration state. • Ansible is “push-based” • You run the playbook, • Ansible modules connect to the target servers and executes the modules • Push based approach - you control when the changes are made on the server! • No need to wait for a timer to fire. Source: Ansible Up & Running & www.chef.io/solutions/configuration-management/
  • 8. Lexicon • Inventory A file grouping host names and (optionally) variables. • Playbooks A design plan of tasks to act on one or more hosts. • YAML Markup language, more human readable than XML / JSON. • Facts Variables describing the target system. • Tasks An activity to be carried out, e.g. install package, configure interface. • Modules Python code to implement tasks. • Idempotent Producing the same results if executed once or multiple times. • Jinja2 Templating language converting templates to configuration files. • Vault Encrypts sensitive data, passwords, use --ask-vault to prompt. • Roles Directory structure to provide abstraction, think include files.
  • 9. Why Learn Ansible? • Simple, powerful automation tool • Agentless • Automation without programming • Exposes you to Markup Languages • Forces you to think like a programmer • Low barrier to entry – Open Source, runs in a VM on your laptop • Ansible Tower • centralize and control your infrastructure • visual dashboard, • role-based access control, • job scheduling, • graphical inventory management.
  • 10. What are Markup Languages? • Markup Languages are implementations of Data Serialization formats | standards | languages • Cisco IOS configuration files are a proprietary form of Markup Language • Examples • CSV Comma Separated Values • XML Extensible Markup Language • JSON JavaScript Object Notation • YAML YAML ain’t Markup Language
  • 11. Why Learn Markup Languages? • Represent structured data to define a network configuration. • Less emphasis on Command Line Interface (CLI) and IOS config files Cisco ACI controller (APIC) will generate and accept both JSON and XML to save and upload configurations NETCONF protocol uses an XML for configuration data and output messages. Cisco IOS XR software has an XML application programming interface (API).
  • 12. NX-OS Programmability for MP-BGP EVPN VXLAN Fabric Design
  • 13. NX-OS Programmabilty • ******* [ customer name removed ] ******************* • MP-BGP EVPN VXLAN Fabric Design • Nexus 9500 spines (4) • Nexus 9300 leafs (40) • NX-OS configuration is complex 775 lines of config per leaf WWT Integration Technology Center (ITC) Cisco Virtual Topology System (VTS) Cisco Prime Data Center Network Manager (DCNM)
  • 14. Process Flow Group Variables (All Leafs) Host Variables (Individual Switch) Jinja Template L2 Port Configuration CSV L3 Port Configuration CSV Switch Configuration
  • 15. Configuring your network from Excel kingjoe@rocket:~/ansible/roles/excel_nxos/templates$ cat leaf_uplinks.j2 # # Template for leaf uplinks # {% for row in spreadsheet %} interface {{row.SourcePort}} description {{row.Description}} mtu 9216 load-interval counter 1 5 ip address {{row.SourceIP}} no ipv6 redirects ip ospf authentication message-digest ip ospf message-digest-key 1 md5 {{OSPF.message_digest_key}} ip ospf network point-to-point ip router ospf {{OSPF.processID}} area 0.0.0.0 ip pim sparse-mode no shutdown ! {% endfor %} end # # group_vars/leaf # OSPF: message_digest_key: DEADBEEF processID: 64800
  • 16. group_vars/leaf # # group_vars/leaf # OSPF: message_digest_key: DEADBEEF processID: 64800 BGP: as: 64800 neighbor: - {ip_address: 10.181.63.1, password: DEADBEEF} - {ip_address: 10.181.63.2, password: DEADBEEF} - {ip_address: 10.181.63.3, password: DEADBEEF} - {ip_address: 10.181.63.4, password: DEADBEEF} vrf: - PROD - ACPT - BACKUP - MNGMT
  • 17. host_vars/13leafzn01-rp01y # # host_vars/13leafzn01-rp01y # Vlan100: ip_address: 10.181.0.250/31 loopback0: ip_address: 10.181.63.11 mask: "/32" s_ip_address: 10.181.63.100 s_mask: "/32" # # vPC peer information # peer_keepalive: destination: 10.192.64.12 source: 10.192.64.11 channel_group_number: 10 channel_group: - interface: "Ethernet2/11" description: "13leafzn01-rp01z_E2/11" - interface: "Ethernet2/12" description: "13leafzn01-rp01z_E2/12" 13leafzn02-rp01.csv 13leafzn02-rp01_uplinks.csv Ethernet 1/1 - 48 (layer2 port configuration) Ethernet 2/1 – 4 (layer3 port configuration)
  • 18. Render the Configuration # # Template for leaf uplinks # interface Ethernet2/1 description 13spine-rp01_E1/1 mtu 9216 load-interval counter 1 5 ip address 10.181.0.1/31 no ipv6 redirects ip ospf authentication message-digest ip ospf message-digest-key 1 md5 DEADBEEF ip ospf network point-to-point ip router ospf 64800 area 0.0.0.0 ip pim sparse-mode no shutdown ! ! [ interfaces E2/2 E2/3 and E2/4 removed for brevity ] ! end Each column headers are variable names, cell contents are assigned to these variables. Variables are then used to render configuration. Network engineer controls column header names https://github.com/joelwking/ansible-nxapi/blob/master/csv_to_facts.py
  • 19. Ansible Directory Structure /home/kingjoe/ansible/roles: DAILY_BACKUP NTP /playbooks: xml templates hosts ansible.cfg *.yml Inventory file Configuration file Playbooks Static and Dynamic XML Jinja2 Templates kingjoe@rocket:~$ tail -3 .profile # export ANSIBLE_CONFIG="$HOME/ansible/playbooks/ansible.cfg" # inventory = $HOME/ansible/playbooks/hosts library = /usr/share/ansible/ excel_nxos Python modules ACI NX-OS
  • 20. Playbook to install modules demonstrated # # Copyright (c) 2015 World Wide Technology, Inc. # All rights reserved. # # Author: joel.king@wwt.com # # Usage: ansible-playbook download_wwt_modules.yml # # Assuming you are running this playbook from the 'administrator' account with sudo permissions, # before running the first time, set the directory up with proper permissions # # sudo rm -rf /usr/share/ansible # sudo mkdir /usr/share/ansible # sudo chown administrator /usr/share/ansible # sudo chgrp administrator /usr/share/ansible # # Revision history: # 12 October 2015 | 1.0 - initial release # - name: Update WWT Ansible modules for automating Cisco routers and switches hosts: localhost connection: local gather_facts: no vars: path: target: "/usr/share/ansible/" source: "https://raw.githubusercontent.com/joelwking/" programs: - {repo: "ansible-nxapi/master/", fn: nxapi_install_config.py} - {repo: "ansible-nxapi/master/", fn: csv_to_facts.py} - {repo: "ansible-aci/master/", fn: aci_install_config.py} - {repo: "ansible-aci/master/", fn: AnsibleACI.py} - {repo: "ansible-aci/master/", fn: aci_gather_facts.py} - {repo: "ansible-ios/master/", fn: cisco_ios_install_config.py} - {repo: "ansible-apic-em/master/", fn: apic_em_gather_facts.py} tasks: - name: Download the software uri: method: GET url: "{{path.source}}{{item.repo}}{{item.fn}}" dest: "{{path.target}}" validate_certs: no with_items: "{{programs}}" - name: dos2unix command: "/usr/bin/dos2unix {{path.target}}{{item.fn}}" with_items: "{{programs}}" - name: chmod command: "/bin/chmod 755 {{path.target}}{{item.fn}}" with_items: "{{programs}}" download_wwt_modules.yml
  • 21. NX-OS Programmability for MP-BGP EVPN VXLAN Fabric Design Demonstration
  • 23. Why do I need automation with ACI? • Using the ACI GUI is time consuming and prone to human error. • WWT Integration Technology Center (ITC) is the hub of our global deployments and supply chain programs. • Customers use the ITC to stage their data center infrastructure prior to deployment.
  • 24. ACI Demonstrations • Published demos • Find the MAC address https://youtu.be/t03ty5Y295U • Apply ACI policDemo: Apply ACI policy, run Docker app https://youtu.be/t03ty5Y295U?t=1m49s • Today’s demo • Use Ansible Roles to configure ACI fabric • Specify NTP servers in CSV file • Create XML files from templates • Configure NTP and Daily Backups
  • 25. Process Flow vars Jinja Template (s) XML ntp_server.csv NTP DAILY_BACKUP REST API --- - name: Example of a site.yml file running two roles hosts: aci gather_facts: no roles: - NTP - DAILY_BACKUP
  • 27. Configuring your ACI network from Excel http://erjosito.tumblr.com/post/129878491127/configuring-your-network-from-excel
  • 28. Summary • One tool, two fabrics - ACI or NX-OS. • Next generation networks, configurations less CLI, more Markup Languages. • Network Engineers can ‘program’ the network without writing programs.

Editor's Notes

  1. https://www.chef.io/solutions/configuration-management/
  2. https://commons.wikimedia.org/wiki/File:07._Camel_Profile,_near_Silverton,_NSW,_07.07.2007.jpg
  3. WWT Integration Technology Center (ITC) is the hub of our global deployments and supply chain programs.