Monday, June 11, 2007 at 5:04PM Virtual machine best practices
As I was getting ready to go to TechEd last week (I presented “BizTalk’s Role in a SOI”, my new favorite presentation, plus I helped staff the Microsoft BPM stand), I went through a process I usually try to go through every few months to optimize my VM. My VMs tend to be pretty heavyweight (ie: Win2K3, SQL2005, BizTalk, SharePoint, IBM MQ and WebSphere, etc….), so optimization is important to me, as I need to squeeze out every last bit of performance. It occurred to me that there are some virtual machine best practices that I have accumulated over the years, so I thought I’d do a blog post for the benefit of the community. This info will be self-evident to some, but to others, it will be new.
1. Which VM technology to use?
This is a technology leapfrog thing. Up until the release of Virtual PC 2007, I preferred VMWare as it was far superior to VPC. Now, with Virtual PC 2007’s improvements and support for hardware virtualization (which you may have to enable in the BIOS), the performance is close. I tend to use VMWare, as it has a great snapshot manager, plus performance is better when you have multiple virtual machines running simultaneously (as I sometimes need to do).
2. Drive speed
Remember that there will be a lot of disk IO, so the faster the drive the better. My laptop is my “office”, with all productivity tools and media on it. I have no dev tools on it. My VMs are on an external drive, I use a 7,200 RPM USB-powered drive. It gets me suspicious looks on airplanes when I stick the drive in the seat pouch and run a cable to it, but… perf is king!
3. Defrag, defrag, and then defrag
Defragmentation is something everyone should do often, as it will significantly improve performance. When VMs are being used, defragmentation need to be done on several levels. The order I do it in is:
4. Add-on tools 5. Snapshots (1) 6. Snapshots (2) 7. Multiple virtual drives
Both VMWare and VPC have optional “tools” that you install in the guest machine. It is important to do so. Installing tools will improve capabilities such as video (both performance and available resolutions) and mouse (can be “jerky” without this).
I’ve noticed this with VMWare, presumably the same is true of VPC, those snapshot files can be pretty big and take some time to create. However, if you shut down the guest OS before taking a snapshot, the snapshot file will be much smaller and creation will be faster
VMWare has the awesome capability of taking multiple snapshots. Be aware of how much space you’re consuming (see snapshots (1) above). The first time I noticed, my VM was up to 30 gig!
In my role as a consultant, sometimes I need to get snapshots of non-confidential client data. Sometimes these databases can be huge. In order to optimize backup and archiving of VMs, you can create a second virtual drive to host databases, and attach it to your VM.
General
Reader Comments