At Microsoft Tech-Ed 2009 in Berlin long-time Windows server expert Mark Minasi gave a session on the .vhd format used by Microsoft for virtual hard drives in Hyper-V, the virtualisation feature built into Windows server 2008.
Minasi's talk was not about Hyper-V, but rather about other things you can do with a .VHD. He even noted that in a Windows environment you can use a .VHD as a superior form of ZIP (though without the compression), if you want a single file that can contain windows files and folders while preserving NTFS security attributes, and that can be mounted - or "attached" in .VHD jargon - rather than having to be extracted elsewhere.
One neat trick is to use .VHDs for multi-boot. Multi-boot is less important now that virtualisation works so well, but can still be useful if want to test an operating system with full performance and access to hardware such as accelerated graphics. The old way to do this is with multiple partitions, but this is somewhat inconvenient. Windows 7 is able to boot from a .VHD, and you can set up mutiple VHDs so that you can choose which one to use at start-up. There are a couple of limitations. The operating system has to be Windows 7 or presumably 2008 R2 (which uses the same kernel); and sleep/hibernate does not work in this configuration.
A VHD is still just a file, so you can back it up by copying it elsewhere, provided it is not the one currently running. Note that in this configuration only the hard drive is virtual, not the computer hardware, so while you could go on to mount the VHD in Hyper-V it would be like moving Windows to a new motherboard and very likely would not boot.
Another clever tip is that Windows 7 setup support a keystroke combination, Shift F10, which gives access to the command line for MinWin, the cut-down version of Windows that runs during setup. Here you can get access to Diskpart, the command-line disk management tool, which among other things lets you create a VHD. So you can take a machine with an untouched hard drive, boot into the Windows 7 setup, shell to the command line and create a VHD, then attach and install Windows onto that new virtual drive. Setup actually states that this does not work; but it does work, and we saw it demonstrated.
There are three kinds of VHDs. A fixed VHD has the same on-disk size as its capacity. An expanding (or dynamic) VHD reports the size that you specify when it is greated, but only occupies the space on its host that is needed by the data written there. This is convenient for backup, and lets you over-commit the host drive if you choose to. The third kind is a differencing VHD - a VHD that is based on a parent and only occupies the space needed by its difference as you write to it. The GUI Windows disk management tool does not support creation of differencing VHDs: one of Minasi's points is that you should learn the command line approach using Diskpart in order to get access to all the available features. That said, differencing VHDs are supported in the Hyper-V GUI management tool.
The bottom line is that VHDs have uses that go beyond virtual machines and if you work on the Windows platform it is well worth becoming familiar with them.
Hyper-V may not be the best virtualization platform out there, but it does not have to be. Its unique selling point is deep integration with Windows Server 2008, complete with an easy to use management console. I've been using it extensively, though on modest hardware, and overall I'm impressed. Enable the hypervisor in the BIOS, install the Hyper-V role, create a new virtual machine, and go. I've used both Server 2008 and Windows 2003 as guest operating systems, and everything works as advertised. You can assign an .iso image to the virtual DVD drive, which is handy for me as an MSDN subscriber, since I test new Microsoft software by downloading it from there. A great feature is that you can backup both host and guests in one shot, even when the machines are running. Provided that the Hyper-V integration services are installed in the guests, the host backup will talk to the Volume Shadow Copy Service (VSS) in the guests to ensure the integrity of the backup.
Hyper-V is handy for Windows developers since you can run servers like SharePoint and Exchange without the clutter and expense of real boxes. Once the new machine is up and running, I generally connect through remote desktop on another machine, and it looks just like any other remote Windows server.
That said, there are a few snags with Hyper-V. While performance is generally good, I've found that disk I/O can get slow. There are a couple of things you can do to mitigate this. One is to be generous with RAM - more memory means less disk access. Second, Microsoft states that a fixed virtual hard drive is faster (though less convenient) than a dynamic virtual drive, which is the default. It is possible to convert from one to the other, though it is a slow operation.
Another issue is that because of the VSS integration, you should not attempt to back up simultaneously from the guest and from the host. It would be easy to do this by accident through scheduled backups, as Microsoft also recommends that you should do both kinds of backup for critical servers.
Using the supplied Windows Server Backup in a Hyper-V guest is awkward, since drives attached through USB or eSATA are not recognized automatically in the guest. You can backup to a network share or a second mounted virtual hard drive. I've heard that this problem is fixed in Hyper-V R2, which you can currently download as a beta.
The subject of Hyper-V and domain controllers is rather complex. Sandy Berkouwer has two separate posts which are helpful. Actions like pausing or saving state in a domain controller can cause problems, and Berkower suggests that having at least one physical domain controller is wise. Microsoft warns against having the host machine joined to a domain managed solely by a guest.
Another issue is that if you are unlucky, and are using snapshots (giving the ability to roll back to a previous time), Hyper-V can occasionally revert to an earlier time without being asked. If this happens, shut the machine down right away and see if you can recover it, as I did, by restoring a backup and doing a manual merge with the snapshot differencing file.
Microsoft appears to be handling the Linux integration services with all the enthusiasm you would expect. You can find the services here - though you have to sign in with a Live ID. Only Suse Linux Enterprise Server is supported, and the site forum, which is noticably lacking official Microsoft participation, includes telling comments. Why does the code have build dependencies on Xen (an open source alternative to Hyper-V), and only works with version 2.6.18 of the Linux kernel? However, note this comment from a user:
For anyone not aware, doing even light disk IO under a hyper-v linux guest without linux_ic will chew on your cpu the entire time, which makes it very unusable for any server that's not mostly idle.
The good news on the Linux front is that Microsoft has just announced an agreement with Red Hat to support Red Hat Enterprise Linux 5.2 and 5.3 - 32-bit and 64-bit, but apparently uniprocessor only - complete with integration services; we have to hope this works out better than the Suse partnership has, so far. It deserves some effort from Microsoft, since running a LAMP stack on a Windows Server machine via Hyper-V is useful.
Despite some hassles, Hyper-V is invaluable, and there is now little excuse for wasting power and space on numerous lightly-used servers. Virtual servers have many advantages, in cost, in ease of management, in flexibility, and in backup and restore. My guess is that they will become the norm for test as well as for production, hosted either locally or in the cloud.