The BIG AVHD Mystery

This is a great blog post.  The big question is: What does the “A” in AVHD stand for?  I never really stopped to wonder that.  I’ll let you go to the original post for the answer *evil laugh*

The AVHD is a differential disk that has one purpose: snapshots.  When you take a snapshot in Hyper-V a new AVHD is created and linked to your VM’s VHD.  One AVHD for each VHD.  The VM then switches writes to the AVHD so all new changes are written/read from there.  When you merge the snapshot the changes are written back to the original VHD(s) and the AVHD(s) are deleted.

VM’s with differential disks are slow because they are aren’t fixed size.  Every write has the potential of doing a number of tasks:

  • Increase the size of the AVHD
  • Zero out the new part of the AVHD
  • Write the new data that the VM wanted to write

If you’re using a Windows Server 2008 cluster then you probably have dedicated LUN’s per VM.  You’ve probably kept the LUN sizes to the minimum to minimise disk wastage (storage is NOT cheap despite all the BS out there).  When you create that snapshot/AVHD you will start eating into that space pretty quick.  You might fill the LUN which could cause a few things to happen:

  • The VM will go into a pause state because writes are no longer possible
  • Save states will fail because there is no space
  • Using VMM 2008 R2 quick storage migration won’t work because it needs space for additional AVHD’s.

I’ve a few tips on AVHD’s:

  • Minimise their usage on production systems
  • Use a Hyper-V certified VSS backup system to snapshot your VM’s instead, e.g. DPM 2007 SP1
  • Consider using a dedicated LUN for the job.  I’ve not looked into this one yet.  Obviously the LUN will have to be linked to the resource group for the VM in Failover Clustering.  VMM 2008 probably won’t like that; that’s probably why the option for an alternative AVHD location isn’t available there.

As you can see, using AVHD’s can be messy.  I’ve used them in production for one specific scenario: Doing a major upgrade of application or OS and I want a rollback option.  Leaving the AVHD running for too long causes it to grow too much so this has to be a quick thing … snapshot, do the work, delete the snapshot or rollback depending on the success of the work.  If you leave the AVHD in place for too long then a merge will take a very long time.

One thought on “The BIG AVHD Mystery”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.