The way snapshots works are not the same on both hypervizors. Snapshots “made by hyper-v”, called Checkpoints, work a bit different way than the snapshots in VMware vSphere. VMware vSphere snapshots work differently. Administrator managing Hyper-V not being aware that the checkpoints are merged only when the VM is powered down, could find himself short on storage space. In fact as I saw in Eric Gray's article, the VM shows that there are no checkpoints, but the space occupied with the checkpoints is still used until the VM is powered off. Only after the merge operation is completed.
But it's not this point which triggered my article about snapshots today. It's the way we use them. Read on..
Recent article published by VMware Support Insider Blog took my attention and also triggered this post I think. Some of my customers which were using snapshots as a long term backup should read on, because the explanations are just making sense…
vSphere Snapshots as backup alternative?
Snapshots are not meant to be used as a backup alternative. Why? Simple because a snapshot is NOT a copy of the Virtual Machine's VMDK but a creation of DELTA file which stores the changes to the VM from this point-in-time onwards. The Flat file becomes read-only and only the delta file will get bigger now.
With multiple snapshots for a VM possibly created manually or possibly by vSphere scheduling feature, the snapshots can quickly became a nightmare. So use snapshots only sparingly.
Quote from the article written by Tech Support Engineer Mike Bean:
Use snapshots not to create backups for your VM’s, but as a form of version control. vSphere Snapshots are intended for short term use only. Got an OS patch coming for a critical VM? Take a snapshot and wait a couple days, perhaps a week. Once you’re certain the patch is viable and won’t cause excessive disruption, remove the snapshot!
What files the VM is composed from in VMware vSphere?
Basically 3 files (there are more files, but to simplify….):
vmx: – configuration file
vmdk : descriptor file
vmdk-flat : Virtual machine disk
When you create a snapshots to your VM, you'll create a delta.vmdk file which is the file where all the changes onwards are stored.
While most people know and see that VMDK file is the “virtual disk” it's not exactly right. It's not the VMDK, but the FLAT file. And to see that FLAT file you must use some software which can show you the hidden FLAT file, which is not seen by the datastore browser included with VI client. You can use for exemple a free tool from VEEAM called Veeam FastSCP , which is fully compatible with Windows 8 and Windows 2012. It's Free version of Veeam backup, which can do full backups of running VMs too !!!.
What happens when your remove snapshot?
When you remove vsphere snapshot, the content of the delta-vmdk file is merged into the vmdk-flat file, which is the actual virtual disk with the content. And then the delta-vmdk file is deleted.
That's where the things can get wrong, because in case you start missing a place on your datastore or your lun, so you decide to delete a snapshots. To be able to delete snapshots, you NEED place. Especially if you decide to hit the delete ALL snapshots button…..
By having a real backup solution by leveraging CBT (changed block tracking) feature of vSphere you can finally sleep better and have the certitude that you can actually restore your VM in case you need to.
Some links to go further with vSphere snapshots:
- troubleshooting guide and also…
- SnapVMX utility from Ruben GARCIA
I hope that this little explication which can surely be found elsewhere, but I just wanted to make it more clear for my readers. I hope it helps.
Miguel Miranda says
Hello Vladan, you already can see the “my_vm-flat.vmdk” file in vSphere Client. You just need to go to Storage Views tab and select “Show all Virtual Machine Files” in the View list.
Vladan SEGET says
Cool,
great Miguel. I learned something today… Thanks for the comment.