In the event an ESXi host abruptly shuts down due to hardware failure, rebooting the host may not be an option to release the locks on VM files.
VMware vSphere ESXi 7.0.x
VMware vSphere ESXi 8.0.x
ESXi host unable to reboot and communicate with storage to release locks on VM files.
Follow the steps in KB 314365 to confirm the locks are by the failed ESXi host, or if the VM was possibly rebooted and running on a different host.
If the locks are still by the failed host, do the following to remove the vmx lock and register the VM on an accessible host.
Create directory “bkup” in the VM folder with "mkdir bkup
".
Move the "####.vmx.lck" lock file(s) with “mv ####.vmx.lck bkup”.
Confirm file has been moved and listed in “bkup” folder with “ls -lah bkup
”.
vCenter may not allow registering the VM on different host with error stating VM with same name already exists.
Log into vSphere client of an accessible ESXi host.
Register the VM.
Once the VM is powered on, the vCenter should see the VM is now registered on different host and update its database with the change.