VMware Cloud Community
hyperbart
Contributor
Contributor

Unable to access file vmdk since it is locked

Hi guys

I have a customer running vSphere 5 with ESXi 5.0.0 build 914586.

On a datastore I have a template for W2K8R2SP1-Enterprise. When I try to deploy a VM from this template it states:

"unable to access file vmdk since it is locked"

So I tried the following:

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

When connected with SSH to one of the ESXi's in the cluster, I ran the following command:

~ # vmkfstools -D /vmfs/volumes/REP-P1-MGMT01/Template-WIN2K8R2-Enterprise/Template-WIN2K8R2-Enterprise.nvram
Lock [type 10c00001 offset 93065216 v 292, hb offset 4145152
gen 263, mode 0, owner 00000000-00000000-0000-000000000000 mtime 31015 nHld 0 nOvf 0]
Addr <4, 211, 10>, gen 12, links 1, type reg, flags 0, uid 0, gid 0, mode 600
len 8684, nb 1 tbz 0, cow 0, newSinceEpoch 0, zla 1, bs 1048576
~ # vmkfstools -D /vmfs/volumes/REP-P1-MGMT01/Template-WIN2K8R2-Enterprise/Template-WIN2K8R2-Enterprise.vmsd
Lock [type 10c00001 offset 93052928 v 34, hb offset 3366912
gen 563, mode 0, owner 00000000-00000000-0000-000000000000 mtime 9694 nHld 0 nOvf 0]
Addr <4, 211, 4>, gen 6, links 1, type reg, flags 0, uid 0, gid 0, mode 644
len 0, nb 0 tbz 0, cow 0, newSinceEpoch 0, zla 4305, bs 8192
~ # vmkfstools -D /vmfs/volumes/REP-P1-MGMT01/Template-WIN2K8R2-Enterprise/Template-WIN2K8R2-Enterprise.vmtx
Lock [type 10c00001 offset 93048832 v 328, hb offset 4145152
gen 263, mode 0, owner 00000000-00000000-0000-000000000000 mtime 30959 nHld 0 nOvf 0]
Addr <4, 211, 2>, gen 4, links 1, type reg, flags 0, uid 0, gid 0, mode 100755
len 2935, nb 1 tbz 0, cow 0, newSinceEpoch 0, zla 2, bs 8192
~ # vmkfstools -D /vmfs/volumes/REP-P1-MGMT01/Template-WIN2K8R2-Enterprise/Template-WIN2K8R2-Enterprise.vmxf
Lock [type 10c00001 offset 93050880 v 29, hb offset 4145152
gen 263, mode 0, owner 00000000-00000000-0000-000000000000 mtime 28440 nHld 0 nOvf 0]
Addr <4, 211, 3>, gen 5, links 1, type reg, flags 0, uid 0, gid 0, mode 644
len 283, nb 1 tbz 0, cow 0, newSinceEpoch 0, zla 2, bs 8192
~ # vmkfstools -D /vmfs/volumes/REP-P1-MGMT01/Template-WIN2K8R2-Enterprise/Template-WIN2K8R2-Enterprise.vmdk
Lock [type 10c00001 offset 63762432 v 269, hb offset 4145152
gen 263, mode 0, owner 00000000-00000000-0000-000000000000 mtime 31103 nHld 0 nOvf 0]
Addr <4, 139, 134>, gen 137, links 1, type reg, flags 0, uid 0, gid 0, mode 600
len 516, nb 0 tbz 0, cow 0, newSinceEpoch 0, zla 4305, bs 8192
~ # vmkfstools -D /vmfs/volumes/REP-P1-MGMT01/Template-WIN2K8R2-Enterprise/Template-WIN2K8R2-Enterprise-flat.vmdk
Lock [type 10c00001 offset 93054976 v 92, hb offset 3530752
gen 19505, mode 1, owner 5134b1e4-be73111c-a642-e4115be82c43 mtime 28781 nHld 0 nOvf 0]
Addr <4, 211, 5>, gen 7, links 1, type reg, flags 0, uid 0, gid 0, mode 600
len 64424509440, nb 61440 tbz 20479, cow 0, newSinceEpoch 0, zla 3, bs 1048576

So  after looking at it, I determined that it had to be the host with a NIC  with MAC-address e4115be82c43 (which was another MAC-address  previously, but I placed the owner of the previous MAC in maintenance  mode and rebooted it).

When I look at that MAC-address  it is bound to a NIC which is not in use (as far as I can see, it is  part of a Emulex NC553i 10Gb 2-port FlexFabric).

What can I further do? I already rebooted 2 ESXi's but still no joy...

0 Kudos
3 Replies
nielse
Expert
Expert

Can you convert the template to a VM and perform a storage vmotion without problems?

@nielsengelen - http://foonet.be - VCP4/5
0 Kudos
hyperbart
Contributor
Contributor

No, that fails too.

0 Kudos
Gang_of_New_Yor
Contributor
Contributor

I had the same problem but my system was ESXi 4.1. After spending few hours with VMWare Support, could not find any thing. VMWare Support and we finally dicided that it is a corrupted -Flat.vmdk file. However, after I hanged up  with vmware support, I spend few hours and went through all of the VMs that deployed from this templete, and found out that one of the VM that was deployed from this templete, did not release the disk templete's vmdk file.

Now what you should do...

first check all of the VMs that you have depoyed using the templete on the host which has this NIC "e3115be82c43", and if any of the VMs holding the vmdk file. If you find the VM, walla, you are almost done resolveing this issue. Just remove the disk from edit setting.

then, check all VM that was deployed from this templete any other host that you may have.

Let me know !!

0 Kudos