Hyper-V Server 2008 (Core) using Pass Though Disks to enhance Disk Performance

I have been looking deeper into Hyper-V Disk performance after very noticeable performance degradation when some of our database servers were virtualised.

It turns out I had set up the virtual hard disks (VHDs) in possibly the worst combination of options! To create the Virtual Machines (VMs) I had installed Windows Server 2008 Enterprise onto 1 dynamic VHD. I then set this to read only and created differencing disks to have 4 different VMs all sharing the original VHD as the base. This worked great and was certainly quick to set up. However, for production machines the disks should really be set from Dynamic to Fixed. This is not an option with differencing disks. I had also taken some snapshots which additionally degrades VHD performance.

With the plan to start again from scratch I went to my test server. This has Windows Hyper-V Server 2008 on it (i.e. not the Full windows server 2008 just the free core version of Hyper-V). I read about using Pass-Through Disks (PTDs) for database servers as they offer the best performance. The is a great video on how to do this at http://blogs.technet.com/mattmcspirit/archive/2009/02/27/new-virtualboy-tv-video-hyper-v-and-pass-through-disks.aspx. In Hyper-V R2 the fixed disk VHD is meant to almost match PTDs but as I can’t get my hands on R2 that isn’t an option for me.

Setting up the offline disk using diskpartTo start off I need to recreate my RAID array on the Host machine. I created the following logical drives.

  • 1 x Raid 1 50GB
  • 3 x Raid 5 at 20GB
  • 3 x Raid 5 60GB

I installed Hyper-V 2008 onto the Raid 1 drive and then connected to it via Hyper-V manager on my laptop (using Remote Server Administration Tools – RSAT)

Unfortunately, the logical drives did not show up in the “Add VHD” section. I had a feeling this is because they weren’t “initialized”. Normally I would do this through the Disk Management Console but this isn’t included in Hyper-V and cannot be done remotely either. It turns out I  have to use DISKPART on the Hyper-V Server command line

  • Log on to the Hyper-V desktop using “Remote Desktop”
  • go to the Command prompt and type “DISKPART”image
  • Select the disk you want to initialize/set offline. These are numbered from 0 (the host drive). “SELECT DISK 1”
  • Check there are no partitions on the disk by typing “DETAIL DISK”
  • Set the disk offline by typing “OFFLINE DISK”
  • Type “EXIT” to leave DISKPART and close the Remote Desktop Session
  • Go to the VM settings in the Hyper-V manager and the disks now show up

I now need to install the OS to the VM and check the disk performance actually has improved!

Digg This


What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s