How much overhead do VHD's have in terms of disk space usage?

问题 How much overhead do VHD's have in terms of disk space usage?

  • Mittwoch, 2. Mai 2012 15:20
     
     

    When I create VHD file, I noticed that the actual size of the VHD file is bigger than what I configured the VHD to be. So it seems that there's always some overhead with this. What is the exact % of overhead that a VHD should have in HyperV?

    If I create a 100GB VHD, how big should the actual file be?

    Thanks

Alle Antworten

  • Mittwoch, 2. Mai 2012 15:51
     
     

    Hi,

    The maximum size of VHD is 2048 Go(2 To),How to Increase the VHD Size in Hyper-V R2


    Best regards Bourbita Thameur Microsoft Certified Technology Specialist: Windows Server 2008 R2,Server Virtualizaton

  • Mittwoch, 2. Mai 2012 15:53
    Moderator
     
     

    VHDs are allocated in blocks.  So the space utilized on the physical storage is always rounded up to the next full block.

    The OS installed in the VM and using the VHD will always see less space - just as a physical disk is never 100% usable.  The exact same rules apply.

    VMDK and VDI also have this exact same behavior.  As they are all binary representations of a physical disk.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

  • Donnerstag, 3. Mai 2012 03:43
     
     
    Hi,

    The overhead is not a VHD relevant issue, you will get overhead with any files.

    I created two VHD files and took some screenshots.

    Right click on the 1GB’s VHD file, you will get a size 1.00 GB (1,073,742,336 bytes), dive by 1024 for 3 times, you will get a result 1.000000476837158.

    Right click on the 10GB’s VHD file, you will get a size 10.0 GB (10,737,418,752 bytes), dive by 1024 for 3 times, you will get a result 10.00000047683716.

    So, you can almost ignore the overhead.

  • Donnerstag, 3. Mai 2012 18:38
     
     

    VHDs are allocated in blocks.  So the space utilized on the physical storage is always rounded up to the next full block.

    The OS installed in the VM and using the VHD will always see less space - just as a physical disk is never 100% usable.  The exact same rules apply.

    VMDK and VDI also have this exact same behavior.  As they are all binary representations of a physical disk.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    How much space should a block take up?

    Reason why I ask, I currently have a VM that serves as a file server. It has a dynamic disk that was configured to be 580GB.  It's almost at capacity and the size of the VHD file is 608GB. That's a 28GB difference. Then when I inspect the VHD through HyperV, it says that the size is 580 and maximum size is 636GB.Than

    Thanks

  • Donnerstag, 3. Mai 2012 18:43
    Moderator
     
     

    If you are using the inspect disk wizard and it states that the maximum size of your Dynamic VHD can be 636GB.  This is the size on storage, the maximum size of the VHD file itself.

    The OS in the VM will see less usable space within the VHD virtual disk.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

  • Donnerstag, 3. Mai 2012 18:50
     
     

    If you are using the inspect disk wizard and it states that the maximum size of your Dynamic VHD can be 636GB.  This is the size on storage, the maximum size of the VHD file itself.

    The OS in the VM will see less usable space within the VHD virtual disk.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.


    But why the 28GB difference between the size that I've configured the VHD to be and the actual size of the file? I understand that it rounds up to the next block, but does that justify the 28GB loss of physical disk space?
  • Donnerstag, 3. Mai 2012 18:57
    Moderator
     
     

    If the Inspect Wizard shows it at 636Gb I was assuming that the VHD was created to be a maximum of 636Gb.

    Now, if your VM has a snapshot or a differencing disk (either present or deleted and not merged) - then the VHD plus its differencing disk (either a VHD or an AVHD) in combination consume additional physical storage.

    However, this would not affect the maximum size of the dynamic VHD if you inspecited it with the Inspect Disk Wizard.

    This is just a strange way that folks get into problems with snapshots and running out of physical storage.

    The other possibility is that at some time the size of hte VHD was increased, by some one.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

  • Donnerstag, 3. Mai 2012 19:44
     
     

    If the Inspect Wizard shows it at 636Gb I was assuming that the VHD was created to be a maximum of 636Gb.

    Now, if your VM has a snapshot or a differencing disk (either present or deleted and not merged) - then the VHD plus its differencing disk (either a VHD or an AVHD) in combination consume additional physical storage.

    However, this would not affect the maximum size of the dynamic VHD if you inspecited it with the Inspect Disk Wizard.

    This is just a strange way that folks get into problems with snapshots and running out of physical storage.

    The other possibility is that at some time the size of hte VHD was increased, by some one.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.


    I understand that, and I'm not using snap shots. What I really want to know is if the VHD size rounds up to the next block as described in a previous response, does that account for the 28GB difference between the size that the VHD was configured to be and the size of the actual VHD file? It just seems like 28GB is a bit much.
  • Donnerstag, 3. Mai 2012 20:27
     
     

    Blocks are no where near GB size, more like MB.

    There is something else going on.  If you've verified that you're not using snapshots, look at host apps like AV and backup programs.  If these are accessing your VHD from the host, weird things can happen to a VHD.

  • Montag, 7. Mai 2012 14:11
     
     

    Blocks are no where near GB size, more like MB.

    There is something else going on.  If you've verified that you're not using snapshots, look at host apps like AV and backup programs.  If these are accessing your VHD from the host, weird things can happen to a VHD.

    So for a 100GB Dynamic disk that contains about 100GB of data, how big should the VHD file be?
  • Montag, 7. Mai 2012 14:56
    Moderator
     
     

    You cannot reliably predict the size of a dynamic disk based on the contents.

    (well, you can, but only in highly controlled conditions which is far from the case with most VMs).

    All that you can say is that a dynamic disk will always be larger than the contents.  The problems come from how the OS in the VM lays out the files within the VHD.  The OS in the VM attempts to preventfragmentation and as a result is not efficient at keeping the VHD small - it leaves lots of empty spaces all over the place.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

  • Dienstag, 8. Mai 2012 00:47
     
     

    Ah... when you look at a file size in windows explorer 1M = 1000K.  When you look at disk size reported in the OS, 1M ==  1024K

  • Mittwoch, 9. Mai 2012 09:01
    Moderator
     
     
    Any updates?

    Jeff Ren TechNet Community Support beneficial to other community members reading the thread.