vSphere 6.5

VMware Disk Consolidation unable to access file since it is locked

If you run into the VMware Disk Consolidation unable to access file since it is locked error, it may be a host management agent issue, let's see

I wanted to write up a quick post concerning an error I received recently with consolidating disks on a few VMs. ย Disk consolidation is needed when snapshot disks fail to compact after a Delete or Delete All operation or if the disk did not consolidate. ย Sometimes a snapshot deletion doesn’t commit back to the base disk. ย I had this warning in the summary of a particular VM I was working with recently. ย However, when running the consolidate operation an ominous error presented – VMware disk consolidation unable to access file since it is locked. ย Let’s take a look at this issue and how it was resolved in my case.

VMware Disk Consolidation unable to access file since it is locked

As mentioned above, in logged into the web client recently I saw a virtual machine that was presenting with the warning thatย Virtual machine disks consolidation is needed. ย In looking at the issue initially my suspicion is the deltas were not committed in a backup software run that went down dirty perhaps.

consolidate01

Most know where to find this, but in case you didn’t know, you have theย Consolidateย option under yourย Snapshots menu. ย Here you see it greyed out as this particular VM doesn’t need disk consolidation.

consolidate02b

The error I ran into was the below error. ย When I kicked off theย Consolidate process, it came back with aย Unable to access file since it is locked error.

consolidate02

Resolution

There is a pretty helpful VMware KB article onย Unable to delete the virtual machine snapshots issue. ย One of the troubleshooting steps therein was toย restart the management agents on the particular host the VM is running on. ย It can be that the host has a lock on the disk files in question. ย Thinking this could be the culprit, this is exactly what I did. ย You can do this from the command line of the ESXi host itself by running the command:

services.sh restart

consolidate03

After restarting the management agents of the host the particular VM was running on, I was able to successfully run the consolidation process and delete the delta disks.

Thoughts

Snapshot delta disks are definitely a great tool to have when you need them and also the common way that most modern VMware backup software applications are able to grab quick and effective backups. ย However, they can also be a sticky situation as well if you have a situation where you have orphaned delta disks as in my situation here. ย This can happen as it did with me if you have a backup go down dirty or not commit snapshot changes correctly. ย If you try and consolidate the delta disks and see theย VMware Disk Consolidation unable to access file since it is locked error, restarting the management agents may do the trick as the host can have a lock on the files and prevent consolidation.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.