Wednesday, November 13, 2013

Remove Snapshot: unable to access file unspecified filename since it is locked


Error message "Unable to access file since it is locked appears in the Recent tasks panel.




Since the filename is unspecified, it makes it hard to figure out what the issue is.
Why did it happen? Well, first I have to tell you that something went wrong in a backup process of one of my VMs, specifically the Virtual Center Server (in my case, this is a VM). It could be ANY VM, but in this case is this one. The last time, the same issue happened with a different VM, but anyway, the problem is the same.





I figured out that the job failed, and It couldn't remove the snapshot. (VDR appliance creates a snapshot, and then copies the contents to the destination; after that, the snapshot is removed). But something went wrong, and the snapshot was not removed. It caused all future jobs also failed. I tried manually creating a snapshot for the failed VM, and then remove it, to force it to "Delete All" the unused snapshots, but the procedure failed, giving me the same error: "unable to access file since it is locked" ... mmmm, who is locking and which file ?????
I tried also moving the VM to another ESX in the cluster; restarted vmware management services; restarted the VM; restarted the ESX host itself, but no luck.
 
1) Shutdown the VDR appliance. It will free up the locked files in your VMs that were not sucessfuly backed up.

2) Manually create a snapshot in every VM with the problem, then "Delete all" snapshots, you won't get that error message again.

3) "Try" to power on the VDR (VMware Data Recovery) appliance... Oh, no, the same message again! And now, I cannot power up the Virtual Machine !

4) I found the VDR "mounts" the hard disks of the VMs it is creating the backups, so, go to the VDR, and in commands "Edit settings".

By default, the VDR has only one hard disk, but mine shows three: those two extra hard disks corresponds to the Virtual Machine the backup failed on!

Look at the hard disk description path for the first hard disk drive, and disk mode independent checkbox is not checked.



Look at the extra hard disks added to the VDR, see the hard disk description path (it corresponds to the VM that was in the process of being backed up). It also has the independent checkbox checked.





Select one by one on each of the extra hard disks and click "Remove". Be very careful here, selecting just remove, and DO NOT dele files from disk.





Also, confirm that you selected the right hard disks ! If you make a mistake, just hit Cancel and do it again.

5) Verify that you have the single and right hard disk in place.



6) Power on the (VMware Data Recovery) appliance. Problem solved !