Virtualization Technology News and Information
When Should You Create a Golden Virtual Machine Factory?

A Contributed Article by Kelsey Hightower, Head of IT Operations, Puppet Labs


Most virtual environments live off "golden images." These are virtual machines (VMs) that were built as templates. When a new VM is needed, the designer or administrator selects the golden image that will be used as a starting point, and then creates the new VM. Typically, these golden images are handcrafted, and incorporate all the libraries, tools, and software needed to support the apps and other software that will run on them. The golden image is refined by trial and error until it works as intended, then used until it comes time to change it. But let's face it not everyone needs the same thing on their VM. There are always variations. An old-school golden image basically assumes that one size fits all, but is that really true?

Wouldn't it be better if you could construct each VM based on what was going to run on it? Ok, maybe you're objecting that this isn't really a golden image, but hear me out. The problem with most golden images is that they are too complex and bound to change. What if you have a slim golden image and then add just what you need to it? You'd be creating a kind of golden image factory, where the repeatable baseline is easy to generate (the slim golden image) and additional software can be added quickly to that VM.

The Golden Image Quandary

Let's talk about what constitutes a golden image in the virtual environment. The golden image itself could be a virtual hard drive, with all the ingredients you need baked into it. Or, your golden image could be an automation tool that knows how to build that initial operating system.

A golden image could also be defined by a Kickstart profile, such as that used by Red Hat to build "bare metal" machines, or VMs from scratch. The Kickstart profile is meant for replication - it moves the same bytes across the wire every single time. 

But if you have no starting point in terms of a VM template, and you want to build the whole operating system from scratch, or build just the bare minimum, and add the rest through a configuration tool, you sometimes run into a wall. If you're in Amazon Web Services (AWS) EC2 or another public cloud, it can be difficult to stream all the necessary bytes required to spin up a new OS from scratch. You may end up waiting three or four minutes. Once that's done, you're going to have to automate all the questions that a normal operating system install would require, such as, "What time zone are you in? What's the default password?" and so on. If you try to perform this build every time, you will be pushing 1 GB or more through the wire, which is time-consuming, and can get expensive if you're renting the infrastructure you're using.

What we're witnessing here is a clash between the model set by the Windows world, and the new frontier of the cloud. In the Windows world, people built machines one-by-one then followed up using Norton Ghost to image it.  There was no automated installation process beyond the initial boot. The images were huge, because builders would have to install all the drivers and agree to any user licensing agreements to have a working machine. And they weren't done yet.

That golden machine would be turned off, and a complete image would be made of its hard drive, over and over again, because there was no automation. Many people have not moved away from that legacy process, even though Windows now offers some automated provisioning options.

For some legacy applications, there's no way out  - yet. But as you work more extensively with software that you can virtualize and that works in the cloud, you don't have to use these old-school processes. There is another way to build golden images.

How Golden Images Will Change

Golden images aren't going to go away. It's just that the usual configuration approach is not optimized for the world in which many developers and admins live - hosted in the cloud, with bandwidth constraints. Instead, golden images will change.

Now that configuration management tools are widely available, you don't need to bake all that much into a golden image. Instead, you can define a baseline. Let's say your baseline requires an OS kernel, a network driver and some security policies. These can all be baked into that golden image or template (if you're a VMware person), disk image (OpenStack) or AMI (Amazon). You can even make the baseline entirely OS-agnostic so that it captures your requirements (DHCP and these ports turned on or off) while allowing the OS install to be handled separately.

With a configuration management tool, you can create images and automatically place them in templates to be used later on, saving you several minutes each time you spin up a server. In our own backyard at Puppet Labs, our QA team sometimes creates 400 virtual machines in a day. If we had to rebuild those VMs from scratch, it would take four or five hours just to create the VMs. When we use a template golden image, we can launch 400 machines in a fraction of the time. The golden image doesn't need to go away. It just needs to slim down a little so that it can fit neatly in your configuration management tool.

The Yellow Brick Road to Golden Image Automation

So, if you accept the new golden image model, here's how you get to the other end of the rainbow.

The first stop on the yellow brick road is to automate the creation of a baseline golden image, instead of recreating the golden image each time and sending all the bits you need into the cloud. Recreating and sending will take too much time. Depending upon the scale of your intended virtual environment, you could be talking about hours of computing time every time you want to create a machine. 

We place a lot of value on handcrafted things - artisan cheeses, tailored suits, a 1930s roadster. But handcrafted VM golden images are considerably less charming. You want to automate the creation of that base golden image, then adapt that base to the purpose at hand - also through automation. If you need Java here or an antivirus shield there, you can add it without starting over.

Golden image automation through a configuration manager is really a case of the best of both worlds. You can get the bulk of your low-level functions instantiated automatically and then customize the VMs with the degree of flexibility you need. If you're not doing it today, start using a configuration management product to assist you in building thin, lean golden images. Then, put all the logic required to deploy applications into your configuration management tools.


About the Author

Kelsey Hightower, Head of IT Operations, Puppet Labs is an experienced IT operations and software engineering leader with extensive experience successfully managing development, operations and professional services projects.

Published Wednesday, April 10, 2013 7:12 AM by David Marshall
Filed under: ,
Instant Hyper-V Server Virtualization Starter - (Author's Link) - April 11, 2013 8:40 PM
To post a comment, you must be a registered user. Registration is free and easy! Sign up now!
<April 2013>