building cloud virtual topologies with ravello and ansible

32
Building Cloud Virtual Topologies with Ravello & Ansible SF Network Automation Meetup, Feb 13th 2017 Damien Garros @damgarros @dgarros

Upload: damien-garros

Post on 15-Apr-2017

187 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Building Cloud Virtual Topologies with Ravello and Ansible

Building Cloud Virtual Topologies with Ravello

& Ansible SF Network Automation Meetup, Feb 13th 2017

Damien Garros @damgarros

@dgarros

Page 2: Building Cloud Virtual Topologies with Ravello and Ansible

Agenda

● Quick introduction to Ravello● How to Build Topology easily with Ansible

(on Ravello)● How to use Ravello as part of a CI pipeline

Page 3: Building Cloud Virtual Topologies with Ravello and Ansible

Me● Datacenter Networking for 10y● Network Automation for 5y● 6y with Juniper ● Recently joined Apstra

as Customer Enablement Engineer

No affiliation with Ravello nor Ansible

Page 4: Building Cloud Virtual Topologies with Ravello and Ansible

Quick Introduction to Ravello

Page 5: Building Cloud Virtual Topologies with Ravello and Ansible

Ravello in a Nutshell● Solution to build Virtual Topology in the Cloud● Working on Top of AWS / GCE / Oracle Cloud● Work with any VMs (ova, vmdk, img …)● Pay by the hour● Now part of Oracle

Page 6: Building Cloud Virtual Topologies with Ravello and Ansible

Ravello Pros / Cons

Pro● Works with all VMs● Can build any topology● Everything available via REST API● All VMs can have Public IPs● Powerful Token system● Powerful Blueprint system● Pay by the hour● “Unlimited” capacity

Cons● Reduced Performance

Nested Virtualization● Network design sucks● REST API requires full objects● Can be expensive if used for a

long period

Page 7: Building Cloud Virtual Topologies with Ravello and Ansible

Ravello / Use cases for Networking● Training● On Demand Labs● Large topology reproduction ● CI Pipeline for Network ● Infrastructure as code● ….

Page 8: Building Cloud Virtual Topologies with Ravello and Ansible

Demo

Page 9: Building Cloud Virtual Topologies with Ravello and Ansible

Why Not AWS ??● L3 between VMs only,

○ no L1/L2 ( lldp, lacp)● No notion of “topology” in AWS● AWS do not support all VMs out of the box● No user portal and No delegation system

(token)

Page 10: Building Cloud Virtual Topologies with Ravello and Ansible

How to build topology easily with Ansible(on Ravello)

Page 11: Building Cloud Virtual Topologies with Ravello and Ansible

Problem Statement● Long & Complicated to build network topology

on Ravello● Very difficult to Update an existing topology

I need to update the NOS version

Page 12: Building Cloud Virtual Topologies with Ravello and Ansible

Solution● Abstract the definition of a new topology● Use Ansible to

○ Automate the creation of new topologies○ Automate the configuration of devices

Page 13: Building Cloud Virtual Topologies with Ravello and Ansible

Ansible Roles for Ravello

● Several Roles to:○ Create one application from scratch○ Create several applications from Blueprint○ Start/Stop VMs○ Collect Public IPs

● Published on Github / Docker● Currently in “Alpha” mode

https://github.com/Juniper/ravello-ansible

Page 14: Building Cloud Virtual Topologies with Ravello and Ansible

Example / Spine - Leaf Topology

Spine1 Spine2

Leaf1 Leaf2 Leaf3

● Assign a unique ID to each link

1

2 3 4 5

6● Assign an ID to

each interface

Page 15: Building Cloud Virtual Topologies with Ravello and Ansible

How to define a new topology## Ansible Inventory File

[spine]spine1 id=11spine2 id=21

[leaf]leaf1 id=111leaf2 id=121leaf3 id=131

[all:vars]ravello_app_name="Ip Fabric Junos"ravello_image=vqfx10k-re-15.1X53-D60

## Topology Definition file (yaml)

ravello_topology: leaf3: - link: dhcp-public services: [ ssh, icmp ] - link: 93 # To PFE - link: 83 # Reserved - link: 15 # Spine1 - link: 16 # Spine2

spine1: - link: dhcp-public services: [ ssh, icmp ] - link: 94 # To PFE - link: 84 # Reserved - link: 11 # Leaf1 - link: 13 # Leaf2 - link: 15 # Leaf3

Page 16: Building Cloud Virtual Topologies with Ravello and Ansible

Inventory File ## Ansible Inventory File

[spine]spine1 id=11spine2 id=21

[leaf]leaf1 id=111leaf2 id=121leaf3 id=131

[all:vars]ravello_app_name="Ip Fabric Junos"ravello_image=vqfx10k-re-15.1X53-D60

Mandatory information

● Unique “id” per VMs

● ravello_image matching the name of a VM image in Ravello

● ravello_app_name to define the name of the application in Ravello

Page 17: Building Cloud Virtual Topologies with Ravello and Ansible

How to define a new topology## Topology Definition file (yaml)

ravello_topology: leaf3: - link: dhcp-public services: [ ssh, icmp ] - link: 93 # To PFE - link: 83 # Reserved - link: 15 # Spine1 - link: 16 # Spine2

spine1: - link: dhcp-public services: [ ssh, icmp ] - link: 94 # To PFE - link: 84 # Reserved - link: 11 # Leaf1 - link: 13 # Leaf2 - link: 15 # Leaf3

● Each L2 domain has a unique identifier

● 2 interfaces connected to the same L2 domain simulate a point-to-point connection

● Interfaces are defined in order, to be able to predict interfaces name.

● Both “Leaf3-Int4” and “Spine1-Int5” are connected together (15)

Page 19: Building Cloud Virtual Topologies with Ravello and Ansible

What next ?

● Need more testers● Continue with Roles or create Modules ?● Add more features

https://github.com/Juniper/ravello-ansible

Page 20: Building Cloud Virtual Topologies with Ravello and Ansible

How to use Ravello as part of a CI Pipeline

Page 21: Building Cloud Virtual Topologies with Ravello and Ansible

Problem Statement1. Continuous Integration for Network related

tools requires real Network Devices.2. On-premise, complicated to have a dedicated

lab for CI3. On-Internet, impossible to access Nerwork

Devices

Page 22: Building Cloud Virtual Topologies with Ravello and Ansible

Solution1. Dynamically create Virtual Topology on Ravello

for each commit from CI tool (travis)2. Leverage Ravello Token to be able to expose

these publically3. Optional - Use IP Filtering to Restric the access

to the VMs

Page 23: Building Cloud Virtual Topologies with Ravello and Ansible

Solution Project on Github/GitlabFile .travis.yaml

Tests & Code

On Commit / PRTravis download the project

and execute .travis.yaml

1. Create topology on Ravello2. Collect VMs Public IP address3. Run tests

Page 24: Building Cloud Virtual Topologies with Ravello and Ansible

Demo

Page 25: Building Cloud Virtual Topologies with Ravello and Ansible

Variable File with Tokens## Variable file## host_vars/aos/ravello-token.yaml

ravello_ci: aos_version: "1.1": blueprint: 78709495 token: WWcsYxdcmxuv5pedRa4hRtE8AFsYOMLVIA4cZn2f64b6QBUfvBhN4pPL3FVkD9pG "1.0": blueprint: 78709497 token: 97V09ML3nNDleL4s466Za8UR5Ub5VHMMmjFOshstKm2Khil6hg4ar2zwJoSRnkVW

Page 26: Building Cloud Virtual Topologies with Ravello and Ansible

Inventory file## Ansible Inventory File

[aos]aos port=8888 username=admin

[all:vars]ravello_ci_app_name="aos-ansible AOS_{{ lookup('env','AOS_VERSION') }} Travis_{{ lookup('env','TRAVIS_JOB_ID') }} {{ lookup('env','TRAVIS_COMMIT') }}"ravello_ci_expiration_time_min=50ravello_ci_token="{{ ravello_ci.aos_version[aos_ver].token }}"ravello_ci_blueprint="{{ ravello_ci.aos_version[aos_ver].blueprint }}"

Page 27: Building Cloud Virtual Topologies with Ravello and Ansible

Playbook (partial)---- name: Create Application on Ravello for CI connection: local hosts: all gather_facts: no roles: - ravello.lib tasks: - name: Create Application from Blueprint for CI uri: url: "https://cloud.ravellosystems.com/api/v1/applications/" method: POST status_code: 201 HEADER_Content-Type: 'application/json' HEADER_Accept: 'application/json' HEADER_X-Ephemeral-Token-Authorization: "{{ ravello_ci_token }}" body: name: "{{ ravello_ci_app_name }}" description: "App created by Travis CI" baseBlueprintId: "{{ ravello_ci_blueprint }}" body_format: json run_once: true changed_when: true

Page 28: Building Cloud Virtual Topologies with Ravello and Ansible

Travis CI

Page 29: Building Cloud Virtual Topologies with Ravello and Ansible

Ravello

Page 30: Building Cloud Virtual Topologies with Ravello and Ansible

Thank You

Page 31: Building Cloud Virtual Topologies with Ravello and Ansible

Community @ http://community.apstra.com/

● Universal ZTP Serverhttps://github.com/Apstra/aeon-ztps

● Python Library for AOS https://github.com/Apstra/aos-pyez

● Ansible Modules for AOS (in progress) http://docs.ansible.com/ansible/list_of_network_modules.html#aos

Page 32: Building Cloud Virtual Topologies with Ravello and Ansible

Useful Links● Ravello - https://www.ravellosystems.com/● Ansible - https://www.ansible.com/

● Ravello Roles for Ansible - https://github.com/Juniper/ravello-ansible● Demos project : https://github.com/dgarros/ravello-ansible-demo● Sample Project 2 - https://github.com/dgarros/rav-ipfabric-demo

● Download vQFX - http://www.juniper.net/us/en/dm/free-vqfx-trial/