Problem:

I recently had an issue powering on a VMware guest after a HA problem with one of my host, when I attempted to power on the guest I received the message “Failed to lock the file” in vCentre.

Failed to lock the file

Within the vmware.log file for the guest it gave the name of the file that was locked.

Failed to lock the file

Solution:

  • On one of my hosts I enabled and logged on as root using SSH https://kb.vmware.com/s/article/2004746
  • Running the command vmfsfilelockinfo -p with the full path of the locked file from the vmware.log file showed which host was locking the file.

vmfsfilelockinfo -p

  • I then put the host identified by vmfsfilelockinfo into maintenance mode and simply restarted it
  • The lock was then cleared and I could power on the guest