Virtual Machine Disk Consolidation Task Fails Due to a File Lock Held by a Backup Appliance
search cancel

Virtual Machine Disk Consolidation Task Fails Due to a File Lock Held by a Backup Appliance

book

Article ID: 420243

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

  • When a disk consolidation task is initiated for a virtual machine in the vSphere Client, the operation may fail, preventing the successful merging of snapshot data into the base virtual disk.
  • The Consolidation task fails with the following error in the vSphere Client: Unable to access file since it is locked filePath: /vmfs/volumes/datastore_name/vm_name/vm_name-flat.vmdk host:hostname,host_ip mac: ['##:##:##:##:##:##'] id: ##### worldName: vmx lockMode: Read-Only
  • This error message explicitly indicates that a specific virtual machine disk (VMDK) file is inaccessible because it is currently held under a Read-Only lock by an external process.

Environment

VMware vCenter Server 8.x
VMware vSphere ESXi 8.x

Cause

This condition occurs when a data protection application (such as a backup or replication tool) fails to release the lock on the virtual machines virtual disk file if a backup job is abruptly interrupted, stalls, or fails to complete its exit routine.

Resolution

To successfully complete the disk consolidation task, the external lock on the VMDK file must be released. Follow these steps to resolve the issue:

  1. Identify the stale backup job for the affected virtual machine in the backup appliance and cancel it.

  2. Release the orphaned file lock held by the backup proxy virtual machine:
    • Navigate to the backup proxy virtual machine via the vSphere Client.
    • Right-click the affected virtual machine > Edit Settings
    • Expand each disk and look for references to the affected virtual machine.
    • Click the ‘X’ next to the associated disk(s).
      •  Important: Ensure not to select “Delete files from datastore
  3. Monitor for automatic consolidation of the virtual machine disk, or manually consolidate the disks.

Additional Information

After completing a VM backup, the virtual machine fails to power on