Topic: tech juniper jaut prev next

tech juniper jaut > Module 02: Junos Automation Fundamentals

Module 02: Junos Automation Fundamentals

The benefits of network automation and principles of DevOps and NRE.

Canary deployment: make the change on one or two devices and roll out across all requried devices after it has been executed successfully.

Moving from Troubleshooting to Testing

Carry out extensive pre-deployment testing to avoid problems such as configuration errors.

Detect and diagnose other problems automatically. Collect extensive telemetry and log data and run automated analysis. When an issue is detected, an automated root cause analysis can be run.

DevOps

CALMS - culture, automation, lean, measurement, sharing

Changes in functionality happen frequently to quickly move improvements into production. Changes are automated. Changes are easily rolled back if errors are detected.

Three Ways

Continuous Integration

Automating the building and testing of code.

Continuous Delivery/Deployment - Continuous Deployment automates the stage of deploying.

CD pipeline: commit, peer review, build, test, deploy, monitor

DevOps for Networking

Traditionally, Dev and Ops are not separated in networking. Configurations are edited directly on the devices’ command line.

Network Reliability Engineering

Focus on customer satisfaction and service availability. Relies on proactivee testing, not hope. Embrace failure, ensuring the same error does not happen twice. Establishes simplicity in operations and management. NRE’s solve complexity with a well-codified source of truth and automated responses.

The basic behaviours of NRE include:

Five Steps to Automated Network Operations

The journey to automated network operations, giving engineering reliability and simplicity. Most organisations start at step 1. Engineers typically do not advance through the stages because they are too busy firefighting.

  1. Manual ops
    • Codify the steps taken
    • Investigate the return on investment of automating them
  2. Automated workflows
    • Start automating small wins
  3. Automation, tests, and network as code
    • Test driven network development
  4. Continuous processes on a continuous pipeline
    • Small changes at any time thanks to CI-CD-CR
  5. Engineering outcomes
    • Error and toil budgets, outcomes with SLO’s and SLA’s

Junos and DevOps

Junos automation ultimately goes through mgd (management process) or jsd (JET service process).

mgd

Central to NETCONF (Python, PyEZ, XSLT, SLAX) automation. Also provides the CLI and the REST API.

NETCONF provides an XML API over the network. JUNOScript came first. A later version was ratified as the NETCONF standard.

The REST API uses HTTPS. REST is stateless because all information required to process the request is included in the request. The REST API is supported on MX, M, T, PTX and SRX series platforms (not EX/ACX?).

Junos UI Infrastructure

mgd, Schema, Configuration Database, CLI.

schema.db contains the definitions of the complete operational command and configuration hierarchies. schema.db is defined using DDL.

The mgd consults the schema whenever a configuration is parsed or exported, whenever a CLI user tab complete, when a configuration database is exported, when commands are executed in operational mode. The mgd validates syntax and executes commands by communicating with the appropriate Junos process. The CLI uses an ODL schema to convert XML into a human readable output.

Junos Configuration Commit Process

Interacting with the configuration is the same whether from the CLI or a remote session (NETCONF).

On boot, the configuration is loaded and checked by mgd. If successful, it is compiled to a binary file juniper.data, for fast lookups.

The candidate configuration is edited in a file called juniper.db. When committed, it is checked by mgd and pushed to juniper.data.

Junos DDL and ODL

The Junos schema is implemented using the DDL and ODL languages. This data model is how Junos is built for automation. The DDL enables the developers to add new operational mode commands and configuration options.

The DDL files are loaded at boot and become the schema. The only step for a command to be enabled for automation is to add its XML name to the DDL.

The ODL is similar to the DDL in syntax, but is used instead to inform the CLI on how the information should be displayed. The CLI uses the ODL to write the human readable text for the users to read.

NETCONF

Off-box automation. Libraries available for Ruby, Java, Python and Perl.

On-box Scripts

Scripts take XML input, process it, and send commands back to Junos. Programming languages available are XSLT, SLAX and Python.

Scripts can be triggered on commit, on the command line (op scripts), by an event, or by SNMP.

Junos and Automation Management Systems

Define the final state of the system, and the AMS puts the system into that state.

JSNAPy

Junos Snapshot Administrator in Python

Take a snapshot before an after making changes and evaluate the snapshots against test cases. Can also audit the environment against a predefined criteria.

JET

Juniper Extension Toolkit

Provides a modern interface for developers for JunosOS. It exposes the API’s of internal processes using a consistent look and feel, bypassing mgd. It allow for faster commits and better telemetry.

NITA

Network Implementation Testing Automation

Can be used for TDD. Libraries of real world test cases. Automated Lab Testing (ALT) - execute tests on preproduction environments to verify the impact of changes to the current configuration. AD - push out changes to many devices.

NITA is equipped with the testing framework used by Juniper to validate Junos.