Do you know that you still need to perform VMware snapshot consolidation after the failure of reverting or deleting a snapshot? Do you know what’s the difference between snapshot consolidation and deletion? This article will introduce it to you in details.
Snapshot consolidation is used to merge the snapshot delta disk files to the VM base disk.
In vSphere 5, VMware introduced the Consolidation option, which is used when the associated disks are not committed back to the base disk after you revert or delete VMware snapshots.
If the option “consolidate snapshots” is greyed out, you may have an active task running on the VM now.
Deleting a snapshot: You will merge the data written to the snapshot’s delta disk files to the VM base disk, and remove the snapshot from the snapshot chain.
Consolidating a snapshot:
You will remove redundant delta disk files that are left over from failed snapshot restore, delete, or delete all operations. It can improve the VM performance and save storage space.
Snapshot consolidation does not require additional free disk space if all VM disks are thick provisioned. But if your VM disks are thin provisioned, it may require up to the same size of free space as the snapshot size.
In general, the larger the snapshot is, the longer the snapshot consolidation process will take.
But it is not easy to determine exactly how long it will take. Many other factors may affect it directly or indirectly, including the depth of the virtual disk snapshot chain, the type of data, the storage array performance, etc.
You can estimate the time required for snapshot consolidation by monitoring the throughput on the datastore, monitoring throughput for snapshot consolidation only, or estimating the time on a test VM. For more you can refer to VMware’s official tutorial: Estimate the time required to consolidate virtual machine snapshots
If a VM requires snapshot consolidation, you will get a VMware error: virtual machine disks consolidation is needed to inform you that there are redundant delta disk files.
The most typical reasons for ‘virtual machine disks consolidation is needed’ error:
To solve the VMware error: virtual machine disk consolidation is needed, you just need to perform the snapshot consolidation as required. In addition, it can further save storage space and improve VM performance.
In this section, I will introduce 3 different ways to consolidate snapshot.
1. Access the VMware ESXi web client, and navigate to Virtual Machines tab.
2. Right-click on the VM name and select Snapshots > Consolidate disks.
Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded}
(Get-VM -Name "MyVM").ExtensionData.ConsolidateVMDisks()
Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded} | foreach {$_.ExtensionData.ConsolidateVMDisks_Task()}
1. Open an SSH shell session to the host that is performing the consolidation and snapshot deletion task by running the following vim-cmd command:
vim-cmd vimsvc/task_list
2. Run the following command in the SSH shell:
vim-cmd vimsvc/task_info haTask-9-vim.VirtualMachine.removeAllSnapshots-304060994
If the snapshot consolidation is successfully completed, it will show the text: state = "success".
If you encounter the VMware error: An error occurred while consolidating disks. Here are the possible reasons and their solutions:
As you can see, taking too many snapshots, or keeping them for long can both lead to many errors, even data loss. This is because the snapshots are dependent on the parent disks.
Therefore, snapshots are often used as quick failsafe before performing development or testing, capable of rolling back in case of any problem. But if you want a VM data protection measure in production environments, it is much better to take a VM backup than a snapshot.
A virtual machine backup is an independent copy of the VM that can be safely stored offsite, cloud, or other locations. By restoring from a VM backup you will get an instantly usable VM.
Here I recommend you a professional and free VM backup software, AOMEI Cyber Backup for the following benefits:
✦ 3-Step Quick Backup: with 3 easy steps you can quickly create a complete automatic backup task of multiple, or even all VMs on the host. ✦ Backup Schedule: capable of auto backup virtual machines on a daily, weekly, monthly schedule. ✦ Restore Entire VM: capable of restoring the entire VM from any backed up history versions.
It supports both paid and free versions of VMware ESXi and Hyper-V. You can click the following button to download and enjoy this perpetual free edition:
*You can choose to install this VM backup software on either Windows or Linux system.
If you encountered the VMware error: virtual machine disks consolidation is needed, it is informing you that you need to perform snapshot consolidation manually after the snapshot revert, delete, or delete all operations.
In this article, I introduced what is VMware snapshot consolidation, when and how you can perform it on your VMs, analyzed the reasons why the snapshots consolidation fails and the relevant solutions.
Snapshot consolidation often fails because of the improperly usage of VM snapshots. therefore, please do not keep snapshot for long, or take too many snapshots. Most importantly, please do not take VM snapshot as backup.