I’ve been hearing about Vagrant for well over a year now, but until this point I haven’t had a requirement to dig in. Vagrant seems to come up in the same conversations as configuration management tools like Puppet, Chef, Ansible, and so forth. Those are tools I’m also only vaguely familiar with. I created a few Puppet manifests a while back just to get the idea, but maybe Puppet should be the next series! But in the short term, we’ll use a bit of Puppet in this series to configure Vagrant boxes. At any rate, this series is going to walk through the concept and implications of Vagrant, the initial setup and use, and then branch out into some more interesting stuff. Let’s start at the beginning.
What is Vagrant?
Vagrant is a tool developed by HasiCorp (named after founder Mitchell Hashimoto) to facilitate the rapid and accurate deployment of development environments. Historically, there have been many hours spent on-boarding new employees, setting up contractors or consultants, and recreating production environments on development systems. The aim of Vagrant is to eliminate that overhead by automating the deployment of development systems, the configuration of which is stored in a version control system like Git. This ensures not only efficiency, but unity between team members and environments.
Vagrant is the configuration engine, but workloads are still provisioned in virtual machines or containers on the platforms you know and love like VirtualBox, VMware Fusion/Workstation, Docker, or AWS. There’s a growing list of providers, and if none of those fit the bill, you could also roll your own.
Why Would I Want Vagrant?
As mentioned, a few of the main benefits of leveraging Vagrant are the rapid provisioning time of new environments, as well as the ability to reproduce environments with 100% accuracy. That may mean mirroring the production environment to be sure development is taking place on a matching system, or it may mean ensuring that all developers on a team are using the exact same development environment as they create and test code. The granularity of dependencies in some systems can make manually replicating a development environment extremely challenging; but this is actually quite simple with Vagrant. And because Vagrant is doing the configuration, the system can be deployed on Windows, Mac, or Linux with exactly the same result.
Now, I’m the farthest thing from a developer, which begs the question: “Why do I care about Vagrant, and what use could it have for me?” Well, first and foremost, my job as an infrastructure architect is to design a platform that makes developers productive and helps them to deliver their product efficiently and with as few bugs as possible. Understanding how Vagrant can make them more efficient will help me design a better infrastructure for them. Secondly, however, there are certainly applications for infrastructure/operations folks. Imagine I’m creating a shell script to configure production systems in mass. It would take a matter of minutes to spin up a similar system local to my machine that I can test my script on as I create it.
How Do I Get Started?
Thankfully, since I’m so far behind, the installation of Vagrant is super easy at this point. The next post in this series will document the initial setup and instantiating my first Vagrant box. As a very brief preview of how complicated Vagrant is, the steps to get up and running follow.
- Install VirtualBox
- Install Vagrant
- Download and initialize a “box” (a Vagrant environment package)
- Run ‘vagrant up’
At the end of that whole 10-15 minute span, you’ll have a running machine configured exactly as specified and ready for consumption!
I think this is going to be a great learning experience, and I hope that by learning how to make the best use of Vagrant, I’ll also get a good head start on some other tools like Puppet/Chef. I also hope to wrap my head around the day-to-day life of a developer a bit better. As DevOps culture becomes increasingly popular, the infrastructure engineer / developer hybrid role is quite valuable. And I’m all about being valuable. 🙂