I hope this is an useful article if you are working with VMware Virtual Machine snapshots or snapshot base backups, it is very common requirement to identifying the VMware Virtual Machine file locks when there is a failure of a host, storage or a snapshot. Disks or any other can be locked in such incidents and this is a quick and easy way to identify the owner of the file lock, which means who is not letting your to power up the Virtual Machine from a failure.
I used this method in vSphere 6.x environments and it saved my life a lot, and I hope the same for you.
You can use below command to easily identify the lock owner.
vmfsfilelockinfo -p /vmfs/[path_to_file]
Let’s assume that you lost your vCenter connectivity and you need to find the Virtual Machine file location, use easy find command
find / -name "[vmfile]"
Then execute the vmfsfilelockinfo -p command along with the obtained output (full path to the file)
See my below output, I had to blurred few places due to some reasons
Of course, you can use the vmkfstools -D /vmfs/[path_to_the_file] command, but in few situations it didn’t gave the output as I expected. But this vmfsfilelockinfo perfectly worked!
This might be just a small post, but I hope it’s a useful tip to all of my fellow readers and followers.
MavDecember 9, 2020
it works great!!! thanks for spending the time to post the info here and help the community!!
Aruna LakmalJanuary 17, 2021
Thanks Mav. Appreciate the comment!!