Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 2 '10 at 23:50
2  
There's also a new whitepaper from MS - download.microsoft.com/download/0/7/7/… - Virtual Hard Disk Performance –  David Gardiner Mar 3 '10 at 3:32

4 Answers 4

up vote 7 down vote accepted

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.

share|improve this answer

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

share|improve this answer
    
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 1 '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

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.