Unable to consolidate VMware virtual machine snapshots due to file lock
search cancel

Unable to consolidate VMware virtual machine snapshots due to file lock

book

Article ID: 321295

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vSphere ESX 5.x VMware vSphere ESX 6.x VMware vSphere ESX 7.x VMware vSphere ESX 8.x VMware vSphere ESXi 8.0 VMware vSphere ESXi 7.0 VMware vSphere ESXi 6.0

Issue/Introduction

Symptoms:

  • You are unable to consolidate VMware VM snapshot due to file lock.
  • Backup operation on the backup application fails or is interrupted.
  • Deleting the vmdks for some cases may fail with Device or Resource busy error. 



Environment

VMware vSphere 6.x
VMware vSphere 7.x
VMware vSphere 8.x

Cause

During a backup operation, the backup application creates a snapshot of the virtual machine and mounts the base disk to the backup proxy virtual machine to copy the data. When the backup is completed, the disks are mounted back to the original virtual machine and the snapshot is deleted.

This issue occurs if the backup operation fails or is interrupted. The virtual machine .vmdk files remain mounted to the backup proxy VM with a read-only lock on the vmdk files. 

Resolution

To resolve this issue, remove the virtual machine disks from backup proxy virtual machine.

  1. Right-click the backup proxy virtual machine.
  2. Click Edit Settings.
  3. Expand all the Hard Disk(s).
  4. Identify the Hard Disk(s) which belong to the virtual machine that fails to consolidate.
  5. Remove the Hard Disk(s) identified above from the proxy virtual machine by clicking on the X beside the Hard Disk to unmount
    Caution: Do NOT select Delete files from the datastore.
  6. Click OK.
  7. Return to the original virtual machine and reattempt to consolidate the snapshots.

For more information, see Consolidate Snapshots and Add an Existing Hard Disk to a Virtual Machine (See optional note in step 2).


Note: The backup proxy VM is one or more of the backup application virtual machines. If you have multiple backup proxy virtual machines, it is necessary to check all the virtual machines as the disk (.vmdk file) in question may be attached to any of them.