1. Utilizing Vagrant in a Continuous
Integration Test Environment
Marc Bejerano
<marc.bejerano@ticketmaster.com>
2. What is Vagrant?
Vagrant is a virtual machine management utility that
allows for the scripting and distribution of pre-built (or
imaged) operating system VM’s called “boxes”.
• Ease of Management
• Simple Distribution Model
• Easily Scriptable
• Works with any x86-based OS
• Runs on Windows, Mac OS X, and Linux
3. Aren’t there better ways?
• Shell scripts
• Chef
• Puppet
• Custom management code deployed via SSH
• Ansible
• VMWare ESXi
• Probably many more…
4. Ease of management
• You can create a Vagrant box as an initial
system image of a working server (or client)
• Via the default SSH forwarding, it is trivial to
send commands to a VM
• Shared folders can be easily configured
• Any of the VM settings can be initialized or
altered through the configuration file
(Vagrantfile)
5. Simple Distribution Model
• A Vagrant “box” can be deployed locally or
remotely.
• Remote deployments can manage versions
and be upgraded on an as-needed basis
• Central repository of system images (boxes)
make for quick deployment of new virtual
machines
6. Easily Scriptable
• Initial configuration can be scripted
• Provisioning can be scripted from within the
Vagrantfile or via an external script
• Vagrant maintains a standard method of
communications with the VM through a port-
forwarded SSH connection
• The Vagrantfile (and the vagrant system) is
written in ruby (is this a selling point?)
7. Works with any x86-based OS
• Can build a Linux VM on Windows
• Can publish the Vagrant box to a Linux server
• Can deploy this box from the remote server to
a Mac OS X server or workstation
• Any combination of the above will also work
• Works with VMWare and Virtualbox
8. Multi-Platform Support
• Can deploy a Vagrant box that was created on
Windows to a machine running Mac OS X
• Unlike docker, can work with ANY virtual
machine (even non-x86 VM’s)
• Will happily run on any of its supported
platforms
9. How does Vagrant help me do CI?
• Virtual Machines can be built “on-the-fly”
• Standard “baseline” configurations of entire
operating systems can be deployed into a test
environment
• Multiple versions of the same VM can be
created and all can be configured to
communicate with the others to test failover,
clustering, etc.
10. Examples
• Ticketmaster developer workstations
– Mirror of current development server
– Automatic synchronization of shared resources
– Ability to modify environment without concern for
the actual development server
• Skytouch
– SOLR
– ZooKeeper
– memcached