3

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

Rob Nicholson
  • 1,707
  • 8
  • 29
  • 56

2 Answers2

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

pk.
  • 6,451
  • 2
  • 42
  • 63
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).

voretaq7
  • 79,879
  • 17
  • 130
  • 214
  • 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 09 '11 at 09: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 09 '11 at 14:09