Home > Hyper-V > Be-Aware of Hyper-V Snapshots

Be-Aware of Hyper-V Snapshots

Snapshots capture a state of a Virtual Machine, data and hardware configuration. VMware ESX and Microsoft Hyper-V hypervisors provides the ability to take snapshots but the mechanism used for handling the snapshots are completely different and understanding them is very important.

Recently we faced an issue in one of our test Hyper-V Server where all the machines went into a saved state. We narrowed down on the root cause and found that there was no space available on the drive hosting the VMs. When we dived further, we found that there were huge .AVHD files on one of our Virtual machine. We immediately checked the Hyper-V manager for active snapshots but there were no active snapshots. We had taken snapshots for that Virtual machine that was active for a week and then deleted the same from the Hyper-V manager.  Now some search on Google led me to Microsoft’s FAQs on Hyper-V VM Snapshot on TechNet.

This is when I realized that mechanism implied by Hyper-V on snapshots is completely different from VMware ESX Server and ESX handles snapshots better than Hyper-V. So here are my key learning’s that I hope would be helpful to everyone working on Hyper-V.

  • When we delete a snapshot present in a Virtual machine from the Hyper-V Manager, the .AVHD files that contains the snapshot data remains with the VM until the VM is shut down / Saved / Powered Off. Hyper-V Manager displays the progress when deleting the snapshots. After the merge is complete the AVHD is deleted by the system.
  • Do not delete the AVHD files directly from the storage location. This will cause your Virtual machine to go down.
  • Do not expand a virtual hard disk when it is used in a virtual machine that has snapshots. Doing so will make the snapshots unusable.
  • The presence of a virtual machine snapshot reduces the disk performance of the virtual machine.

Now back to our problematic Hyper-V Server, we powered off the VM and waited patiently for the AVHD files to merge back with the base disk and after a long wait the process got completed. Now we were able to power on back all the Virtual machines hosted on the server.

How can we afford to take a downtime for a Virtual Machine just to commit a snapshot?

What happens when I run out of disk space since I will need space to allow the merging of disks used in snapshots?

VMware snapshots has been discussed extensively in this VMware KB article and Snapshots in Hyper-V has been discussed in detail in a series of blog posts that can be found here and here and here .

Hoping that Microsoft will improve the mechanism in which the snapshot is committed in a Hyper-V Virtual machine.

Advertisements
Categories: Hyper-V Tags: , ,
  1. Tom
    January 26, 2011 at 5:30 pm

    A college has maunal deleted a snapshot to free up HDD space.

    Now as you discribe we can not start the VM anymore.

    Is there a solution to startup the VM or restore/fix this now a snapshot has manual been
    deleted

    Kind regard for any help
    Tom

    • January 27, 2011 at 6:58 am

      Hi Tom –
      Has the college deleted the .AVHD files from the host without removing the snapshots ? Is the Snapshot chain still visible on the VM in Hyper-V Manager ?
      When deleting they should have been prompted with a message saying that file is locked – Did they get this message?

  2. Tom
    January 26, 2011 at 5:31 pm

    Hello,

    A college has maunal deleted a snapshot to free up HDD space.

    Now as you discribe we can not start the VM anymore.

    Is there a solution to startup the VM or restore/fix this now a snapshot has manual been
    deleted

    Kind regard for any help
    Tom

  3. Derek
    April 17, 2013 at 7:31 pm

    Horrible nightmarish stuff if put in production environment. There is so much gottcha with MS Hyper-V. Microsoft was behind and will remain behind in VM environment. Just testing this out now and wanted to search this “merge” process when I can across your post. Without snapshots and able to recover the previous machine without much hassle makes this MS VM pointless for me. Back to ESX and Workstation I go.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: