After deleting snapshots on a VM either by deleting an individual snapshot or selecting “Delete All” snapshots, you may see the following warning for the VM, stating that disk consolidation is needed.

“Virtual machine disks consolidation is needed”

 This can occur when a snapshot has been deleted from the web console but the underlying disk files in the VM folder still exist. This issue can often occur when a virtual machine backup solution creates a lock on a VMDK and fails to correctly release it.

You can try consolidating the Virtual Machine disk files from Consolidate option under Snapshot Menu.

When I started the Consolidate process, it came back with a Unable to access file since it is locked error.

During this stage – SSH into the ESXi host and if you’re not sure which disk might be locked you can find it from the hostd.log file (tail -f /var/log/hostd.log)

Alternatively you can run the below command against all the virtual machine disk files.

vmkfstools -D /vmfs/volumes/yourvolume/yourVM/yourlockedVM.vmdk

After running the command we could see a single entry for “RO Owner” which had the lock and the MAC address of the ESXi which has the lock on the VMDK file.

Next step is to find the ESXi host in your cluster which is holding up the virtual machine disk.

Once we confirm the ESXi host we can place the host in maintenance mode, DRS will vMotion all VMs to another host in the cluster and restart the hostd service on the host using the below command.

/etc/init.d/hostd restart

Once the hostd service has been restarted perform a Snapshot -> Consolidate on the VM and it should complete successfully.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s