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

Basically, does a full (say) 1TB VHD file occupy more than 1TB of disk space on the host device?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Yes, there is space overhead and it depends on the type of VHD.

For a fixed VHD, there is a 512 byte footer after the raw disk image.

For a dynamic VHD, it's only slightly more complicated. The size of the VHD is equal to the size of the actual data written to it plus the size of the header and footer.

In your example, your fixed disk VHD would consume (1TB + 512 bytes) of total space. A dynamic VHD of the same type would consume (1TB + (2 * 512 bytes)) of total space.

You can read about the VHD specification here (Word .doc).

share|improve this answer
    
+1 for a Wonderfully complete answer and link to the spec. –  voretaq7 Sep 8 '11 at 22:19
    
Thanks for the answer. I guess it knows the highest block count and just adds 512 byte blocks on the end when a new block is needed –  Rob Nicholson Sep 9 '11 at 9:37

ALL VHD files have overhead. A dynamic (growing) one does not however incur substantially more overhead than a preallocated (monolithic) one.

The chief difference is that the monolithic/preallocated style has a better chance of being contiguous on disk, which may improve performance. Additionally it avoids the underlying OS calls to expand the file, which improves write performance (more noticeable before it hits its maximum size).

share|improve this answer
    
Anyone hazard a guess how much overhead the continual expansion adds? I'm using robocopy to copy 1.5TB from a Backup Exex de-duplication folder (lots of 256MB files) into a VHD. Raw read/write speed should be about 30MB/s (14 hours) but at 10 hours it's only 1/3 way through –  Rob Nicholson Sep 9 '11 at 9:40
1  
If the overhead you're talking about is speed/performance my experience is that dynamic VHDs are substantially slower, but I can't give you an exact percentage. When the virtual disk needs to grow most virtualization software asks the underlying OS for the space it needs plus a margin. If you're constantly growing the disk it's constantly asking for that (and having to stop and wait for the host OS to give it the space). –  voretaq7 Sep 9 '11 at 14:09

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.