VMware Cloud Community
wopfather
Contributor
Contributor

Unable to access File since it is locked. Error

I have a VM Template that i am trying Deploy to a new machine, but the deploy tasks errors out with "A File was not found" error. I converted the template back into a VM and tried to start it and got the error "Unable to access a file since it is locked" How do i find the locked file and unlock it?

Reply
0 Kudos
10 Replies
Rob_Bohmann1
Expert
Expert

The command to run to list open files is

#lsof |grep servername in this case the server name is LINWWD2

here is an example the processes listed in italics are the ones causing

the problem. Usually, if you kill the first, you can then start your vm.

# lsof |grep LINWWD2

vmware-vm 21665 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

vmware-vm 21665 root 3u REG 8,2 123022 652805 /home/vmware/LINWWD2/vmware.log

vmware-mk 21668 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

vmware-mk 21668 root 14u REG 8,2 123022 652805 /home/vmware/LINWWD2/vmware.log

vmware-vm 22255 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

vmware-vm 22255 root 3u REG 8,2 123022 652805 /home/vmware/LINWWD2/vmware.log

vmware-vm 22256 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

vmware-vm 22256 root 3u REG 8,2 123022 652805 /home/vmware/LINWWD2/vmware.log

vmware-vm 22259 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

vmware-vm 22259 root 3u REG 8,2 123022 652805 /home/vmware/LINWWD2/vmware.log

vmware-vm 22260 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

vmware-vm 22260 root 3u REG 8,2 123022 652805 /home/vmware/LINWWD2/vmware.log

bash 22743 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

lsof 22831 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

grep 22832 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

lsof 22833 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

So kill -9 the first process # and then list again

# kill -9 21665

# lsof |grep LINWWD2

bash 22743 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

lsof 23989 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

grep 23990 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

lsof 23991 root cwd DIR 8,2 4096 652801 /home/vmware/LINWWD2

Reply
0 Kudos
TristanT
Contributor
Contributor

I'm experiencing the same problem and symptoms.

http://communities.vmware.com/thread/157356?tstart=0

Very frustrating!!!

Reply
0 Kudos
Modrus
Contributor
Contributor

Did you ever find a fix for this? I'm having the exact same issue.

Thanks

Reply
0 Kudos
Bas_Dorland
Enthusiast
Enthusiast

Did you check if no other vm is using the disk, properly the last vm you deployed?

Regards,

Bas

Reply
0 Kudos
tbn7
Contributor
Contributor

We had a similar issue. We were upgrading an ESX server. Migrated certain machines off the ESX (blade) server. After the upgrade we tried powering it back on and go the same error. The VM with the error is part of a cluster with two VM nodes. We realized that both nodes were on the same ESX server. We migrated one to another ESX server and we were able to power the VM back up without the error.

Reply
0 Kudos
dkraut
Enthusiast
Enthusiast


Same problem here.... I Deployed from template and selected experimental option = change disk size and everything seemed to go fine, until I tried to deploy the next VM!  That's when I received the error, "Unable to access file".  I initially thought about simply deleting the lastly created vm, but that would have likely destroyed my template since that vm thought it was associated with the templates vmdk file (you can verify this by looking at the vm settings, "edit settings" Hard Disk properties). I was able to resolve by editing the lastly created vm's .vmx file so that it pointed to its own .vmdk file instead of the template vmdk.  I then removed the lastly created vm from inventory and then added it back to refresh the edited vmx file.  I then deleted it now that it no longer pointed to the template vmdk file.  I then deployed from template again, this time making sure NOT to use any "Experimental" options.  All seems well now.  Smiley Happy

Reply
0 Kudos
GuilhermeStela
Enthusiast
Enthusiast

I have a similar issue in another thread and make a lot of procedures to resolve.

http://communities.vmware.com/message/2023807#2023807

I hope it helps.

Reply
0 Kudos
online11
Contributor
Contributor

Please try this. It will fix the issue.

VMWARE: Unable to access file since it is locked

Reply
0 Kudos
csuwarnk
Contributor
Contributor

I'm experiencing the same problem

i have did the Svmotion and issue got fixed

try it and check

Reply
0 Kudos
vicenac
Contributor
Contributor

I had success by just migrating the VM to another datastore through vCenter. After that I asked for all snapshots to be deleted and consolidation. All happened very quickly in vCenter and browsing the datastore showed that the disks were made of many large files. I logged on the host and asked for consolidation there. That took a long time and all disks were consolidated fine.

Reply
0 Kudos