Over the last year I have been focused on everything DevOps. And in the last 3 months I have been doing nothing but network automation. Currently I am writing my first Python application and API to be used for the creation of F5 VIPs in my company. Look for more on this project soon.
In this post I will provide you with a road map of six skills, along with resources to help you become a Network Automation Engineer. Before we continue. Understand that writing Python scripts is a top-notch skill to have as a network engineer. But if your code is not modular, unit tested, with some type of version control then you are liable to do more harm than good to your network.
Now to our list:
This should be obvious. Basic networking knowledge is a must. Whether you are writing a python application to monitor network resources or to stand up a tenant in ACI. Take the time to build your fundamental understanding of your infrastructure and the technology you are attempting to automate. A good place to start is with the Network+ or the CCNA. These certifications will help you build the fundamental networking knowledge you will need.
2. Learn a Programming Language
The most common network automation programming language is Python! My suggestion is to start there and then you can explore Ruby and Go. One thing to note. Many of the automation tools are ran on Linux. So, if you are not familiar with Linux then that’s probably something you need to learn as well. Another thing to note is do not get trapped in the tutorial purgatory. This is where you watch 100 tutorials that all start with hello world before they move on to creating students in the Student class. My advice is to start on Cisco's Devnet. Here are 30 network automation modules on DevNet to help you get started from zero to automation hero. By the way, you can also focus on solving your own problems through automation. Remember that google, documentation and stackoverflow are your friend.
3. Learn How to Write Reusable Code
Now that you have learned a programming language the next skill you need to learn is how to write code that is readable and reusable. What does this mean? It means that, first you write your code in classes and functions so you can accomplish three things.
Not repeat yourself
Have the ability to call your methods from other from other files.
Break your code down into smaller functions that do one thing and one thing well.
This can be a real challenge. Especially the not repeating yourself part. What I learned to do is pseudo code. This is where you write out the problem first, then write out your solution step by step. This is all before you begin to code. This will give you a visual representation that you can use to write better code. Another thing to mention. Part of writing reusable code is creating clear and concise documentation. Remember to name your variables, functions and classes accurately and appropriately. Please do this for your future self. Nothing is worse than writing a ton of code then forgetting what your intent for the code was.
Here are two resources that I used to improve my understanding and ability to develop code like a Boss!
The Pragmatic Programmer: From Journeyman to Master which will give you a clear understanding of how to be a programmer.
Code Complete: A Practical Handbook of Software Construction this book will give you the blueprint to take your code to the next level. Thank me later.
4. Unit Tests
I use to despise writing unit tests for my code! Honestly, I still do! And don’t get me started on mocking. But truthfully learning to write unit tests with proper test cases has made me a better coder. If you know nothing about unit tests here are some resources that have I used. Remember your goal with unit testing is to test your code. Not rewrite your code over again.
Python Testing Cookbook - The reviews on this book weren't the best. But from what I found it was the most indepth on using unittest in python. And it worked as best as it could.
Mastering Python Networking - This by far is the best network automation book on the market. Very easy to follow, read and lab with. Not much on unit tests, but enough to get you started.
5. Version Control
We need version control whenever we are making and tracking changes to our code, scripts, documentation and basically everything. GIT is a superior version control tool. If you have heard of GitHub this is what it uses to track changes to a developer’s code. GitHub is a remote version control tool that gives you the ability to manually download, upload, and merge your code. But to really embrace network automation you must learn git through the command line. You don’t need Linux to get started. There is a bash shell that gets installed once you download it on Windows. Get started with git now, because there will be times that you make changes to your code either knowingly or unknowingly and you will wish that you had some sort of version control in place. Oh, and make you sure pay attention to the directories that you add to staging.
6. REST and APIs
Once you go through all of the steps we mentioned previously. It’s time that you expand your skill set into the realm of APIs and REST. APIs (application programming interface) provide a way for two software applications to communicate with each other. This is accomplished through http and REST (Representational state transfer) often using the CRUD method. Create, Request, Update and Delete through http. In a technology like ACI it’s architecture is designed in a object model that allows you to send requests to a url to perform a specific function. One function maybe to send a http get to retrieve all of the tenant information on an apic. Combining your python knowledge with APIs can be extremely powerful because the data that you are sending and receiving is structured and the api’s are mapped directly to the object you are attempting to access like a interface.
The road to becoming a Network Automation Engineer requires you to combine skills from multiple areas of tech to be efficient. Start with the basics of networking and computing. Then work in some python and eventually you will begin to feel comfortable expanding your knowledge to other areas like the cloud, containers, integration testing and the very long list of DevOps tools.
One last suggestion I have is to join meetups like DevOps Days and local Python groups in your area. Maybe even start a network automation meetup if there is not one. Joining these groups can help you fast track your knowledge because there are often people that have seen most of the issues that you will face.
Remember that this is a journey. One of the principles of the Third Way of Devops is continuous learning. Have fun!
Now that I have shared my tips. Let’s continue the discussion. Feel free to leave your thoughts and comments in the section below. We would love to hear them.