Hyper-V VM in a Paused-Critical State

Snapshots serve as a mechanism that allows us to revert virtual machines back to a previous state in a timely manner. A common issue when dealing with virtual machines and taking multiple snapshots occurs when the virtual machine will no longer stay running. In these scenarios, the VM will typically pause itself and reported to be in a “Paused-Critical” state.










This issue is caused by a lack of system resources available to the host. More specifically, this occurs when there is not enough free hard disk space available on the host drive where the virtual machine snapshots are stored. So how does this happen? Well, an AVHD file is created every time you create a snapshot of the VM. The problem is that these files are often quite large and can add up on you before you know it. Also, deleting the snapshots from Hyper-V manager will remove the link to them but won’t delete the AVHD files off of the physical disk.

Your initial reaction when winding up in a Paused-Critical state might be to delete the AVHD files to free up space; however, this won’t fix the problem in itself. You will then have to turn off the VM and delete the snapshot files from within Hyper-V manager for the free space to be made available to the VM. Microsoft recommends doing this process first prior to deleting the AVHD files manually. Alternatively you can export the VM and the import it back into Hyper-V manager.

Scenario
I shut down the VM and the merging process began. However, I had created a few snapshots in the past that still hadn’t been merged. It looked like the merging process might take a while, so I let it run. However, the merging process could not complete because I didn’t have enough disk space! I found this quite ironic.


I am of disk space because I did not merge the snapshots into the vhd, but I cannot merge the snapshots because I am out of disk space. Does that seem odd to anyone else?


In order to fix this problem I had to dive into the config file. Luckily, I had another hard drive with around 30GB of freespace attached to the host. To fix the problem I shut down the VM and Hyper-V Services then went to the directory containing .avhd (snapshot) files. I moved one of the snapshot files to a temporary directory on the drive with the free space, then updated the snapshot entry in the config xml file for the VM to point to the new directory where I placed the snapshot file. After restarting the Hyper-V services and turning off the VM the merge was able to complete, albeit after 2 hours of waiting.


I realize that Hyper-V is a somewhat new contender in the Virtualization marketplace, but I think that something is completely out of whack with the way that snapshots work. When you have systems that are required to be up and running 24/7 it basically throws away any use that snapshots have. It seems somewhat ridiculous that you have to bring a system down to delete the snapshot when one of the reasons you created the snapshot was to help reduce downtime in case something goes wrong. It is even more ridiculous that if you don’t power down your system and wait for the vhd to merge, the snapshot will continue to grow until the system comes crashing down due to a lack of disk space!


I understand that Microsoft does not recommend snapshots for production environments… but I hope in the future they make some improvements so that snapshots are usable in production environments.

0 comments: