VMware snapshot technology: what it is and when to use it

In recent years, VMware has put great emphasis on its cloud technologies. Still, you have to remember that estimates show that the company’s solutions are present on about 75% (data for 2019-2020) of physical servers intended for virtualization on our globe. This means that VMware ESXi is still a leading virtualization solution, and one of the most appreciated features of this solution is undoubtedly the snapshot technology. Thanks to snapshots, for example, we can do some “kind of backup” at the moment without stopping the virtual machine, and this is something that everyone loves, but why shouldn’t I use the word “backup” in this sentence?

What does the VMware documentation tell us?

Of course, you could paste a link to the VMware vSphere documentation here and write that the first bullet point in this documentation is “Do not use VMware snapshots as backups” and we are done, we can finish our considerations and move on, but let’s look at a broader picture here. In VMware, the technology of snapshots consists mainly of creating a delta file that stores information about changes in the virtual machine from the moment of creating the snapshot to the present time. Of course, this is not the end; the snapshot technology is based on files such as:

  • delta file – holds the changes to the virtual disk’s data at the time the snapshot was taken,
  • delta disk file – holds the state of the virtual disk at the time the snapshot was taken,
  • memory state file – holds the memory state at the time the snapshot was taken,
  • disk descriptor file – holds the information about snapshot itself,
  • list file – files that keep track of the VM’s snapshots.

VMware snapshot – the basics

First of all, we can create the example-00000x-delta.vmdk file generated during the snapshot creation process in most cases on a virtual machine turned on and off. Thanks to this, we are not forced to plan technical breaks, which is very “convenient” for administrators and users. Another essential piece of information is how to create new snapshots. Each subsequent one acts like a chain and creates a new delta file. This means that when we create a new snapshot, all changes to the virtual machine will be saved in a new delta file, and the old one remains with previous changes, and it is kept in read-only mode, and so on. Add to this that such a snapshot is created relatively quickly, and we have an excellent form of “backup,” but is it?

So is the snapshot a backup or not?

The answer to a question that has already been asked a few times in this article should always be negative. Snapshots are a great tool in the skillset of hypervisor administrators, but this technology is more of a version control system for virtual machines than a form of backups. Of course, virtually all known backup applications on the market with VMware support use snapshots when creating backups. Still, it’s also true that after the backup process is completed, such a snapshot is deleted, and the virtual machine’s disks are consolidated, if necessary. However, it should be always remembered that VMware’s number and the holding time of a given snapshot for a virtual machine are of key importance. Removing the snapshot itself, as in the case of its creation, depends on several factors. The size of the disk and memory of the virtual machine itself, the load of this virtual machine, server’s computing powers with VMware ESXi, the number of IOPS on the matrix, etc. It’s worth mentioning that when removing snapshots, we also have to deal with two factors.

So why shouldn’t you keep your snapshot?

The first is the number of data changes in the virtual machine since the snapshot was created, and this is critical. Even the VMware documentation advises that snapshots shouldn’t be kept for more than 72 hours. This is due to the very assumptions of the snapshot technology, and we need to be clear here, this isn’t a disadvantage. I’ve seen in my career virtual machine snapshots that were several years old, and this is a precedent that shouldn’t happen. I imagine that we have a snapshot of the machine, which must be restored to its original state, for example, every 2 days, and I would allow a snapshot in such a specific case and n-year-old, but it is some kind of exception. Having snapshots for a given machine for more than a few hours isn’t desirable for a number of reasons. First of all, when the virtual machine has a snapshot, VMware will make it very difficult for us to increase the original disk of the virtual machine or migrate to another host. On the other hand, in standard situations, there may be several problems with snapshots left for too long. Remember that the delta file store data changes from the moment the delta disk was created up to the present time. This means that the longer the time, the larger the delta file itself and the more resources the ESXi server has to spend to manage this file. For example, after some time, it may turn out that the delta file is larger than the entire virtual machine. Now imagine that such a snapshot needs to be removed or consolidated. In such cases, such operations can take days, and in extreme cases, even longer!

How many of these snapshots?

The second factor to consider is the number of machine snapshots. I already mentioned that each new snapshot creates a new delta file, and this, in turn, means that if the last snapshot is deleted, all changes made between the last snapshot and penultimate delta file must be merged to this penultimate delta file. The most interesting process is going back to the not-last snapshot. Since delta files are in read-only mode, VMware ESXi has to merge all newer snapshots, so the more snapshots we have, the more server resources and time we will need to complete this task. Mainly, for this reason, the official documentation doesn’t recommend having more than three snapshots of a given machine. Another important aspect worth mentioning is deleting all snapshots of a given virtual machine. In this case, the hypervisor has to make changes from all delta files to the original virtual machine disk. This is a critical process, and it would be better if we have Xopero with us, which would take care to have a backup of our virtual machine in case of unforeseen events.

Hopefully, after reading this article, you’re convinced that a snapshot isn’t equal to a backup. We can say that It’s indeed a technology designed to “assist” the Xopero application to create backups in the background, i.e. without the knowledge and interference of administrators and users. Xopero will also take care of the disk consolidation on VMware, and will also make sure that no stray snapshots are left.