Unable to Consolidate VM: File is Locked

Recently i had weird case during the consolidation of one my production VM, several users reported slowness while they are working and then after had gone thru i found it had snapshot persist. Not sure why it was not deleted as supposed post the backup activity completed.

So, i raised a ticket to VMware support and we had a remote session. Upon checking we found particular VMDKs are still being attached to the backup proxy server.

Here is the command they had used during troubleshooting:

[root@esx:~]
vmware -vl
vim-cmd vmsvc/getallvms | grep -i vm_name
cd vmfs/volumes/datastore_name/vm_name/
cat vm_name.vmx | grep vmdk
vmfsfilelockinfo -p vm_name_2-000001.vmdk
vmfsfilelockinfo -p vm_name_2-000001-delta.vmdk
vmkfstools -D vm_name_2-000001.vmdk
vmkfstools -D vm_name_2-000001-delta.vmdk

ls
vmkfstools -D vm_name_2-000001-sesparse.vmdk
esxcli network nic list
lsof | grep vm_name
touch *
vmkfstools -D vm_name_2-flat.vmdk
vmfsfilelockinfo -p vm_name_2-flat.vmdk
hostname
watch -d ‘ls -luth | grep -E “flat|sesparse”‘
[root@esx:~] lsof | grep vm_name

Hope this help.

Leave a Reply

Your email address will not be published. Required fields are marked *