-ctk.vmdk, -flat.vmdk) on a datastore fail.
VMware vSphere ESXi
VMware vCenter Server
An orphaned or stale virtual machine process running on an ESXi host is holding an invalid exclusive lock on the file, preventing the directory from being modified or deleted.
Identify the ESXi host owning the MAC address returned by the vmfsfilelockinfo command by matching it against the physical network adapters in the cluster.
Execute the Command: vmfsfilelockinfo -p <filename>-flat.vmdk (Note: Replace <filename>-flat.vmdk with the actual file name, such as a delta disk, snapshot, or .vmx file).
Establish an SSH session to the identified ESXi host as root.
Identify the specific World ID of the process holding the lock using the lsof command: lsof | grep <locked_file_name>
Terminate the stale process using the identified World ID: esxcli vm process kill -t soft -w <WorldID> (Note: If the soft kill fails to terminate the process, escalate the termination type to hard or force.)
Re-run the vmfsfilelockinfo command on the target file to verify the lock is now released and reports as free.
Proceed with the standard deletion of the virtual machine folder from the datastore.
For more comprehensive details on identifying lock owners across different storage types, refer to the Broadcom Knowledge Base documentation on investigating virtual machine file locks. KB: Investigating Virtual Machine file locks on ESXi Host(s)