Virtual machine disk consolidation fails due to the file locked by backup appliance
search cancel

Virtual machine disk consolidation fails due to the file locked by backup appliance

book

Article ID: 420243

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

  • When initiating a disk consolidation task for a virtual machine in a VMware vCenter Server, the operation may fail, preventing the successful merging of snapshot data into the base virtual disk.

    The task fails with below error:

    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 ESXi 8.x
VMware vCenter Server 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 machine's 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:

  • Identify the stale backup job for the affected virtual machine in the backup appliance and cancel it.
  • Monitor for automatic consolidation of the virtual machine disk or manually consolidate if required.
  • The successful completion of the disk consolidation will merge all snapshot files and will resolve the issue preventing other VM operations.