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.
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.
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.