After last week’s post, “XenServer 5: First Impressions,” I thought back on my week-long experience with the product and came up with a question: Are templates really worth the trouble? After working with templates in VMware ESX and in XenServer 5, my gut feeling was no even after making the following statement in that article: “The template method is by far the most efficient in terms of speed and configuration consistency.” I had to check for myself.
Using the same system from my previous post, I decided to compare the creation of new operating system (OS) images from a downloaded ISO image, a bootable CD image burned from the downloaded ISO and from a template to see if there’s enough difference to justify the hassle and space used for storing templates or even ISO images.
Preparation and Standards
To start the process, I downloaded the debian-500-amd64-xfce+lxde-CD-1.iso from a Debian mirror site and burned it to a CD-R. For each new VM, my timer was set to 0 on my first click on the XenCenter menu item, VM->New and stopped when I successfully logged into the new system via the graphical login screen. The installation choices are all defaults except the virtual disk size which I changed from 5.0GB to 4.0GB and recommended memory from 256MB to 512MB. I chose the XFCE graphical interface for the master and all other images. The installed operating system footprint is 1.4GB.
Bootable CD Installation
This original installation (Master Image) from the bootable CD fulfilled my expectation that it would be the slowest of all the tests at 20 minutes. Part of the process that’s slow in this installation is answering all of the individual questions about keyboard type, language, disk layout, root password, creating a regular user account, installation type, and GRUB installation. It’s easy to see that this part of the process is worth a few valuable minutes on its own.
Once this installation completed and the VM rebooted, I shutdown the VM and converted it to a template. Converting an OS image to a template is an irreversible process.
Local ISO Installation
Installing an OS image from a local disk is impossible in XenCenterâ€”well, almost impossible, that is unless you trick the system a bit. I transferred the downloaded ISO image to the XenServer’s filesystem under /opt/xensource/packages/iso. I renamed the existing xs-tools.iso (Xen Tools for VMs) to xs-tools.iso.orig and renamed the Debian ISO to xs-tools.iso.
When I started the new VM wizard, I selected the ISO image radio button, and then chose xs-tools.iso from the dropdown list as shown in Figure 1. Installing from an ISO image involves the same steps as installing from a bootable CD. This process took 16 minutes. I think that the length of installation time is skewed because the same physical disk is used for accessing the ISO as installing the VM. If two different local disks were used, this time might be shortened by several minutes.
Figure 1: Local ISO Installation
Storage Repository ISO Installation
The standard method of installing a VM from an ISO image is by defining a Storage Repository where you store and access your ISO images. The standard locations for an ISO Library are either a Windows CIFS (Samba) or a Unix NFS share. See Figure 2.
Figure 1: Storage Repository ISO Installation
This VM installation took 15 minutes on a 10/100 switched network using a Windows CIFS share. Although the installation required the same steps as the bootable CD and the local ISO installations, I expected this one to be significantly slower than the local disk but the numbers didn’t support my hypothesis.
Finally, I installed a new VM from the template that I created from the master image. This template to VM “installation” took 6 minutes to complete or about one-third the time of any of the other methods.
I think my distorted perception of the time required to create a running OS came from interacting directly with the installation process versus letting the process run its course for a template-based install. Interacting with the installation seemed to take less time because I was involved in the action instead of sitting idly by and waiting for it to happen which brings to mind the wise words, “A watched pot never boils.”
This test might have confirmed what you already knew to be true: The template method is by far the most efficient in terms of speed and configuration consistency. But were you just taking someone’s word for it? Now you don’t have toâ€”you have physical proof.
Templates have a disk cost, ISOs take up space and CD/DVDs are inconvenient and prone to damage but the tradeoffs for templates are worth their cost. Create your “golden” images, convert them to templates and use them. And the next time someone attempts arguing for custom installations, simply respond, “Install shminstall, that’s too much fuss.”
Kenneth Hess is a Linux evangelist and freelance technical writer on a variety of open source topics including Linux, SQL, databases, and web services. Ken can be reached via his website at http://www.kenhess.com
. Practical Virtualization Solutions by Kenneth Hess and Amy Newman is available now.