Vagrant

  1. What is Vagrant?
  2. What are the main features?
  3. Why do they build it?
  4. How would it benefit me?
  5. Where does this fit into the stack?

What is Vagrant?

Vagrant is a configuration management tool for creating, configuring, and managing complete development environments in virtual machine.

What are the main features?

Development environment version control

Configuration for setting up development environment is in code (Vagrantfile), so the development environment can be version controlled.

Consistent but distributed development environments

Consistent development environment, build one development environment, and distribute to the rest of the team. Create identical development environment for everyone on the team.

Distributed development environment, but linked by source control. “I like to think of Vagrant as the Git of development clouds. Centralized development and test environments create bottlenecks. Vagrant lets developers work at their own pace and in their own environment, while keeping all the environment synchronized with each other.” (By Jeff Sussna) [1].

Disposable computing resource

“Vagrant lowers development environment setup time, increases development/production parity, and brings the idea of disposable compute resources down to the desktop.” [1]

“At the end of the day, Vagrant can suspend, halt, or destroy the development environment, keeping the overall system clean. Never again can developers forget to shut down a stray server process and waste precious compute resources.” [1]

Simple development environment setup

Forget about README or INSTALL instructions, type vagrant up and you are good to go.

“Say goodbye to ‘works on my machine’ bugs.” [2] For designers, “no more bothering other developers to help you fix your environment so you can test designs. Just check out the code, vagrant up, and start designing.” [2]

Development environment sharing

Create new Vagrant boxes (development environments), share with others or use existing boxes.

Cross platforms (Windows, Mac, Linux)

Vagrant works in all major operating systems: Windows, Mac and Linux.

Why do they build it?

Do not repeat yourself! “In early 2010, I (Mitchell) worked for a web development consultancy and was frustrated by having to repeatedly set up development environments manually for various projects.” [1]

“Prior to Vagrant, the preferred method of working on a web application was to install and configure all the software you needed (e.g., Apache, MySQL, RabbitMQ, etc.) locally on your development machine.” [1]

“Everything must be installed manually, by a human.” [1]

“Configuration is even more difficult than installation. Once the software is installed, it has to be configured. Developers are unlikely to know how to configure it to best resemble production.” [1]

“It’s difficult to keep development environments in sync with other team members, or to bring a new team member on board.” [1]

How would it benefit me?

Normalize the development process in a team of developers, and lower development environment setup time.

“Instead of spending the first two days on the job installing software, a new development team member can spin up a production identical environment on their laptop simply by typing vagrant init then vagrant up.” (By Jeff Sussna) [1]

No more fiddling with VirtualBox GUI to create, configure, start and stop virtual machines.

Where does this fit into the stack?

Development workflow, to achieve consistent development environment.

References

  1. Mitchell Hashimoto, Vagrant: Up and Running, O’reilly
  2. Vagrant Docs