Many users have been confused by VM snapshot and backup. They can both be used to secure virtual machine data, but they work differently. In this article I will make a comparison to show VM snapshot vs backup differences and their proper use.
Virtual machine (VM) provides a secure sandbox environment for testing programs or accessing virus-infected data, the ability of not affecting physical machines has made it popular with businesses.
When using VMs, protecting data is one of the most important tasks. Virtual machine backups and snapshots are both common measures to ensure data security. But what is the difference between a snapshot and a backup, and how to use them properly? Many users have been troubled by this question. This article is mean to answer it.
A VM snapshot is an image that captures the complete state and data of a virtual machine at a specific point in time. The state includes the power state of the VM (powered-on, powered-off, or suspended), and the data includes all the files that make up the VM (disk, memory, and other devices). It is a quick and efficient way to roll back VM to a specific point in time, just like the undo function.
*In Microsoft Hyper-V environments, snapshots are also called checkpoints since Windows Server 2012 R2.
How do snapshots work exactly? When taking a VM snapshot, all writable data will become read-only. You can take multiple snapshots for restoring the VM to multiple points in time. VM snapshots are not standalone, but depend on the parent VM disk or snapshot chain, and incrementally record changes since the last snapshot.
When you create a snapshot for the first time, the first child disk is created from the parent disk. Successive snapshots generate new child disks from the last child disk on the chain. The relationship can change if you have multiple branches in the snapshot chain.
Creating a VMware snapshot, for example, you will create these files:
.vmdk file: a virtual disk file that contains the raw data in the virtual disk. -delta.vmdk file: an incremental disk file that captures all changes made to the VM since the last snapshot was taken. It grows as the snapshot stays open and changes. .vmsd file: a centralized file for storing information and metadata about snapshots. .vmsn file: the snapshot state file that stores the current configuration and optionally the running state of a virtual machine.
These files are placed on the same storage infrastructure as the parent disks.
Note: Creating a Hyper-V checkpoint, you will create the following files:
A VM backup is an independent copy of part or all of the data in VM, that is not dependent on the original VM. Therefore, VM backups can be safely stored offsite, to the cloud, or other locations. This is the most commonly used measure for VM data protection.
VM backups can be divided into 2 types depending on how they work: image-based and file-based backup.
Image-based backup is an image that captures the current state of the entire virtual machine, backing up the virtual machine's operating system, configuration files, and all data on disk.
File-based backups back up a virtual machine as if it were a physical machine by configuring an agent on the guest machine. You can choose what to back up yourself, but it only protects the operating system and applications, you can't restore the virtualized environment.
VM backup and snapshots can both be used to secure virtual machine data, but they work very differently. Many users have been confused by them. Therefore, in this section, I will analyze what are the differences between a snapshot and a backup.
Difference |
VM Snapshot | VM Backup |
Data security | Snapshots depend on the parent disk. If the parent disk is deleted, the snapshot itself is not sufficient for VM restore. | VM backups are independent of the original VM, and can be safely stored offsite, to the cloud or other locations |
Performance affecting | Not suitable for long-term preserve, for the incremental disk file grows and can take a lot of space, affecting the VM performance. | VM backups can be safely stored for long time without affecting VM performance. |
VM Recovery | VM snapshots can only be used to roll back the original VM to the point of time the snapshot was taken | Backups can be used to create single or multiple new VM to original or different location, without the original VM. |
Creating speed | Faster. It only captures the state and data at a specific point in time. | Slower. The more data is backed up, the longer the process takes. |
The answer is NO. Snapshots can be used to roll back VMs, but cannot be used as backups.
As described above, a VM snapshot is dependent on the parent disk. If the parent disk is deleted or the virtual or physical infrastructure fails, the snapshot itself is not sufficient to restore the entire VM. A VM backup, on the other hand, is a complete copy independent of the parent disk, it will not be affected and can be used to restore the VM.
Besides, after taking a VM snapshot, all changes made to the VM will be stored in the incremental disk file. Therefore, the snapshot size can grow very large and take up a lot of disk space, and keeping them for a long time will affect the VM performance. You will need to perform snapshot consolidation to avoid performance penalties. Meanwhile, VM backups can be kept for a long time without affecting the original VM.
Based on these VMware snapshot disadvantages, we do not recommend it as regular backup means.
◆ VM snapshots can work as quick failsafe before performing development or testing.
With them, you have the restore points to quickly roll back in case of any problem. Note that keeping snapshots for long time can affect the VM performance. VMware recommends using only 2-3 snapshots in a chain, and for single snapshots no more than 72 hours.
◆ VM backup is a comprehensive data protection measure for every situation.
While file-based backup is appropriate when you only need to back up a small amount of data on the VM, image-based backups are more complete and safer for disaster recovery. Implementing a proper automated backup strategy can maintain your business continuity, and go a step further in securing your VM.
◆ In practice, it is recommended to use VM snapshots in combination with backups.
VM snapshot can be used as a short-term, temporary rollback measure before unsafe operations, while VM backup can work as a long-term, stable VM protection for disaster recovery.
After knowing what VM snapshots and backups are and their proper usage, now you can create them according to your actual needs. In this section, I will demonstrate the specific steps to create, restore and delete VMware ESXi VM snapshots as an example.
1. Access VMware ESXi Web Client, and navigate to Virtual Machines. Right-click on the VM name and select Snapshots > Take snapshot.
2. Provide a Name and Description for this snapshot. And select to Snapshot the virtual machine’s memory, or Quiesce guest file system (needs VMware tools installed).
3. Click Take Snapshot to start. You can check the progress in Recent Tasks.
1. Right-click on the VM name and select Snapshots > Manage snapshots.
2. Select the target snapshot and then click Restore snapshot.
Tip: If you want to restore to the latest snapshot, right-click on the VM name and select Restore snapshot.
Deleting a snapshot will consolidate the changes to the VM and remove the snapshot. You should always remember to delete snapshots, when you want to keep the changes after the snapshot and will not restore to it.
1. Right-click on the VM name and select Snapshots > Manage snapshots.
2. Select the target snapshot and click Delete snapshot.
Tip: If you want to delete all snapshots you can click Delete all next to Delete snapshot, and click Remove on the pop-up alert.
Choosing AOMEI Cyber Backup over VMware’s built-in backup methods offers flexible and ideal virtual machine backup solution.
Click the following button to download the freeware.
*You can choose to install this VM backup software on either Windows or Linux system.
Next I will demonstrate how to backup and restore VMware ESXi VMs as an example.
Step 1. Bind Devices
Step 2. Create Backup Tasks
Step 3. Start Virtual Machine Backup
Step 4. Restore VM from Backups
Click "…" > "Restore" on the left of the backup task to open the restore wizard, click "Select Content" to specify a recovery point, and then select to "Restore to original location". Click "Start Restore".
While the Free Edition covers most of VM backup needs, you can also upgrade to Premium Edition to enjoy: ▶ Batch VM Backup: Batch backup large numbers of VMs managed by vCenter Server or standalone ESXi hosts. ▶ Backup cleanup: Configure a retention policy to auto delete old backup files and save storage space. ▶ Restore to new location: Create a new VM in the same or another datastore/host directly from the backup, saves the trouble of re-configuring the new VM.
Being able to roll back virtual machines after failures, VM snapshots can also be used for data security. However, they still cannot replace VM backups. In this article I compared VM snapshot vs backup, analyzed the differences between them, and demonstrated how to properly use them. Hope this could be helpful to you.
Except for the basic operations I introduced, there are more about snapshots you can explore, for example, schedule VMware snapshots. Backing up your VMs regularly and you can enjoy them freely.