Last week I spent a bit of time to better understand the different disk options that are available in Microsoft Virtual PC 2004. I was particularly interested in finding the best performance and the best option for having multiple environments that had subtle changes between them (OS and SQL Service Packs, and test app versions). Before I tell you my findings, let me point out a few simple facts about Virtual PC (from my experience):
- The “Fixed Disk” option is faster than a “Dynamic Disk“. Dynamic grows the file which is slow but Fixed doesn’t.
- Enabling the “Undo Disk” for any disk type will create a temporary Dynamic Disk that contains all the changes for that session. When you close the Virtual PC down you then have the option to merge the changes from your temporary disk back to the main Physical or Dynamic Disk. Undo disks are slow since the temporary disk is dynamic.
Remember these facts, its important going forward 🙂
The hope of Differencing Disks
In my little mission, I first looked into the details of what a “Differencing Disk” was. In summary a Differencing Disk gives you the option of having a 2nd Dynamic Disk attached to a main Physical or Dynamic Disk. This 2nd Dynamic Disk holds only the differences from the main disk. This is the ticket I needed to have multiple environments that had subtle changes between them. An image from the VPC help file shows the power of this, the Windows 2000 disk represents the main disk while the others are Differencing Disks with different IE browsers installed:
I found that the disadvantages of a Differencing Disk are:
- The Differencing Disk size can grow larger than the main disks size over time so you don’t really save space
- Differencing Disks are dynamic and can not be fixed, thus slower.
- Adding an Undo Disk to a Differencing Disk only adds to the slowness
Here is a step by step on how to create a Differencing Disk at Matt’s blog.
Making an Undo Disk into a Differencing Disk
After realizing the good and bad of Differencing Disk I found an article at Invertus.com that explained how to make an Undo Disk into a more efficient Differencing Disk. I tried this out and the file size stayed smaller but the VPC was still slow. Adding the Undo Disk only made slowness worse (about the same as a plain ol’ Differencing Disk).
Since Fixed Disks are fixed in size the pain of a dynamically resizing file is gone so this is the speediest option. The downfall to a Fixed Disk is that the VPC sizes are large, so if you have as many images as you saw in the picture above at about 10 GBs a piece then you can eat up drive space pretty quickly.
When needing multiple environments if you want speed use a Fixed Disk. If you are worried about disk space use Matt’s technique for making an Undo Disk into a Differencing Disk. If you want to keep an environment clean you can either use an Undo Disk and deal with the slowness or you can sacrifice disk space by instead keeping backup copies and copying over the dirty image when you are done with it (doubling your disk space usage).