I frequently see many network engineers and other IT professionals wanting to get into automation, but having no idea where to begin. The same few questions are asked by people just getting started: What can I automate? Where do I get started? What are some good resources to learn with? When looking at existing automation others have written, it can be amazing to see, yet seem dauntingly complex.
This will be the first in a multi-part, non-technical series intended to help newcomers to the automation scene get started. In this blog post, I intend to answer all of the above questions and give those getting into automation for the first time some good resources to get started with.
Getting started with automation has never been easier. The amount of open-source tools available, along with the vast array of knowledge and documentation, make it a great time to get into automation. However, with the vast amount of choices available, it can become overwhelming very quickly.
I encourage those of you who want to automate something to start small. Don’t look at an overly complex problem and try to solve it all at once. Start with writing a basic script for one quick, easy and very simple task. Then move up from there, building on what you already wrote and expanding its capabilities as you learn.
A Network Engineer is skilled in building and operating networks, traditionally through a CLI, though UI’s are becoming more common.
A Software Developer is skilled in developing solutions programmatically by writing code in various programming languages.
A Network Automation Engineer is a hybrid of a traditional network engineer with a software developer. Someone in this role benefits from a fundamental networking knowledge to know how the network works, while being able to write automation in software to perform the necessary tasks.
Everyone’s journey into scripting and automation starts differently. Mine started about 8 years ago with a very basic Python script. At the time, I was configuring new switches and routers multiple times a week for various remote locations. The configuration settings for each device were created based off of a text file template.
For example, when generating a config for a new site “Dallas01”, I would find/replace all instances of “$HOSTNAME” with “Dallas01” in the text file. I would do the same thing for IP addresses, usernames, SNMP strings, interfaces, etc. Because this was all done manually, typos and overlooking settings happened frequently.
You can probably see where I’m going with this.
I started by writing a small script to automatically create the running configuration file for the router based on a few settings. From there, I expanded it to apply the config, support different templates, and added some validation. What started as a 30-60 minute process was reduced down to less than a minute.
What’s more, I was able to share it with other engineers. Not only did they also save time each week, but we also knew our configuration settings would be identical without typos or missing settings.
In light of my above story, think about your current environment. Your first automation does not have to be fully redundant. It does not have to be executed automatically, cover all scenarios, or include any testing and validation.
Disclaimer: While some places use Excel for storing information about the network (as in my example), a much better approach is to use a dedicated Source of Truth tool with a database, such as Nautobot with PostgreSQL. Some previous blog posts that may be helpful can be found here and here.
Bonus: This can be a great way to demonstrate ROI to management and your peers, highlighting the benefits of automation.
There are a lot more steps here than you would ever need to tell someone face to face! When I started configuring devices, I was taught this template process by my peers with a few simple steps.
"You find the necessary settings in this Excel file. Copy them into the template, then console into the device, paste in the template, and save the config."
When broken down, we can start to see it in smaller, more manageable chunks.
Sometimes I need to break a step down even further. For example, the step about looking up info in Excel can be broken down like this:
Which can be broken down even further:
From here, I start thinking how I can write up each individual step in Python, then write them out one piece at a time.
The world of network automation is amazing! However, it requires a bit of a shift in the way a traditional Network Engineer thinks about problems and how they solve them.
For example, as a Network Engineer making a vlan change on an access switch port, depending on how complex the change is and the change control process, I would normally:
As a Network Automation Engineer, I would see this process in automation a bit differently:
This can be automated even further, but it gives a good idea of how even a process as simple as an interface vlan change would look to a Network Engineer vs a Network Automation Engineer.
Looking further out, think about what the above automation accomplished once the foundation of your automation is established.
The foundation used in the above example can be easily built on to add additional automation tasks to the network with significantly less time to set up.
The world of network automation has grown at an immensely fast pace, and there are so many tools out there to use. Here are a few technologies to get started with learning. As you grow your automation, you’ll find many more tools out there for various tasks. However, these will help build your foundation for those other tools later on.
When getting started, I recommend beginning to learn a few common tools, then expanding from there.
Training – Network to Code also offers various training courses for getting into network automation. If your company provides a training budget, these classes are excellent and highly recommended.
Blog – In addition to this article, we have many articles written over the past few years on a wide range of topics that can help you get going.
Slack – Network to Code has a very popular public Slack workspace with over 18,000 users at the time of this writing. Join us at https://slack.networktocode.com/, and feel free to participate in discussions and ask for advice. There are many great resources there from all over the world.
Part 1 – Rethink How You Think
Thanks for reading, and happy automating!
-Matt
Share details about yourself & someone from our team will reach out to you ASAP!