I ran into a somewhat embarrassing problem the other day. Upon turning on my computer I found that my virtual machine on a test server running under Hyper-V was in a Paused-Critical state. A little further investigation showed that my disk space was critically low. I tried to wrap my head around how that could have possibly happened. After all, the only thing that was really on that machine was the Virtual Machine which I had allocated a large amount of disk space for.
The issue was with snapshots. I had been taking snapshots of the VM prior to applying service packs or installing risky software. After the procedure was successful I would delete the snapshot… or so I thought. I’m no Hyper-V guru, but from past experience with VMware products once a snapshot is deleted, it’s gone. This isn’t the case with Hyper-V. If you want to delete a snapshot, you have to delete it in the Hyper-V manager, then turn off the VM with the deleted snapshot and wait for it to merge.
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!
Anyways, that’s my rant. Yes, 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.
Discussion
There are no comments yet!