Solved: Virtual Machine Disk Consolidation Is Needed (2 Ways)
If you encountered VMware error “virtual machine disk consolidation is needed”, what does it mean and how can you solve it? Here are possible reasons and 2 proven fixes.
Error: virtual machine consolidation needed status
Sometimes you may see a warning “virtual machine disks consolidation is needed” in the console of Vmware vSphere 5, 6.5, 6.7, etc. It is usually reported in the Summary tab of a VM, indicating that the snapshot deletion process is not completed successfully.
Keep on reading. In this article, I will analyze what possible reasons lead to this error and explain what is disk consolidation. Then provide 2 proven ways to resolve it.
What is virtual machine disk consolidation and why is it necessary?
In general, virtual disk consolidation is a process of merging snapshots into the original virtual machine.
Taking a VMware snapshot will make the original virtual disk file read-only, and create a delta disk file to store all changes made to the VM afterwards. The more and longer snapshots are kept, the more redundant data becomes, thus taking up more disk space and even affecting the performance of the original virtual machine.
Therefore, virtual machine disk consolidation is needed to merge snapshots and remove redundant data.
To do it, you just need to delete VMware snapshots properly via Snapshot Manager - this will merge them to the original virtual disk. But if you delete snapshots incorrectly, things can be dangerous.
If you accidentally delete the descriptor files, it's still possible to recover deleted VMware snapshot. But if the snapshot data files are deleted directly, it may result in severe data loss. So please be careful when performing such operations.
Reasons for VM disk consolidation needed error
The most common reason for the "virtual machine disks consolidation is needed" error is incomplete snapshot deletion caused by incorrect operation. And the way to get rid of that warning is to perform the disk consolidation properly.
Except for incorrect operations, some other reasons may cause a snapshot deletion to fail. So before trying to perform disk consolidation, please check the following points to exclude any possible interference:
- Connection issues between the ESXi host and vCenter server.
- Poor storage performance. large or timeout snapshots may not be successfully deleted.
- Lack of VMFS disk space for consolidating the snapshot and the original virtual disk. If the free space on the datastore is less than 1 GB, this error may occur.
- Snapshot files are locked, for example, you cannot successfully delete the snapshot while a third-party software is backing up the VM.
- Backup vProxy VM, as the VM disk is part of the proxy VM and is not released after the backup completes. To fix this, check the last backup attribute of the VM in "Custom Attributes", note down the vProxy server and go to the vProxy VM, select Edit Settings and identify the virtual disk allocated in the vProxy VM from the affected VM, then remove it from VM settings (not delete from storage), then you may perform disk consolidation normally.
2 ways to resolve virtual machine disk consolidation is needed
To solve the VMware virtual machine disk consolidation is needed error, you just need to perform disk consolidation properly after ruling out the above possible factors.
In this section, I will introduce 2 proven ways of how to perform VM disk consolidation to remove the error.
Way 1. Manually consolidate virtual disks via VMware ESXi web client
1. Access to VMware ESXi web client, and navigate to Virtual Machines from the left inventory.
2. Right-click on the VM name and select Snapshots > Consolidate disks.
3. Click Yes to confirm disk consolidation of the VM.
Way 2. Using PowerCLI to perform VMware VM disk consolidation
1. Connect to vCenter server and provide relevant credentials:
Connect-VIServer -Server [server name] -Protocol [http] -User [user name] -Password [password]
2. Check which VM needs disk consolidation:
Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded}
3. Consolidate the disk of a specific virtual machine called MyVM:
(Get-VM -Name "MyVM").ExtensionData.ConsolidateVMDisks()
Tip: To consolidate all virtual machines that need disk consolidation:
Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded} | foreach {$_.ExtensionData.ConsolidateVMDisks_Task()}
Use VMware snapshot properly to avoid various issues | 3 tips
As you can see, using VMware snapshots incorrectly may result in errors, and keeping snapshots in the long run can have a negative impact on the performance of VM systems. So for better working with VMware snapshots, here I summarized 3 best practices.
Tip 1. Do not use VMware snapshots as backups
It is commonly accepted that VM snapshot and backup cannot replace each other. Snapshots depend on the parent disk, if the parent disks are deleted, the snapshot files are not sufficient to restore a VM.
But VM backup is an independent copy of the VM, it can be safely stored offsite, in the cloud, or in other locations. Restore from it you will gain an instant usable VM.
Tip 2. Use only 2-3 snapshots for each VM
Actually, a maximum of 32 snapshots are supported in a chain. However, the more snapshots you keep, the more they affect the VM performance.
Therefore, for a better performance please use only 2 to 3 snapshots.
Tip 3. Do not use a single snapshot for more than 72 hours
In most conditions, you need to reserve 20-30% extra storage for a single snapshot. The longer you keep these snapshots, the more disk space and thus affect the performance of your VM.
VMware recommends not to keep snapshots for more than 72 hours. Therefore, it is necessary to 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.
Tip: What can you do if there is no snapshot?
In some situations, the “Need to consolidate virtual machine disks” error won't go away in VMware, but the snapshot is not listed in the Snapshot Manager. It is a bit puzzling. But you are not the only one had this condition.
Here are two tips that others on the Internet have used for this situation, so hopefully these will help you out.
1. Remove proxy of backup software: If you encounter the VM disk consolidation status error but there is no snapshot, it could be a backup software issue. The VM disks may be stuck from a hot-add mounted to a proxy. You can remove the proxy to see if it can be fixed.
2. Check hidden snapshot files: Use an SSH client to connect to your ESXi host or use the Datastore Browser in the vSphere Client. > Navigate to the VM's folder on the datastore. >Look for any *-00000x.vmdk
files. These are delta disks that indicate the presence of snapshots.
Free backup software to protect your VMs from manual errors
Just like the VMware virtual machine disk consolidation is needed error, manual backup VMware VMs may also result in many other errors. Therefore, to avoid manual errors, many IT staff turn to dedicated backup tools that can backup VMs automatically.
Here I recommend AOMEI Cyber Backup, it automates the backup process of VMs, monitors the status, and sends email notifications if there's an error. In addition, the free VMware backup software for the following benefits:
✦ Auto Execution: capable of backing up multiple VMs automatically based on daily, weekly, or monthly schedule.
✦ Role Assignment: allows one administrator to create sub-accounts with limited privileges, effectively avoiding errors caused by others’ mis-operations.
✦ Restore from Any Point: capable of restoring the entire VM from any created history backup versions.
✦ Support Free ESXi: AOMEI Cyber Backup supports both paid and free versions of VMware ESXi.
✦ Perpetual Free Edition: you can also use this free version to protect your VMs with on time limit.
In the next section, I will demonstrate how to create an automatic backup task of ESXi VMs. You can click the following button to enjoy the freeware:
*You can choose to install this VM backup software on either Windows or Linux system.
3 easy steps to create automatic backup tasks of multiple VMs
1. Bind Devices: Access to AOMEI Cyber Backup web client, navigate to Source Device > VMware > + Add VMware Device to add vCenter or Standalone ESXi host as the source device. And click Confirm.
2. Create Backup Task: Navigate to Backup Task > + Create New Task, and then set Task Name, Backup Type, Device, Target, Schedule, and Cleanup.
- Device: using AOMEI Cyber Backup you can backup multiple VMs on the host.
- Target: You can select to back up to a local path, or 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.
3. Start Backup: You can select Add the schedule and start backup now, or Add the schedule only.
Created backup tasks will be listed and monitored separately, for progress checking and schedule changing.
While the Free Edition covers most of the VM backup needs, you can also upgrade to Premium Edition to enjoy:
✦ Batch VM Backup: back up large numbers of VMs managed by vCenter Server or standalone ESXi hosts.
✦ Backup Cleanup: configure retention policy to auto delete the old backup files and save storage space.
✦ Restore to new location: easily make a clone of a virtual machine in the same or another datastore/host, without reinstalling or configuring a new VM.
Summary
The VMware virtual machine disk consolidation is needed error is commonly caused by incomplete of snapshot deletion. To fix this, I introduced 2 methods of how to do virtual machine disk consolidation in VMware in this article.
Just like large VMware snapshot size can result in performance degradation, incorrect snapshot deletion can even cause data loss. Therefore, I also summarized 3 best practices for using snapshots. If you want to further protect your VM data from accidental mis-operations, especially from manual errors, some professional backup software may be very helpful.