Network Automation – Just Start Somewhere

Blog Detail

For the people who consistently read our blog, this post will be a bit of a unique experience. Unlike a Network or Automation Engineer, who would provide technical guidance in our various blogs, I’m an Account Executive at Network to Code. As exciting as circuits and load balancer discussions can be, what I’ve found to be the most interesting part of my first year at Network to Code has been discovering the automation solutions companies use to overcome their obstacles.

What Is the First Step?

Many of our customers and prospective customers we’ve talked to come from diverse backgrounds and industries and have diverse infrastructures.
Even with that, there are a lot of commonalities in where they started and the triggers that led them to automate.

It can be challenging to pinpoint where to start, but hopefully this blog provides insight.

Automation is an interesting concept. Logically, it makes complete sense: let’s take this highly repeatable task that eats up X amount of time and allow some back-end processes to manage the work, freeing up X time for other tasks. Again, this is logical, but it can feel impractical.

For example, when we engage with a potential client, we commonly hear that there isn’t enough time in the day and that automation is the key to solving their problems. However, the issue remains that you need the time to automate, and if you don’t have enough time to complete your day-to-day tasks, how can you find the time to build the automation? This leads to a vicious cycle of needing more time but not having enough time to start automating. A famous Chinese proverb states, “The journey of a thousand miles begins with a single step.” We all understand the problem, but the real question is, “What is that first step?

Historical Context

Let’s all put our academia hats on for a second and talk history. In every period of human evolution, we see inventors and innovators partake in this automation concept to increase efficiencies and drive production to improve quality of life. We can go as far back as ancient Egypt, where daily life included:

  • Hiking down to the river
  • Avoiding the crocodiles
  • Lugging that heavy bucket of water back to your house or dwelling

Repeatedly, an entire society partook in this ritual until someone decided they had had enough. With that, the wheels of human ingenuity began working, and we ended up with water wheels automating the water collection efforts. They took a communal problem, some would say a highly repeatable task, and found a solution to save time/effort and, in turn, set a better standard of life for an entire culture. Bring that back to the modern day: what’s our water gathering task of the 21st century? This is where we need to start the conversation. What are we doing day in and day out that is crucial to our job responsibilities but can be streamlined and eliminate manual efforts through some alterations? Reflect on your daily responsibilities, find those tasks you’re doing every day, and you’ve found your proverbial water fetching.

Starting the Automation Journey in the Modern Day

We’re back in the modern day; our lives are filled with memes, coffee breaks, and too many Zoom meetings. Between all that noise, we have figured out what to automate, so what now?

First things first, don’t go crazy trying to move a mountain. Automation is a journey: it will not happen overnight. We had a saying back in college: “Poco a poco se va lejos”. English translation: “Little by little you go far.” That saying has never been more applicable than when talking about automation. Let’s take that large multi-step process, break it into bite-sized portions, and start getting some wins. If we can automate a 10-step process down to a 5-step process, we’ve already gained a 50% efficiency.

Let’s look at the data. If an engineering team of 5 can save 15 minutes a day each, over a week, they gain 6 ¼ hours back collectively. If we extrapolate that over an entire year, it’s 325 hours or 65 hours per team member. Fifteen minutes a day for 5 team members leads to a week and a half of extra time per year. What could your team accomplish with an additional week and a half? The possibilities are endless.

You’ve identified a task and written a couple of Python scripts to automate a workflow; that’s great! You may be asking yourself, “But how do I start to build a scalable automation platform?” Bryan Daddio is our VP of Sales and Marketing at Network to Code; he often states that data is paramount to building a scalable platform. Having good data funneling in will ultimately create good data funneling out. If you don’t have good data in, your automation platform will fail.

Perhaps the starting point you’re looking for starts with data, that is, working within the confines of a source of truth (SoT). A source of truth is a single aggregate data layer where the data describing the intended state of your network environment lives. An SoT will operate outside the limitations of tooling functions and vendors to give you one centralized location to be used as a framework to build automation. No matter your direction, the SoT will be the heart of any automation platform, and a great way to grow those Python scripts to full automation and eventually orchestration. This is potentially the perfect starting point.


Conclusion

A couple of takeaways from the topic today:

  • Regardless of your infrastructure, vertical, or company size, automation is an opportunity for your organization; I can guarantee it.
  • Identify a process that would benefit from automation.
  • Don’t try to take on too much at once – you can move a building if you do it brick by brick.
  • An SoT is always a great place to start – it’s essential to an automation platform.

If you have any questions on this topic or automation in general, we’re here to help. We live and breathe network automation here at Network to Code and would love to connect and talk about your journey, no matter where it currently is.

Thanks for taking the time to read this blog post. I hope you all have a momentous day!

-Dwight Mohry



ntc img
ntc img

Contact Us to Learn More

Share details about yourself & someone from our team will reach out to you ASAP!

Integrated Version Control in Nautobot

Blog Detail

In the past few months, many of us here at Network to Code have been investing a lot of time with Nautobot Version Control. The ultimate goal with adding version control to Nautobot is to make network automation safer by bringing proven Git– and GitHub-like workflows directly to Nautobot.

Along the way, we’ve created a lot of content in order to showcase how the version control capability can benefit Nautobot users and those looking for safer ways to manage data. This week’s post serves as an aggregation for all the Version Control related content to date.

Below, organized by content type, are hyperlinks to each piece of content that has been produced over the past few months.

Code and Documentation

Blogs

  • Database Version Control with Nautobot
    • This blog discusses the value that Version Control brings with its Git-like workflows and how those workflows fit into existing Nautobot capabilities to keep network automation data clean.
  • Nautobots, Roll Back!
    • This post discusses the business and operational value in allowing users to review changes to SoT data prior to pushing them to production, and then to quickly undo that set of changes if needed.
  • Keeping Data Clean with Nautobot Config Contexts, Schemas, and Git
    • This post is not Version Control related explicitly, but it does discuss Nautobot features you can leverage that complement the Version Control workflows.
    • These features, especially when paired with Nautobot Version Control app workflows, provide a layered, defense in depth to keep your automation data clean.

Videos

  • YouTube Version Control playlist
    • Intro Series: This series of videos introduces the user to the Version Control with Nautobot, its use cases, and how to use the app.
      • Unit 1: Defining the problem at hand
      • Unit 2: Bringing version control to Nautobot’s database
      • Unit 3: Navigating the top-level Version Control menu
      • Unit 4: Managing pull requests with Version Control
    • Demo Series: This series of videos provides demonstrations of how to set up a demo instance of Version Control with Nautobot, workflows enabled by it, and how to interact with Version Control programmatically.
      • Unit 1: Setting up a demo environment
      • Unit 2: Version Control enabled workflow demo
      • Unit 3: Version Control: Jenkins CI pipeline added
      • Unit 4: Using the Version Control API

Conclusion

In the coming months we hope to have more engagement to get feedback users and to further showcase the business and operational benefits a version-controlled Nautobot environment provides.

Thank you! Have a great day, and have a great New Year!

-Tim Fiola

Developer Advocate



ntc img
ntc img

Contact Us to Learn More

Share details about yourself & someone from our team will reach out to you ASAP!

Database Version Control with Nautobot

Blog Detail

Our Nautobots, Rollback! post in late August introduced the community to Dolt databases and the workflow Dolt databases enable in Nautobot. Dolt is enabled in Nautobot via the Version Control app. This post will discuss the value that the Version Control app brings with its Git-like workflows and how those workflows fit into existing Nautobot capabilities to keep network automation data clean.

Data Hygiene

In a network automation context, clean data is correct (error-free) and properly formatted to be usable by the automation.

A process to achieve and maintain clean network automation data would have these general steps:

  • Have more than one set of eyes on the data and/or checks and balances prior to adding/removing/changing data
  • Get data into a consistent structure/format
  • Ensure the ability to remove bad data

As a practical matter, no single magic bullet exists to perform all these steps: clean data requires a multi-tiered approach. The Version Control app adds value because it enables Git-like workflows for changes to production data.

Version Control Workflows Enable Better Data Hygiene

Nautobot running a Dolt database brings Git-like workflows to Nautobot, allowing a more collaborative process to get changes to network automation data into production. This collaborative process includes explicit checkpoints for review, discussion, and approval of changes to production data.

The Nautobots, Rollback! post introduced the comparison below, contrasting a Dolt-enabled Git-like workflow for database changes to a non-Git-like workflow.

DoltNon-Dolt (PostgreSQL/MySQL)
Create new branch from Master———–
Switch to new branch———–
Make changes to dataMake changes to data (changes are immediately active)
Submit a pull request for review———–
Review changes———–
Refine changes based on PR feedback———–
Deploy changes deliberately (Merge)———–
Assess changes to production environmentAssess changes to production environment
If there are problems, immediately roll back to last good stateIf there are problems, undo the changes manually or via external automation

Version Control’s Dolt database brings capabilities and workflows that were previously not available in database-backed solutions.

There are two main benefits provided by the Dolt-enabled workflow:

  1. It creates an explicit checkpoint for data review prior to merging changes to the production data.
  2. If there are problems with new production data, a user can quickly and easily roll back parts of the merge, or do a wholesale rollback of the entire merge.

The Git-like workflow results in cleaner production data and allows for troublesome data merges to quickly be undone.

pr-conversation

Both the conversations around and reviews of pull requests help ensure clean data enters production.

revert-page

Being able to quickly and easily revert data changes in part or wholesale reduces the time required to fix mistakes.

Programmatic Access

As is true with any automation-centric platform, the Version Control app has extensive REST API capabilities.

Branch-Specific Data

The Version Control app allows multiple branches to exist, and it will often be necessary to programmatically query a given branch for information. This app allows programmatic REST queries for data in specific branches via the dolt-branch keyword in the header.

Here is some simple example code that queries the cdg-edge-augment branch for all devices with an edge role in the cdg site:

import requests

from pprint import pprint

url = "https://internal-dolt-server/api/dcim/devices/?site=cdg&role=edge"

payload={}
headers = {
  'Authorization': 'Token nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn',
  'dolt-branch': 'cdg-edge-augment'
}

response = requests.request("GET", url, headers=headers, data=payload)

pprint(response.json())

Here are the results (heavily edited for readability!):

{'count': 3,
 'next': None,
 'previous': None,
 'results': [{
          ---<snip>---
              'display': 'cdg-edge-01',
          ---<snip>---
              },
             {
          ---<snip>---
              'display': 'cdg-edge-02',
          ---<snip>---
              },
             {
          ---<snip>---
              'display': 'cdg-edge-03',
          ---<snip>---
              }

Here are the results of the same script, but with the 'dolt-branch': 'cdg-edge-augment' header info removed:

{'count': 2,
 'next': None,
 'previous': None,
 'results': [{'asset_tag': None,
          ---<snip>---
              'display': 'cdg-edge-01',
          ---<snip>---
              'virtual_chassis': None},
             {'asset_tag': None,
          ---<snip>---
              'display': 'cdg-edge-02',
          ---<snip>---
              'virtual_chassis': None}]}

The cdg-edge-augment branch has an additional device (cdg-edge-03) that the main branch does not.

Version Control-specific API Endpoints

The Version Control app also has specific API endpoints for querying the following:

  • Branches
  • Commits
  • Pull Requests
  • Pull Request Comments
Version Control-specific API Endpoints

Test Drive the Version Control App Youself!

This app is still very much in the development phase and is not officially supported (as of the writing of this blog), but you can still test-drive the current functionality in a dev/test environment. The public repo is available on GitHub. There, you will find instructions for setting up the dev/test environment.


Conclusion

Keeping network automation data clean is important because it affects how well the automation can implement desired network state. Nautobot’s innovative Version Control app provides another layer of data protection to Nautobot’s existing data-protection measures to keep your network automation data clean.

Thank you, and have an awesome day!

-Tim



ntc img
ntc img

Contact Us to Learn More

Share details about yourself & someone from our team will reach out to you ASAP!