VM Power-On Failure caused by Hard Disk Locking Conflict
search cancel

VM Power-On Failure caused by Hard Disk Locking Conflict

book

Article ID: 419203

calendar_today

Updated On:

Products

VMware vSphere ESXi 8.0

Issue/Introduction

When attempting to power on a virtual machine from either the vCenter or the ESXi host, the operation fails with the following error message:
"Unable to access file /vmfs/volumes/datastore_name/ExampleVM_1/ExampleVM_1-flat.vmdk KB 2107795 filePath: /vmfs/volumes/datastore_name/ExampleVM_1/ExampleVM_1-flat.vmdk host: hostname,Host IP mac: ['##:##:##:##:##:##']"

The vmware.log will report below errors:

<YYYY-MM-DD>T<time> In(05)+ vmx - Power on failure messages: Locking conflict for file "/vmfs/volumes/datastore_name/ExampleVM_1/ExampleVM_1-flat.vmdk". VMFS on-disk lock owner is host with MAC address ########-########-####-############ and VMFS lock mode 0x1.
<YYYY-MM-DD>T<time> In(05)+ vmx - Locking conflict for file "/vmfs/volumes/datastore_name/ExampleVM_1/ExampleVM_1-flat.vmdk". Kernel open flags are 0x8. Owner process on this host is world ID 123456 with world name vmx-vthread-210:ExampleVM_2.
<YYYY-MM-DD>T<time> In(05)+ vmx - Failed to lock the file
<YYYY-MM-DD>T<time> In(05)+ vmx - Cannot open the disk '/vmfs/volumes/datastore_name/ExampleVM_1/ExampleVM_1-flat.vmdk' or one of the snapshot disks it depends on.
<YYYY-MM-DD>T<time> In(05)+ vmx - Module 'Disk' power on failed.
<YYYY-MM-DD>T<time> In(05)+ vmx - Failed to start the virtual machine.

Environment

VMware vSphere ESXi 8.x

Cause

The underlying issue is a lock being held on the VMDK file by an unintended process, typically another running or registered VM. 
In this scenario, ExampleVM_2 is holding the lock on the disk file belonging to ExampleVM_1, usually because the disk was accidentally attached as an additional hard disk to ExampleVM_2.

Resolution

Please detach the disk file (ExampleVM_1-flat.vmdk) from the VM that is currently holding the lock (ExampleVM_2) by following the below steps:

1. In the vSphere Client, locate the conflicting virtual machine (e.g., ExampleVM_2) and select Edit Settings.

2. Remove the Locked Hard Disk.

  • Expand the hard disks tab in the Edit Settings.
  • Identify the hard disk entry that uses the path of the failing VM's disk (e.g., the disk referencing ExampleVM_1-flat.vmdk).
  • Click the vertical ellipsis icon next to that specific hard disk to remove it.
  • Ensure you select "Remove device" (which removes the device from the VM configuration) and do not select "Remove device and data", as you need the VMDK file for ExampleVM_1.
  • Click OK to apply the changes and close the Edit Settings window for ExampleVM_2.

3. Power On the Target Virtual Machine.

  • Locate the original virtual machine (ExampleVM_1) that previously failed to start.
  • Right-click the VM and select Power > Power On.

The removal of the disk from the conflicting VM releases the lock, allowing ExampleVM_1 to successfully acquire the necessary lock and power on.