VMware snapshots overview
A VM snapshot preserves the state and data of a VM at a specific point in time. The state includes the VM’s power state (for example, powered-on, powered-off, suspended). The data includes all of the files that make up the VM. This includes disks, memory, and other devices, such as virtual network interface cards.
VMware snapshots are popular as a quick failsafe measure. In Hyper-V environments, they are also known as checkpoints since Windows Server 2012 R2.
How do snapshots work in VMware
Taking a VMware snapshot, the following files will be created:
- -.vmdk: The -flat.vmdk file that contains the raw data in the base disk.
- -delta.vmdk: The temporary delta disk file created to store all the changes made to the VM since the snapshot was taken. Represented in the format of -00000x.vmdk.
- .vmsd: A database file of the VM’s snapshot information and the primary source of information for the Snapshot Manager. The file contains line entries which define the relationships between snapshots as well as the child disks for each snapshot.
- Snapshot.vmsn: A memory file that contains the current configuration and optionally the active state of the virtual machine, allowing you to revert to a running state of the VM.
When taking a VMware snapshot, the original virtual disk file will become read-only, and a temporary delta disk which points to it will be created, to store all the changes made to the VM afterwards.
As more writes are made to the delta disk, it can grow large enough to fill an entire datastore.After the snapshot is deleted, all changes will be merged into the original .vmdk file, and it will return to read-write mode.
When to use VMware snapshots
VMware snapshots can be used as quick failsafe rollback points, to reduce the hassle of creating multiple VMs.
Generally, VMware snapshots are used for development and testing purposes. For example, taking snapshots before performing patches, upgrades, tests and other unsafe operations.
However, they are not recommended to be used in production environments, since running VM on snapshots for a long time can lead to instability and data loss.
VMware snapshot best practices
Although convenient, VMware snapshots have limitations in practical use. For example, snapshots can have a negative impact on the performance of VM systems.
Performance degradation depends on how long you keep the snapshots, how deep the snapshots tree is, and how much changes you have made to the VM since you took the snapshot.
For better working with VMware snapshots, here I summarized several best practices.
Do not use VMware snapshots as backups
VM snapshot vs. backup is a long-confusing issue for VM users. The accepted conclusion is that snapshots cannot be used as backups.
While VM backup is an independent copy of the VM, and can be safely stored offsite, to the cloud, or other locations, snapshots depend on the parent disk. If the base disks are deleted, the snapshot files are not sufficient to restore a VM.
Use only 2-3 snapshots
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.
Maximum of 32 snapshots are supported in a chain. However, for a better performance please use only 2 to 3 snapshots.
Do not use a single snapshot for more than 72 hours
Generally, you need to reserve 20-30% extra storage for a single snapshot. As more changes you made to the VM after a snapshot, the delta disk file can even run out of space, and affect the performance of your VM system.
Therefore, please delete the snapshots in time to merge the changes to the parent disk when they are no longer useful, or before creating backups of your VM.
How to properly work with VMware snapshots
Now you have known when should you take VMware snapshots, and how to keep them in optimal use. The next thing you need to know is the specific steps of the basic VMware snapshots operations.
In this section, I will demonstrate how to perform the basic operations of VMware ESXi snapshots as an example.
How to take a snapshot in vSphere Web Client
1. Access to vSphere Web Client. Right-click on the VM name in the inventory and select Snapshots > Take Snapshot…
2. In the pop-up window, provide a Name and optionally a Description for the snapshot. You can Edit them later in Snapshot Manager.
3. There are 2 options to check:
- Snapshot the virtual machine’s memory: record the VM’s memory, allowing you to roll back the VM to the exact running state when the snapshot was taken, but takes longer. If you leave this option unchecked, then the VM will be powered-off after you roll back.
- Quiesce guest file system (needs VMware tools installed): pause the state of the processes that are running, or may modify the information stored on disk when the snapshot was taken, to guarantee the consistency. Quiescing and Memory snapshots are mutually exclusive.
4. Click OK to take the snapshot. You can see the progress in Recent Tasks.
How to revert to a snapshot
1. Access to vSphere Web Client. In this step, operations are different according to different needs.
✦ If you want to revert to the latest snapshot: Right-click on the VM name and select Revert to Latest Snapshot.
✦ If you want to revert to another previous snapshot: Right-click on the VM name and select Manage Snapshots…
Select the snapshot you want to revert in Snapshot Manager, and click Revert to.
2. It will pop up a Confirm window notifying the loss of the current state. If it is a memory snapshot, then there will be one more option to suspend this VM when reverting to selected snapshot. You need to manually power on the VM later if you check this option.
3. Click Yes to revert to the selected VMware snapshot. In Snapshots Manager you can see the current state represented by You are here.
How to delete one or all VMware snapshots
1. Access to vSphere Web Client. Right-click on the VM name and select Manage Snapshots…
2. In this step, operations are different according to different needs.
✦ If you want to delete one snapshot: Select the target snapshot and click Delete. Click Yes in the pop-up Confirm window.
✦ If you want to delete all snapshots: Click Delete All in Snapshot Manager and click Yes in the pop-up Confirm window.
3. Click Close to exit the Snapshot Manager.
How to properly backup VMware virtual machines
There are mainly 4 ways to create independent and complete VMware VM backups.
- Manually copy/download VM files: using the copied (or download on ESXi) VM files you can create a new VM on original or another host.
- Export VM to OVF/OVA templates: exporting VMs to compressed Open Virtualization Format (OVF) files, you can achieve faster downloads, and import VMs to original or another host.
- Clone VMs: clone is a way to create multiple same VMs that are immediately usable.
- Backup VMs using dedicated backup tools: currently this is the only way to automatically backup multiple VMware VMs.
Today, dedicated backup tools have been developed very comprehensive in VM backups, compensating for many tasks that VMware's built-in features can't accomplish, and are therefore widely accepted by VM users.
For example, AOMEI Cyber Backup is a professional backup tool which allows you to quickly backup multiple VMware ESXi VMs. Next I will demonstrate how to do that as an example. You can click the following button to start a free trial.
3 easy steps to backup multiple VMware ESXi VMs
1. Bind Devices: Access to AOMEI Cyber Backup web client, navigate to Source Device > VMware ESXi > + Add VMware ESXi to add a host, and then click … > Bind Device.
2. Create Backup Tasks: Navigate to Backup Task > + Create New Task, and provide Task Name, Backup Type, Device, Target, Schedule, and Cleanup as needed.
- Device: you can backup multiple, or even all VMs on the host at once.
- Target: you can select to back up to a local path, or to a network path. Used paths will be saved in Favorite Storage for handy selection.
- Schedule: you can choose to perform full, differential or incremental backup, and automate execution daily, weekly or monthly according to the frequency you specified.
- Cleanup: specify a retention period, and the old backup files that exceed the period will be automatically deleted.
3. Start Backup: Click Start Backup to select to Add the schedule and start backup now, or Add the schedule only.
Created backup tasks will be listed separated for further log checking, task changing, or restoring. You can select to restore to original location or restore to another datastore, host.
Although VMware snapshots are convenient for quickly rolling back the VM to specific point of time, they need be used properly to maintain the VM system performance.
In this article, I introduced what are snapshots and the best practices, and how to create, revert, and delete them. Snapshots cannot replace backups, but using them in conjunction with backups can greatly improve your work efficiency.
To proper back up your VMware ESXi VMs, you can choose AOMEI Cyber Backup to help you schedule automatic backup tasks of multiple VMs. Except for VMware ESXi VMs, it also supports Microsoft Hyper-V.