Home Resources ESX and ESXi Server
Releasing Locked Files in a VMFS Volume Print E-mail

When files are in use they are locked to prevent modifying by anything else. In a VMFS volume sometimes these files stay locked even when they are not in use (possibly when a VM was not stopped properly). This doesn't happen often, but it can be annoying when it does and you will get a busy, locked or in use error. To fix this you need to release the lock on the file.

Logon to the ESX Server that was last running the VM.

Dump the log information:
vmkfstools -D /vmfs/volumes/path/to/myvm1

Check the log:
less /var/log/vmkernel
...
Dec 15 14:31:34 vm19 vmkernel: 1:02:11:14.325 cpu3:1038)Lock [type 10c00001 offset 30439424 v 21, hb offset 4154368
Dec 15 14:31:34 vm19 vmkernel: gen 37671, mode 1, owner 2a3b5a3-cb2591a3e-b657-e18b9e6d24b6 mtime 8781867]
...

The owner locking the file is on the line where it says owner "owner 2a3b5a3-cb2591a3e-b657-e18b9e6d24b6". Get the last part of that hex value "e18b9e6d24b6".

Find the system UUID of all the ESX Servers so you know which one is locking it:
esxcfg-info | grep -i 'system uuid' | awk -F '-' '{print $NF}'
ps -elf | grep myvm1
/usr/lib/vmware/bin/vmkload_app /usr/lib/vmware/bin/vmware-vmx should have a lock on the VMs file.

 

Kill the master user world id (vmid):

 

cat /proc/vmware/vm/*/names | grep myvm1

less /proc/vmware/vm/ value/cpu/status

/usr/lib/vmware/bin/vmkload_app -k 9 vmid#

 


Failing that crash the VM and get the logs (run in a directory with some space to spare):
vm-support -x
vm-support -X vmid#



 

        
            

      

 

DISCLAIMER: All advice, tips, guides and other information on this website is provided as-is with no warranty or guarantee. While most information is correct to the best of my knowledge, I am not reponsible for any issues that may arise in using the information, and you do so at your own risk. As always before doing anything; check, double check, test and always make a backup.

 

Help VMadmin

All resources on this site are provided absolutley free. However it takes time and money to keep the site running. If any information has been helpful to you or your company, and you wish to make a donation to help keep VMadmin.co.uk running you can do so via paypal, and it would be much appreciated.

Click to donate to VMadmin.co.uk via paypal.