March 14, 2019

Using Vagrant

—A look at a lesson learned using Vagrant.

I’ve been working with Vagrant for some time.

The value proposition of Vagrant and Packer is that virtual machine builds become consistently reproducible–all of the configuration information is scripted and placed under revision control.

The value of automating virtual machine creation can’t be understated.

My goals for Vagrant involved the creation of a virtual machine cluster that involved two components:

• developer virtual machines (on individual workstations)
• production virtual machines (in a virtual machine cluster)

The developer tool chain would be present on the first and a production image would be exported from the second. Configuration would be shared between the two.

Importantly, our production environment isn’t in the Cloud or a virtual machine cluster. It’s an industrial device. Our device configuration requires the use of specific Ethernet ports, including eth0.

Lesson 1: Vagrant’s reliance reserving eth0 for use by Vagrant turned out to be really difficult to work around in our environment. It became a non-starter for recreating our production environment using a Vagrant generated virtual machine.

Lesson 2: Exporting ISO images from virtual machines is really, really hard. I was able to get it to work through a magic incantation involving mkiofs but it wasn’t trivial to set up. If you aren’t experienced with mkiosfs I’d say you are in for a voyage of discovery.

Lesson 3: The turn around time debugging the configuration is high. I suspect this is why people seem to create their virtual machines interactively then use Vagrant. I wanted to use Packer because it better supported the cradle-to-release of the virtual machine configuration. Unfortunately, builds can take a long time.

In all, I didn’t realize my original goals for Vagrant and Packer. My conclusion is that its an ideal tool for creating virtual machines to deployed in a virtual machine cluster and the Cloud but their are challenges in using it to create images deployed in industrial devices.

Still, not achieving my goals doesn’t diminish my enthusiasm for Vagrant and Packer. I was trying to stretch the use cases for these tools and may have been naive in trying to do so.

I am and do successfully use it to manage virtual machines for constructing test and development environments where those environments remain virtual machines.

comments powered by Disqus