vSphere/Veeam : “Unable to access file since it is locked”

Sometimes the backup infrastructure can make me crazy. Two virtual machines that run on our vCenter/ESXi infrastructure was showing me this nice error this morning: “Virtual machine disks consolidation is needed.”. This is a nice information and VMware has a pop-up menu to “Consolidate” and fix the error.

virtual_machine_disks_consolidations

The problem is that the virtual machine was crashing every time that I’ve tried to consolidate and wasn’t able to finish without the error: Unable to access file <unspecified filename> since it is locked. I asked Google and he told me a lot of thing,… but not THE solution for my problem.

Our virtual infrastructure uses VMware vCenter, NetApp VSC and Veeam Backup & Replication. These three tools can manage snapshots and this is probably source of problems.

Before going further, some general tips found when Googled:

  • Remove all snapshots of affected VM by pressing the “Delete All” button in snapshot manager
  • Try to restart the VMware Tools
  • Try to migrate the VM to another host
  • Try to reboot the first affected host (or kill the appropriate process)
  • If it’s not working, you’re probably in the same situation than me

In my case the problem was Veeam Backup & Replication. Take a look at the settings of your VM, select the hard drive and check if the file is a snapshot and not the original vmdk.

virtual_machine_disks_consolidations_hd_name

The problem is probably that Veeam has not unlocked correctly a file or was always using some files in the VM repository (we’re using NFS). To solve the problem, I completely turned off the Veeam virtual machine and I’ve tried to consolidate the broken VM again: worked !

I noticed an other problem when restarting the Veeam server, the hard drives of the broken VM was added to the settings and prevented the VM to start. Try to remove it before starting the server.

virtual_machine_disks_consolidations_too_many_hd

5 thoughts on “vSphere/Veeam : “Unable to access file since it is locked”

  1. Thanks very much for the post, logged a call with vmware and they could not fix this issue.

  2. Glad i found your article! I had an issue like this, none of the obvious solutions from veeam or vmware would work.. however just removing the disks from the veeam backup proxies (in my case) removed the lock and allowed consolidation.

    Thanks!

  3. Ah of course! Thank you!!! Apparently changing the proxy to use network mode resolves this, however I don’t get that option in the latest version of Veeam v8

  4. Amazing thanks for the post.
    When I removed the drive for the problem VM from the edit settings of Veeam everything worked again.

Leave a Reply

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

*