Like Snapshots in Hyper-V? - Please read this
Snapshots is nice to have, in fact very nice to have when running a virtual platform. In Hyper-V it is easy to do snap-shots and there are no problems, or is there something you should be aware of...
Yes, there is a a issue, it is not a bug but there is something you absolutely need to know, otherwise you will be in serious trouble. So lets here the story...
A snapshot is a way to "freeze" a virtual machine so that you can reverse back to a previous state. As an example, if you want to install a servicepack or a hotfix, it could be a very good idea to do a snapshot before. In case of a big "oops" you can revert back. If all works nicely you can remove the snapshot file.
In Hyper-V the standard way to run a virtual machine is to use Virtual Hard Disks (VHD) and there are different kinds of VHD files, we have fixed size disks and dynamic disk. Fixed size consumes the size that the file have, dynamic files expand them self's while you store data. That means that for performance you always use fixed size disk, also to not dynamic disks, dynamic disk are very good for LAB and/or servers with low disk IO load.
This is how it works:
When you create a snapshot, Hyper-V creates a difference disk (a dynamic disk that is chained into the ordinal disk) and instructs Hyper-V to write data on that instead of the original disk.
That means that the performance will be lower and the load on the host machine will rise, not much but it will. It also means that the snapshot will continue to grow "if" changes occur on the disk, worse case it can be grow up to the same size as the original disk, that means that you can loose 500gb of storage in just a couple of minutes in worst case, but the biggest problem is that most customers does not know that a snapshot is not deleted when they delete it, it is merged into the ordinal disk only when the virtual machines is TURNED OFF, so lets say that you run 4 virtual machines using 127gb of disk, you snapshot them and then you delete the snapshot after 1 second or so after you have done the snapshot, no snapshots right? Sorry to say byt Hyper-V will still use the snapshots, they will grow, they will have lower performance, they will be ugly when you turn the machine off because then it starts to merge....
Let the systems run for 90 days (lets assume they are web servers or something) and then when you turned them off because you want to change the configuration or something like that. Then the 4 machines will turn off and MERGE the 127GB file into an other 127GB file, all server at the same time. I have seen it, it took almost 12 hours to reboot 4 web servers, the customer did not know how snapshot works, we where also forced to add more disk capacity to be able to make room for the merge.
- If you use snapshot, delete them after you have done your job and turn OFF the virtual machine as soon as possible.
- Only use Snapshots as a temporary protection to be able to rollback, not as a backup solution.
- Watch disk space BEFORE shutting down a virtual machine
- Use fixed size disk for performance
- Use dynamic disk for LAB/Demo/Play/low performance
- If you use dynamic disk, be sure to monitor the disk
| Mikael Nystrom - TrueSec MCT, MVP Windows Server - Setup/Deployment |