Sunday, December 20, 2015

VM Disk Consolidation failing with a file lock error

This is common in environments where you are using VM backup solutions like vRanger, Veeam backup, Avamar etc., which takes backup at Esxi's level and uses hot-add technology to take back up of a VM.

Cause: During the backup of the VM a snapshot was made, then the base disk of target VM was hot-added to the VM that handles the backup (vRanger/Veem or any other backup solution uses hot add technology). Now the backup was made. After the backup however the backup solution somehow did not manage to hot-remove the disks from the backup software VM. This meant the base disks of the VM being backed up were still locked, hence the failure when trying to consolidate.

In VM summary you would see this,
And when you try to consolidate the snapshot disks, you would get this error,

One can fix this issue by using one of these methods:
1. Go to the VM settings of your backup  Virtual server VM and check for the attached disks (check the same on backup proxy VMs also), you would find some extra disks there (affected VMs disks), now you need to unlink your vmdk files from his virtual machine (Do Not Delete the Disks, Only remove them from this Virtual Machine).

Once disks are unlinked from the backup server / backup proxy VM then you need to run Snapshot consolidation on affected and this time it will consolidate all snapshots to base disk and complete without any issue.

2. In this method Storage vMotion the affected VM to another datastore (Right click on VM => Migrate => now you need choose migrate disks to another available datastore – this will clear lock on disk files of the virtual machine.
Now run the Snapshot consolidation and it will complete without any issue.

Note: However the Snapshot consolidation completed successfully but you may still need to remove the base disk from Backup Server/ Backup proxy Virtual Machine(Do Not Delete the Disks, Only remove them from this Virtual Machine).

Related Issue: VM backup failed with an error like, "one or more disks from virtual machine ******* is alreadymounted to the backup software VM. You must unmount these disks before attempting to bakup the virtual machine".
The fix of this issue lies in the first part of above solution.

That's it... :)


  1. Shutdown the vm and consolidate worked for me

    Nitin Yadav

    1. what if you don't have downtime....btw i think in your case the issue would be something else

  2. I have one more query...we have vcenter server 5.5 installed on Win Server 2008 R2 and need to upgrade on Win Server 2012 R2 (in-place upgrade)...Do you have any suggestions ?

    1. i never tried that however i don't think there would be any issue...

  3. This comment has been removed by a blog administrator.