VMware ESX – “Unable to access a file since it is locked”

# VMware

After transferring and/or trying to restart a VM in ESX you may be presented with the error message “Unable to access a file since it is locked”.

Now what you need to do is work out what is actually locking this file and then (unsurprisingly) find a way to unlock it. Generally the problem will be caused by one of three things.

VMware ESX Unable to access a file since it is locked

1. Process Lock: There is a process on the ESX server that still has hold of a file(s) used by the VM.  This is one of the most common causes.  To resolve this there have been a couple of good VMware Forum postings here and here that have been consolidated to this useful posting over at GabesVirtualWorld.com (*Note: It is worth checking out the comment by Kent at the bottom of the posting). Also, check out Tecumseh’s posting here.

2. Disk Naming Conflict: Two or more disks with the same VMDK name. This can be caused by another disk with the same VMDK file name being referenced by the VM.  This may have occurred due to a VM move where the VM used have disks located on different LUN’s or similar which have now been moved onto the same LUN and VM directory.  If this is the case rename one of the matching VMDK files (preferably not the one used as the boot drive) and with the VM powered down remove the renamed disk and reattach it (using its new name).

3. Corrupt VMX file: There is a possibility that the VM’s VMX file has corrupted.  You can look through the VMX file and try and troubleshoot the issue though it is quite often quicker to recreate a new VMX file.  This can be achieved by creating a new VM and attaching the existing disks to it (ie: rather than creating a new VM with new a new disk).

So here are three potential problem areas that you may want to consider when getting a “Unable to access a file since it is locked” within ESX.

 

VN:F [1.9.3_1094]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)
VMware ESX - “Unable to access a file since it is locked”, 5.0 out of 5 based on 1 rating

Related posts:

  1. VMware Workstation – “Cannot open one of the virtual disks needed by this VM because it is larger that the maximum size supported by the host file system” After moving a VMware Workstation VM from one PC to...

You can leave a response, or trackback from your own site.

4 Responses to “VMware ESX – “Unable to access a file since it is locked””

  1. Khai says:

    kill Process is file lock

    fuser -k

    [Reply]

    VA:F [1.9.3_1094]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.3_1094]
    Rating: 0 (from 2 votes)
  2. Khai says:

    fuser -k file path / file name

    [Reply]

    VA:F [1.9.3_1094]
    Rating: 5.0/5 (1 vote cast)
    VA:F [1.9.3_1094]
    Rating: +2 (from 2 votes)
  3. tt says:

    just shutdown most esx servers. add the machine from datastore to the only running esx and power it up. now you can power on all the other esx hosts

    [Reply]

    VA:F [1.9.3_1094]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.3_1094]
    Rating: 0 (from 2 votes)
  4. zinto says:

    Removed vm from inventory and re-added it – started OK then.

    [Reply]

    VA:F [1.9.3_1094]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.3_1094]
    Rating: 0 (from 0 votes)

Leave a Reply

You can add images to your comment by clicking here.

PHD Virtual - esXpress
VizionCore
TrainSignal - vSphere Pro
Veeam - Backup & Replication