A lot of users receive the “virtual machine disks consolidation is needed” error when using the VMware vSphere client. What causes the error? How to fix it? Now, let’s start exploring the answers together with MiniTool.

VMware vSphere is a virtualization software application that works as a complete platform for managing your virtual machine. It can be used to perform many virtual machine tasks such as shut down the guest OS, launch console, edit settings, create snapshots, and so on. However, many users encounter the “virtual machine disk consolidation is needed” error when using the software.

virtual machine disks consolidation is needed

According to user reports from different forums and communities, the “virtual machine disks consolidation is needed” error mainly occurs when merging multiple virtual disk files into a single disk. Here’s a true example from the Nakio forum.

Hi, guys! I’ve got this error message saying: “VMware virtual machine disks consolidation is needed.” Do you have any idea what I can do with it? Thanks!https://forum.nakivo.com/index.php?/topic/7815-vmware-virtual-machine-disks-consolidation-is-needed-error/#comment-9528

Possible Causes of the “Virtual Machine Disks Consolidation Is Needed” Error

Virtual disk consolidation is a process of merging virtual disk files created after taking the snapshots in a VM. In most cases, performing a disk consolidation is to avoid performance degradation or solve some issues.

When taking a snapshot, you will find that a delta disk is created and changes are written to the corresponding delta disk. As a result, each delta disk contains all changes made as compared to the previous delta disk state and the parent disk remains unchanged, which causes the redundant data in the virtual machine.

As the snapshots and related virtual disk files grow larger and larger, you may experience performance degrades. But after you initiate the VMware disk consolidation successfully, all data from the delta disk will be merged to a single disk and no redundant data is left on the disk where the VM files are located. That is to say, disk space will be cleaned after you consolidate virtual disk files.

However, the virtual machine disk consolidation process is not always smooth. A great many people encounter the “VMware virtual machine disk consolidation is needed” error. Why? It can be caused by many possible reasons. Here we list them as follows:

  • Deleting the VM snapshots incorrectly is the main reason behind the “virtual disk consolidation is needed” error. If you delete the snapshot improperly, the VMDK files related to snapshots and log files will leave on the datastore.
  • Poor performance of the storage system attached to an ESXi host on which a VM is running. If the snapshot size is larger or times out, the virtual disk consolidation can fail.
  • Not enough disk space on the VMFS datastore to perform the virtual disk consolidation. Usually, it requires 1 GB of free space at least on the datastore.
  • Connection issues between the VMware center and an ESXi host.
  • Snapshot files are locked by a third-party application. According to user reports, this often occurs when a backup application (like HP Data Protector, Veeam, and Netapp VSC) didn’t complete a backup or locked the snapshots.

Now, you should have known the possible causes of the “virtual machine consolidation needed status” error. Let’s see how to fix it.

Desktop Windows Manager Stopped Working and Was Closed? [Fixed]
Desktop Windows Manager Stopped Working and Was Closed? [Fixed]

Many users reported that Desktop Windows Manager stopped working and was closed. This post will explain the possible causes and provide corresponding fixes.

Read More

How to Fix the “Virtual Machine Disks Consolidation Is Needed” Error

After analyzing all possible causes of the “VMware virtual machine disk consolidation is needed” error, we explore the following 5 applicable fixes. Here you can try them in order until the issue gets resolved.

Fix 1. Consolidate Virtual Machine Disk Files Correctly

The first and simplest fix for the “virtual machine consolidation needed status” error is to make sure that you consolidate the virtual machine disk files correctly. To do so, follow the detailed steps below:

Step 1. Launch the VMware vSphere client on your computer.

Step 2. Right-click the VM name in which you want to consolidate disk files and select Snapshots > Consolidate from the sub-menu.

select Snapshots and Consolidate in VM

Step 3. Then you will receive a confirmation message saying “This operation consolidates all redundant redo logs on your virtual machine. Are you sure you want to continue?”. Click on Yes to confirm the VMware disk consolidation.

Note: If you are concerned that some data get lost during the disk consolidation process, you can make a VMware virtual machine backup. For instance, you can transfer all VM filers into another folder on a datastore.

click Yes to confirm the VMware disk consolidation

Then the vSphere client will consolidate virtual disk files and clear the logs. The time needed for the process depends on the VM size, the number of snapshots, and VM load. Once completed, the “virtual machine consolidation needed status” error should disappear.

Fix 2. Delete All Existing VM Snapshots

Another main reason for the disk consolidation error is the locked VM files. If you receive another error message “Unable to access file since it is locked. An error occurred while consolidating disks” during the process, this indicates that your VM disk files are locked by a backup application. In this case, you need to unlock VM files by following Fix 2 or Fix 3. Here we will show you how to unlock VM files by deleting all snapshots.

Step 1. Shut down the virtual machine that you are running and create a new VM disk snapshot.

Step 2. Right-click the VM tab from the top menu, and then select Snapshots and click on Delete All Snapshots.

Step 3. Sometimes the virtual machine consolidation needed status can be triggered by inconsistent -ctk.vmdk files. So, you can try deleting the CTK files.

Step 4. Now, you can try reconsolidating virtual disk files again as we explain above.

Tip: If these steps didn’t help, you can shut down the VM, open VM settings, select the VM Options tab, and then expand the Advanced category and click on Edit Configuration. In the configuration window, click on Add Configuration Params, add the asyncConsolidate.forceSync parameter, and set it to TRUE.

Fix 3. Move the VM to Another ESXi Host

The locked VM files created by a backup application are mainly used to avoid the concurrent writes to the files by multiple ESXi hosts. However, these locked disk files can trigger the virtual disk consolidation is needed error. To unlock the file, you can move the VM to another ESXi host.

Step 1. Restart the management agents on the ESXi host on which the VM resides. To do so, you can open the ESXi shell or connect to the ESXi host via SSH and run the commands below as root:

services.sh restart

or

/etc/init.d/hostd restart

/etc/init.d/vpxa restart

Tip: You can also open the ESXi direct console by navigating to Troubleshooting Options, and selecting Restart Management Agents (by pressing Enter to activate the needed option and pressing F11 to confirm.)

Step 2. Now, you can check the locked VM files by running the command below:

vmfsfilelockinfo -p /vmfs/volumes/vm_datastore/vm_name/vm_name.vmx

Step 3. Check the hosted log files if you want to identify the path on the datastore in which VM files reside.

cat /var/log/hostd.log |grep -i vm_name

Step 4. Navigate to the VM directory on the datastore after you get the VM files’ location:

cd /vmfs/volumes/datastore_name/vm_name

Step 5. Apply the following command to list the ESXi hosts locked by the VM files.

for i in `ls`; do vmfsfilelockinfo -p $i ;done|grep ‘is locked in\|Host owning the lock\|Total time taken’ | sed ‘s|Host owning the lock on file is||g’|sed ‘s|Total time|—|g’ | awk ‘{print $1}’ |uniq

Step 6. Restart your ESXi management agents (including hosted and vpxa). Then run the command below on the EXSi host to unlock the VM files.

/etc/init.d/hostd restart

/etc/init.d/vpxa restart

Once done, you can consolidate virtual machine disk files again and see if the error still appears.

Fix 4. Extend Your Disk Space

As mentioned above, the “VMware virtual machine disk consolidation is needed” error can occur due to insufficient disk space. So, we recommend you check if there is enough free disk space (more than 1 GB) on the VMFS datastore. If not, you need to extend the disk space.

If you don’t want to delete any files on the VFMS datastore, extending disk space is a good choice. How to extend disk drive without data loss? As a multifunctional partition manager, MiniTool Partition Wizard can help you do that easily. In addition, it can be used to analyze disk space, convert NTFS to FAT, migrate OS, recover lost data, etc.

MiniTool Partition Wizard FreeClick to Download100%Clean & Safe

Here’s how to extend the partition with the MiniTool utility.

Step 1. Launch this software to enter its main interface, and then select the disk drive where the VMFS datastore resides and click on Extend Partition from the left pane.

Step 2. Select the drive that you want to take free space from, and then drag the slider bar to occupy the free space or input the specific volume based on your demands. Then click on OK.

Step 3. Click on Apply to execute the process.

expend partition using MiniTool Partition Wizard

Fix 5. Use an Alternative to Execute the VMware Disk Consolidation

If you still receive the VMware disk consolidation error after trying all the above methods, you may consider using an alternative called vSphere PowerCLI to consolidate virtual disk files. The PowerCLI is a graphical user interface that can extend PowerShell to understand and interact with VMware environments. Here’s how to use it to consolidate virtual disks.

Step 1. Launch the PowerCLI client, connect to the vCenter Server that manages the ESXi host with the VM, and enter credentials when you’re prompted.

Connect-VIServer vcenter01.test.com

Step 2. Run the following command below to get the list of VMs with the virtual machine consolidation needed status.

Get-VM | Where-Object {$ _. Extensiondata.Runtime.ConsolidationNeeded}

run a command in PowerCLI

Step 3. Now, you can consolidate virtual machine disk files by executing the command below.

Get-VM | Where-Object {$ . Extensiondata.Runtime.ConsolidationNeeded} | foreach {$ . ExtensionData.ConsolidateVMDisks_Task ()}

When I’m trying to consolidate virtual disks with the VMware vSphere client, an error “virtual machine disks consolidation is needed” popped up. Fortunately, I fixed the error with the help of this post.Click to Tweet

What’s Your Opinion

How to fix the “virtual disk consolidation is needed” error? Now, you can try any or all of the 5 fixes I have explained above and see which one works best for you. If you have better solutions to the error, please write them down in the comment area. Also, you can send us an email to [email protected] when you have any difficulties in using the MiniTool software.

  • linkedin
  • reddit