The Year of the VM
VMs in the New Job
I started a new job in early November of 2005. The first thing I noticed when I started the new job was that all of the programmers and QA testers were constantly talking about their VMs (virtual machines). Each developer has a physical test machine (in addition to their desktop / laptop) located in a lab. This machine typically runs something like Debian and then uses either VMware or Xen to run a virtual machine, usually with a different operating system. The developers then use the VM to install different versions of the product.
This completely isolates the install / test environment from the dev environment. While this setup is not particularly useful for testing performance, it is amazingly useful for managing different configurations and versions of the product on which you're working. For example, let's say you're working on version 1.1 of the product and testing the upgrade scripts from version 1.0. You set up a VM with version 1.0 of the product. Since the VM itself is merely a set of files you can then keep a baseline copy of this configuration in another location. You run your install scripts on the VM and if there are any problems you can simply stop the VM, copy some files, and be back to your uncontaminated 1.0 install–ready to test the scripts again after you fix the problem. The same applies for testing the installer for the product (and the uninstaller I suppose).
Dog Food Buffet
You can also keep copies of Windows 2000, Windows XP Pro, Windows 2003 Server, and different distros of Linux around for testing without dedicating an entire machine to each OS / product configuration combination. Using a VM to dedicate a machine to a product install also means it's easier for people to eat their own dog food as Cote' is fond of saying. The IT department of my new company also uses VMs to run the Subversion server, the CruiseControl server, a maven proxy, and any number of other services. The VM has its own IP address so you can pick up and move the entire "machine" any time you want to re-arrange things.
Making it Happen
This VM-based approach has a lot of potential. It's what motivated one of my new co-workers to only half jokingly name 2006 the "year of the VM." Are there problems with this approach? Of course–there are always trade offs. Performance under a VM can suffer. There can be subtle differences between a VM install and a physical machine install that are extremely difficult to track down. I think the increase in flexibility makes it very much worth it to work a VM-based solution into your IT environment.
Assuming your organization isn't on board with this setup, you may still be able to sneak in some limited VM action into your workflow. To start with, VMware's VMware Player is currently free. You usually need a copy of VMware Workstation to create new VMs (although a number of pre-built VMs are available). However, you can find quite a few hacks on the internet that allow you to create VMware VMs for free. The virtualization.info blog provides a good starting point for locating these tools. Then all you need to do is get a copy of the target OS (usually not a problem in a large organization) and create a new VM. Ideally, you can run this VM on some dedicated physical machine (again, most developers in a normal IT organization have a test machine of some sort), but in a pinch you can run it on your main machine–you'll just feel the pain of poor performance.
Now that you're set up you can do things like create a copy of this VM for each major version of your product. Whenever you need to see how something worked in another version, you just fire up a VM and check it out. Or, if you're working on an upgrade path between versions, you can do the baseline copy of the pre-upgrade install like I mentioned earlier. If it works out well for you, start spreading the word to other developers and trading VMs (or setting up a central repository for more useful configurations). Soon enough it gets enough momentum to become an official part of the process.
January 29th, 2006 at 5:16 pm
Yeah, we're migrating the wiki at your former job to a VM as well as using VMs for easy upgrade testing. It's nice to be able to easily roll back to the state of the (virtual) system at last boot.
January 29th, 2006 at 7:06 pm
That's great news. I'm still learning about how using VMs changes my normal development activities. I'm supposed to get my test machine next week so I should be able to use the VM to launch the VPN client to get on your network. Up to this point it has been a pain having to hop on and off the VPN to do different activities. I also haven't been able to leave the BPM running around the clock. Hopefully that will change.
February 17th, 2006 at 1:18 pm
[...] At work, I have a separate test machine I use to deploy the software on which I'm working. The demands the container(s) and framework make on the host machine are borderline too high to run on my laptop comfortably so the test machine is a very good solution. As I mentioned before we use a lot of virtual machines here. My test server is running Debian but the environment I'm deploying to is actually a VM running Windows via an instance of VMware Player. I run the player by ssh'ing to the test machine and then do some X11 port forwarding to my local Cygwin X server just so I can futz around with the instance of Windows if need be… [...]