Windows Server TechCenter > Windows Server Forums > Hyper-V > Large .avhd's for system disks
Ask a questionAsk a question
 

AnswerLarge .avhd's for system disks

  • Thursday, October 29, 2009 6:57 PMTim Curwick Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Windows Server 2008 Enterprise 64-bit, Hyper-V
    16 virtuals, running Windows Server 2003 Enterprise (2 SQL Server 2005, 1 web portal, several web services, balance application servers)

    Once per week, snapshots are deleted and merged, and new snapshots are taken.
    On each guest vm, the page files, most applications and all data are stored on drives separate from the OS, each in it's own .vhd.
    So there shouldn't be much going on on the C: drive.  But I am seeing unexpected growth of the .avhd files for the system drives.  Each of them is growing to 1 to 6 GB or more in under a week.

    What would cause this growth of the .avhd files for the system drive?  Is there anything I can modify or tweak on the host or the guests to minimize this unnecessary growth?

    Thanks,
    Tim C

Answers

  • Tuesday, November 03, 2009 3:41 PMTim Curwick Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    A couple days of testing supports the theory that DisKeeper's actions were bloating the .avhd files.  I have disabled Automatic Defragmentation on all of my virtuals, with scheduled or manual defragmentation only after or just prior to deleting all snapshots.

    The .avhd's for the system disks are still larger than I think they should be, but the bulk of the bloat is gone.

    Thanks,
    Tim C
    • Marked As Answer byTim Curwick Tuesday, November 03, 2009 3:42 PM
    •  

All Replies

  • Thursday, October 29, 2009 8:40 PMBrianEhMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    One reason can be backups (cache for the Windows VSS service).  We have identified this in other threads.

    And when you are deleting and merging your snapshots I am assuming that you power down the VMs to give them time for the deleted snapshot differencing disk to be merged into the parent VHD.


    Brian Ehlert (hopefully you have found this useful)
  • Thursday, October 29, 2009 9:57 PMTim Curwick Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Brian,

    No backups on the VMs.  Shadow copy disabled on all volumes.  Perhaps McAfee VirusScan?  Do that use VSS in any way?

    And yes, I have a script that deletes the snapshots, shuts down the guest OS's, waits for the merging to complete, compacts the .vhd's, takes new snapshots, and turns the VM's back on.

    Any other ideas?

    Thanks,
    Tim C
  • Friday, October 30, 2009 2:44 PMBrianEhMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Interesting script - I am curious.  Why the reliance on snapshots?  Why not just use a backup solution that backs up the VHD?  I am sure it is application dependant, the ability to undo a day.

    In regards to the growth - any type of backup providers will do this.
    Also, is the extra space in the differencing disk?  Or does it actually lie within the root VHD.

    And, maybe this helps:
    A differencing disk is not just a difference of files - it is a difference of blocks and then a difference of files.  This means that it grows in chunks, not in a byte by byte way.

    If you have a root disk that is highly framented and your diff is taking writes from many places on that root disk - you may have a case were only a few byte are being written within a single block, but the entire block must be mapped in the differencing disk.

    I describe differencing disks in a graphical way here:
    http://itproctology.blogspot.com/2009/04/never-resize-vhd-with-snapshots-or.html

    After one of your merges - try taking a bit of extra time in booting the VM as the merged (root) vhd - defragment the VM - then shut down - create your differencing disk - and return to your usual mode.

    I have a hunch that you are getting into a situation of fragmentation within the machine itself.  Which is in turn having an impact on the differencing disk.

    Brian Ehlert (hopefully you have found this useful)
  • Friday, October 30, 2009 10:34 PMTim Curwick Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Brian,

    Am I correct in guessing that not only fragmentation will cause avhd bloat, but also defragmenting?  I realized we have DisKeeper 2008 with automatic defragmentation enabled on all of my virtuals. 

    On two of my virtuals I have disabled it as a test, and scheduled defrags to occur shortly before the snapshots get refreshed.  I realize if this happens before my delete/merge that I'll have to eat some additional merge time, but I think I prefer that to the time and complexity of adding a start/defrag/shutdown to the middle of the process.

    The script is part of a larger process/plan/kludge/whatever, wherein I export all 16 virtuals, copy them to other hosts, and import them to create development and test environments.  I can get away with these clones because they are on isolated virtual networks.  By using weekly snapshots, I only have to copy the avhd's daily, the vhd's weekly.

    Thanks,

    Tim C

  • Tuesday, November 03, 2009 3:41 PMTim Curwick Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    A couple days of testing supports the theory that DisKeeper's actions were bloating the .avhd files.  I have disabled Automatic Defragmentation on all of my virtuals, with scheduled or manual defragmentation only after or just prior to deleting all snapshots.

    The .avhd's for the system disks are still larger than I think they should be, but the bulk of the bloat is gone.

    Thanks,
    Tim C
    • Marked As Answer byTim Curwick Tuesday, November 03, 2009 3:42 PM
    •