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 like Veeam, Comvault,etc.) 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, release the external lock on the VMDK file by following these steps:

  1. Identify the stale backup job for the affected virtual machine in the backup appliance and cancel it.
  2. Navigate to the backup proxy virtual machine in the vSphere client.
  3. Right-click the backup proxy VM and select Edit Settings.
  4. Expand the list of Hard Disks and identify the disk(s) belonging to the affected virtual machine.
  5. Click the X next to the associated disk(s) to remove them from the proxy.
    • Important: Ensure the "Delete files from datastore" option is unchecked.
  6. Click OK to save the changes.
  7. Return to the affected virtual machine and initiate the Consolidate task (Right-click VM > Snapshots > Consolidate).

Additional Information

Investigating Virtual Machine file locks on ESXi Host(s)

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

To speak with a customer representative or a Support Engineer see Contact Support. Scroll to the bottom of the page and click on your respective region.