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.
VMware vSphere ESXi 8.x
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.
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.
3. Power On the Target Virtual Machine.
The removal of the disk from the conflicting VM releases the lock, allowing ExampleVM_1 to successfully acquire the necessary lock and power on.