15

Using Hyper-V, what are the pros/cons of using the "Physical Hard Disk" option when adding a drive to a VM as opposed to just creating a fixed-size VHD that is as large as the disk?

The intention is for this disk to be allocated to a single VM so there isn't any requirement to have anything else using it.

David Gardiner
  • 503
  • 1
  • 5
  • 12
  • Thanks for everyone's comments - I feel more informed now. In this particular case the VM is running Windows Home Server, so portability isn't such a high requirement, but I appreciate it is something to consider generally. -dave – David Gardiner Mar 02 '10 at 23:50
  • 2
    There's also a new whitepaper from MS - http://download.microsoft.com/download/0/7/7/0778C0BB-5281-4390-92CD-EC138A18F2F9/WS08_R2_VHD_Performance_WhitePaper.docx - Virtual Hard Disk Performance – David Gardiner Mar 03 '10 at 03:32

4 Answers4

7

I use VMs because they are portable. When you attach a physical disk, you lose most of the portability. It is much easier to copy a VHD file to another host than it is to move the physical disk between them.

Skyhawk
  • 14,149
  • 3
  • 52
  • 95
BLAKE
  • 706
  • 9
  • 25
2

The thing you have to think about is portability versus speed. It is largely accepted that giving a VM a real raw disk to work with is the largest performance gain you can make. When a VM runs in a file, it has an operating system thinking it's writing to a file, which in turn is asking an external operating system to write to a disk.

Disk write performance is probably the largest problem a VM can have.

More information: Coding Horror: The Single Most Important VM Performance Tip

Skyhawk
  • 14,149
  • 3
  • 52
  • 95
Stewart Robinson
  • 1,145
  • 4
  • 12
  • 24
  • While it's true that VM performance can be greatly increased by making sure that the VM has adequate storage bandwidth, even the guy you're siting doesn't try to say that you have to expose the disk directly to the VM. He just says that you should dedicate a disk to your VM. Putting a VHD file on that disk preserves flexibility without compromising performance much. – Jake Oshins Mar 01 '10 at 21:07
  • Depends. Really. I have a disc exposed that already spans 6 physical discs and soon will go to about 12 - in a RAID 10. Sometimes perforamnce trumps everything. – TomTom Nov 18 '10 at 15:45
  • VM performance is often impacted by the *sharing* of a physical disk or disk array between multiple systems. However, the overhead imposed by the use of a VHD file is not nearly as dramatic as you have suggested. – Skyhawk Jan 20 '12 at 17:29
  • I wonder if this is still true for SSDs. This article is from 6 years ago. – Jason May 31 '12 at 12:47
  • regardless of hard disk speed having to go through a layer of virtualisation before actually writing to the disk was the speed issue – Stewart Robinson Jul 22 '12 at 21:40
1

I doubt that you could measure any performance difference incurred by putting a VHD on that single disk. Try it and see. I suspect you'll want to preserve the flexibility that BLAKE mentioned.

Jake Oshins
  • 5,116
  • 17
  • 15
0

Something else to consider: as soon as you attach a pass-through disk, you lose the ability to take snapshots of that VM. The only workaround is to detach the disk, take the snapshot, and reattach the snapshot. It must be a SCSI disk in order for this to work. You also will want to make sure the VM is not writing to the disk before detaching it.

charleswj81
  • 2,433
  • 14
  • 18