locked
Compact VHD file in Hyper V RRS feed

  • Question

  • I was wondering if Hyper-V in Windows 2008 R2 or 2012 already comes with a feature that will decrease the VHD file size when you delete files inside the VHD file or not.  

    For example, I have a file server with a data drive of 100GB, set to dynamically expanding. When new data gets added, the VHD size grow, as expected.  When data were deleted off of the data drive, the VHD file size stay the same. 

    I know that if I go compact the disk, it will shrink the VHD file size but I don't want to have to do this all the time to the file servers as shadow copies is configured on the drive.  And in order for the compact to work, I will need to disable shadow copies, which deletes all the history of the shadow copies and starts fresh. 

    Any thoughts or updates on whether this feature will be released with the new Hyper-V or new Windows Server version?

    • Changed type BrianEhMVP Monday, September 9, 2013 11:17 PM
    Monday, September 9, 2013 9:17 PM

Answers

  • I was wondering if Hyper-V in Windows 2008 R2 or 2012 already comes with a feature that will decrease the VHD file size when you delete files inside the VHD file or not.  

    For example, I have a file server with a data drive of 100GB, set to dynamically expanding. When new data gets added, the VHD size grow, as expected.  When data were deleted off of the data drive, the VHD file size stay the same. 

    I know that if I go compact the disk, it will shrink the VHD file size but I don't want to have to do this all the time to the file servers as shadow copies is configured on the drive.  And in order for the compact to work, I will need to disable shadow copies, which deletes all the history of the shadow copies and starts fresh. 

    Any thoughts or updates on whether this feature will be released with the new Hyper-V or new Windows Server version?

    Keeping in mind majority of the production and performance hungry VMs are fixed and not dynamic you need to have free space reclaim done thru the unmap command both inside a VM and implemented with something hosting LUN for CSV you keep VMs on. Not as easy as you think...

    StarWind iSCSI SAN & NAS

    • Marked as answer by BrianEhMVP Monday, September 9, 2013 11:17 PM
    Monday, September 9, 2013 11:07 PM

All replies

  • I was wondering if Hyper-V in Windows 2008 R2 or 2012 already comes with a feature that will decrease the VHD file size when you delete files inside the VHD file or not.  

    For example, I have a file server with a data drive of 100GB, set to dynamically expanding. When new data gets added, the VHD size grow, as expected.  When data were deleted off of the data drive, the VHD file size stay the same. 

    I know that if I go compact the disk, it will shrink the VHD file size but I don't want to have to do this all the time to the file servers as shadow copies is configured on the drive.  And in order for the compact to work, I will need to disable shadow copies, which deletes all the history of the shadow copies and starts fresh. 

    Any thoughts or updates on whether this feature will be released with the new Hyper-V or new Windows Server version?

    Keeping in mind majority of the production and performance hungry VMs are fixed and not dynamic you need to have free space reclaim done thru the unmap command both inside a VM and implemented with something hosting LUN for CSV you keep VMs on. Not as easy as you think...

    StarWind iSCSI SAN & NAS

    • Marked as answer by BrianEhMVP Monday, September 9, 2013 11:17 PM
    Monday, September 9, 2013 11:07 PM
  • The short answer is: no.  no automatic reclamation.

    The technical reasons behind it noted above.


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

    Monday, September 9, 2013 11:16 PM