“Virtual machine disk consolidation is needed” can pop up when merging multiple virtual disk files on the VMware vSphere Client. Basically, this is a message informing you to perform the snapshot consolidation manually.
Taking snapshots on your virtual machine creates delta disks, and all the changes are stored here. With more snaps, the delta disk file size starts to increase, which can negatively hamper the performance. To prevent such an issue, VMware vSphere Client asks you to perform disk consolidation.
Reportedly, VMSphere ESXi Host Clients didn’t face the consolidation problem with Linux or other operating systems. So, it seems the issue exists only on Windows OS servers, and this article features the related solutions for the same.
You’ll get the “Virtual machine disks consolidation is needed” error in the Summary tab of the VSphere Client when the snapshots aren’t deleted properly. Also, this can appear when the database lacks storage space which should be at least 1 GB.
- Snapshot files are locked
- Snapshot consolidation failure during backups
- Connectivity problem between the server and the ESXi host
- One of the snapshots is undergoing consolidation
- Poor storage system
- More than the recommended VM snapshots (32)
Fixing “Virtual Machine Disks Consolidation is Needed” Error
Disk consolidation simply means deleting those redundant files that remain after a failed snapshot operation (restore, delete, delete all, etc.). The time taken to complete this process depends on the snapshot size. This means the larger the snapshot, the longer it takes to consolidate it.
Before moving forward, you need to know that you can only keep a maximum of 32 snapshots. However, we recommend keeping no more than three to four snapshots as more number can affect the performance. Also, we discourage using the same snapshot for more than 72 hours as longer they remain, the greater disk space they exert.
Now, without further delay, let’s get into the five possible solutions to fix the “Virtual machine disks consolidation is needed” error.
Consolidate Snapshot in GUI
The primary thing to carry out when you encounter the “Virtual machine disks consolidation is needed” message is to consolidate the snapshot correctly. However, consolidating snapshots in GUI is only possible with version 5 and later:
- Launch vSphere Client or ESXi Host Client, and from the left panel, expand Virtual Machines.
- Right-click your virtual machine and choose Snapshots.
- Next, pick the Take Snapshot option.
- This should take you to the Take Snapshot dialogue box. Here, input an appropriate Name and add a description.
- If you wish to take the snapshot along with the memory, we recommend checking the Snapshot virtual machine’s memory option. Then, hit the Ok button.
- Now, move to the Recent Tasks tab, where you can inspect the task status, completion time, server, and more. Here, once the status reaches 100%, know that the consolidation is completed.
Disk Consolidation in PowerCLI
Alternatively, you can also use the command-line interface, PowerCLI, for consolidating the snapshots. This can come in handy when you want to consolidate multiple snapshots, which is a little tricky in the GUI. Kindly follow the below guide to check and consolidate disks on VSphere Client:
- Launch the PowerCLI utility and execute the following command to establish a connection with the vCenter Server:
Connect-VIServer vcenter01.test.com
- Next, copy and paste the following command line to check those virtual machines that require consolidation:
Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded}
- Then, run the below command to consolidate all the machines at once:
Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded} | foreach {$_.ExtensionData.ConsolidateVMDisks_Task()}
However, if you’re planning to consolidate a specific machine, here’s the command you can try:(Get-VM -Name "[Your VM Name]").ExtensionData.ConsolidateVMDisks()
Delete All Unwanted VM Snapshots
If you’re unable to consolidate the disk files and get another message, “An error occurred while consolidating disks”, you can try deleting all your VM snapshots. This can also be useful when a backup application locks all the files, or the consolidation option is greyed out.
Basically, removing the unnecessary snapshots will free up the disk space that’s preventing disk consolidation. Here’s a quick workaround on how to delete snapshots:
- Open vSphere Client and from the left pane, expand Virtual Machine.
- Now, right-click on your virtual machine and select Snapshots.
- From the drop-down, choose Manage Screenshots.
- In the pop-up window, select the virtual machine and press the Delete button.
If you wish to remove all the virtual machines, click the Delete All button.
Migrate the VM to Another Host
If the disk files are locked, there’s a high chance you get the “Virtual machine disks consolidation is needed” error. So, another method to unlock the disk files is by migrating your virtual machine to another ESXi host. This way, you can change the resource that your VM runs on. Below is the complete guide on how to move your VM to another host:
- In the vSphere Client or vSphere Web Client, move to the left pane, expand Virtual Machine and select the ESXi host.
- Switch to the right pane and right-click on your virtual machine. Here, choose the Migrate option.
- In the new window, select the migration type and hit Next.
- Then, select a compute resource and press the Next button.
- Now, select a network and tap Next.
- Pick a vMotion Priority to protect the performance of your running VM. We recommend choosing the recommended option – Schedule vMotion with high priority.
- In the final window, press Finish to complete the migration process. This should solve the “Virtual machine disks consolidation is needed” problem.