VMware vCenter error “Unable to access file since it is locked” during disk consolidation solved

My setup consists of a vCenter 6 appliance and VMware’s Data Protection (VDP) 6 appliance. Every day there is a scheduled job that backup differentially all the VMs in our organization. Unfortunately this does not work always smoothly, as I would like to. One day I came across the “Unable to access file since it is locked” error. The first encounter was a failed log of VDP appliance on my e-mail inbox, but I am used to logs like this since as I said VDPA does not work always smoothly. So I logged into vCenter web client, connected to Data Protection appliance and re-runned the failed job for the outdated VMs. Unfortunately the job failed again!

Then I noticed an error message on my vCenter client saying “virtual machine disks consolidation needed”.


ok, I said. It seemed that the backup job did not delete the backup snapshot, let’s wipe it out manually. I got into the snapshot manager window and pressed the “Delete All” button and after a few minutes a new error message appeared.


Pressing the “Consolidate” button did not solved the problem neither. It seemed that the problem is bigger than I first thought. The  events on the problematic VM matched with the whole picture of the problem.


My internet searches were not fruitful. I guessed that the VDP appliance was root of the problem, so I shut it down and tried to delete all the snapshots of the problematic VM. Voila, I was near the solution, since the virtual disks consolidated into one disk and the VM properties disk file linked to the right vmdk file.


Browsing the datastore of the VM I noticed that an old differential disk file was not deleted (it is the vmdk file that it’s filename ends with a number). This was the causing trouble virtual disk.


I wiped it out by right clicking the vmdk file on the datastore browsing window. I restarted the VM to check that everything is ok.

Then I powered on the Data Protection Appliance but it failed to boot up correctly with the following error:


This was the root of the problem, VDP appliance had mounted the problematic virtual disk, that’s why this file was locked on the VM. By editing the VDP appliance properties, I deleted the mounted virtual disk that belonged to my problematic VM and left only the four default virtual disks of the appliance.


The appliance powered on smoothly and I checked that the services were up and running via VDPA’s console.

Job automation is good when it does not fail! If it fails it causes only troubles. Good luck!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s