Backup & Recovery

 View Only
Expand all | Collapse all

Disk consolidation for VM has failed: Unable to access file since it is locked

  • 1.  Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 16, 2020 12:58 PM

    Last evening we restarted receiving the error message on one of our VM's that Disk consolidation for VM has failed: Unable to access file since it is locked

    Disk consolidation fails with the same error message. I checked and there are no snapshots for this particular VM, although we do use VEEAM as a backup solution.

    So far I have tried the following.


    Restarting the vpxa service

    Restarting Mgmt services (/etc/init.d/hostd restart and services.sh restart)

    Restarting the Veeam Backup and Replication console and backup proxies.

    examining /var/log/hostd.log for any locked .vmdk files while running disk consolidation

    I haven't been able to reboot the ESXi host or machine it's self, nor am I sure that will do much.

    Does anyone have any suggestions?

    Many Thanks!

    Erik



  • 2.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 16, 2020 01:46 PM

    Find out who holds the lock and remove it according to this KB.



  • 3.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 16, 2020 02:29 PM

    Running

    vmfsfilelockinfo -p /vmfs/volumes/574f021

    9-de7758c4-5ce9-f48e38c19d8e/[VM]/[VM-NAME]-000021-delta.vmdk

    I found 21 delta vmdk, some locked in read-only mode, others locked in exclusive mode. The offending MAC address belongs to the Virtual NIC attached to your Veeam backup server. There's a replication job running currently, but once that's done I'm going to try and reboot the Veeam server. Barring that, according to the KB, my options are to migrate the VM to the offending ESXI host (which is the one holding the lock) or restart the host itself. Is there really no other way to remove the file lock without rebooting the entire host?



  • 4.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked
    Best Answer

    Posted Jul 16, 2020 03:42 PM

    ... but once that's done I'm going to try and reboot the Veeam server.

    Also check whether the Veeam Backup server, or one of its proxies (if used) still have hot-added virtual disks/snapshots from the VM in question attached. If so, remove them (do not select the delete form disk option!)

    André



  • 5.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 16, 2020 03:57 PM

    Thanks André! That was it. Removing the stuck hot-added disk from one of the proxies removed the lock and let me consolidate :smileyhappy:



  • 6.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Mar 17, 2021 12:59 PM

    I had a system that I couldn't consolidate due to a locked file. We use Acronis and after verifying the Acronis Appliances did not have a lock on the system and after powering off and migrating, etc., etc. I removed it from inventory and re-registered the .vmx file and I was able to consolidate the disk. That was after running command line commands to check for locked files of which it said there weren't any. Last resort is to remove from inventory and register the .vmx file that will get you back in operation.



  • 7.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 03, 2021 04:48 AM

    Where in Veeam can you check if the proxy is holding a snapshot?



  • 8.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 03, 2021 01:22 PM

    Not in veeam.... just check the VM Settings within vSphere Client for your Virtual Proxy VM.

    Regards,
    Joerg



  • 9.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Feb 28, 2024 07:18 PM

    hi 

    How do you remove the stuck hot-added disk?   

    thanks

    Phil



  • 10.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Feb 28, 2024 07:27 PM

    Just open the VM settings of the given Veeam Proxy, expand the list of "harddisk" and search for the one which was sticked on the proxy.  If youre sure that the Backup isnt running any more remove the disk from the VM.   Dont tick the check box "delete from disk".

    After that the consolidation function should be able to merge/commit the snapshot data back into the original vmdk.

    Regards,
    Joerg

     



  • 11.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 03, 2021 04:46 AM

    Where in Veeam can you check if a proxy is holding a snapshot or disk

     

     



  • 12.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Feb 28, 2024 07:13 PM

    I have similar issue with veeam.  I do see the proxy has additional hot-added virtual disk.  What is the proper way to remove it and what do you mean when you said (do not select the delete form disk option!)?



  • 13.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 07, 2021 09:09 AM

    I accomplish this using the following.

    I did shutdown to Veeam backup server. Then made a consolidation. It worked.



  • 14.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jan 24, 2022 07:48 AM

    the easiest solution of them all. Worked like a charm. Thank you very much.



  • 15.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 25, 2022 08:12 AM

    Can't believe I didn't even try this first time round, I was off doing the more advanced fixes!

    For anyone back at this post, try this step first!

     

    Thanks a lot!



  • 16.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Jul 25, 2022 08:48 AM

    Thats a bad decision because there is a chance for more trouble. For sure the esxi will now able to consolidate the vDisk because you have shutdown the last VM which holds the lock on the vmdk because the proxy was not up and running any more and released the lock from the base disk.

    This may ends up in a situation where you have 2 VMs referring to the same VMDK.

    This problem are facing all backup solutions which use the hot add method aka a temporarily mount of a base vmdk on a 2nd. VM (proxy). I see it more often on undersized or very busy systems.

    Speaking of Veeam you need to know that when Veeam BR Server is running as a VM the "proxy" role is part of the default installation.

    Regards,
    Joerg



  • 17.  RE: Disk consolidation for VM has failed: Unable to access file since it is locked

    Posted Aug 09, 2022 10:30 AM

    Snapshot can be created by third-party software during backup. Some snapshots did exist but you can't find it. One of the solution is manually creating one snapshot and then select Deleting All Snapshots.

    By the way, we use Vinchin Backup & Recovery as our solution, and it also works well in our IT environment.