3

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

2 Answers 2

3

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).

2
  • +1 for a Wonderfully complete answer and link to the spec.
    – voretaq7
    Sep 8, 2011 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 Sep 9, 2011 at 9:37
2

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).

2
  • 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 Sep 9, 2011 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, 2011 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .