Run this script :

https://www.vmadmin.co.uk/resources/48-vspherepowercli/251-powerclinetworkoutputcsv

That gets you all the mac addresses for the hosts in the cluster.

Now follow what is in this KB:

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051

vmkfstools -D /vmfs/volumes/UUID/VMDIR/LOCKEDFILE.xxx

run that on the vmdk file you cant delete you’ll get an output like

Lock [type 10c00001 offset 233148416 v 1069, hb offset 4075520

gen 57, mode 1, owner 570d1952-3933cca0-906d-bc305bf57cf4 mtime 8947925

num 0 gblnum 0 gblgen 0 gblbrk 0]

Addr <4, 552, 50>, gen 1050, links 1, type reg, flags 0, uid 0, gid 0, mode 600

Now match value in RED  against the list you have in that csv output you got earlier.
You will find the host that maintains the lock, log onto that host and see if there is a VM in an unknown state, if there is…… delete it.
If not log into the datastore from this host and delete the lcoked file and you should be able to just fine.

Comments are closed.

Post Navigation