Why Your Snapshot Consolidation Fails
I know this error is infuriating. You right-click, click Consolidate, and it fails with something like "Unable to access file since it is locked." This happens most often after a failed snapshot delete or when the VM's delta disk files (.vmdk or -delta.vmdk) get orphaned. On vSphere 7.0 Update 3, I've seen it happen when storage latency spikes during backup jobs.
The good news? You probably don't need to rebuild the VM. Let's start with the fix that takes 30 seconds.
30-Second Fix: Check for Running Tasks
This is the one that trips up most people. vCenter queues consolidation jobs. If another consolidation is already running, your new one will fail.
- Open the vSphere Web Client and go to Menu > Tasks.
- Look for any ongoing tasks related to your VM — especially "Consolidate virtual machine disk" or "Delete virtual machine snapshot."
- If you see one, wait for it to finish. You can also cancel it if it's stuck (right-click > Cancel Task).
- Try consolidating again.
This works about 30% of the time. If not, move to the 5-minute fix.
5-Minute Fix: Power Cycle and Retry
Sometimes the VM's snapshot chains are just in a weird state. A clean power cycle forces ESXi to release file locks. But be careful — this requires downtime.
- Shut down the VM gracefully (guest OS shutdown, not power off).
- Wait 30 seconds. Then power it back on.
- Try Consolidate again from the VM's Snapshots tab.
If the VM won't shut down (common if it's stuck), use the Force Stop option in the GUI. But I'd only do that as a last resort — it can corrupt the VM's file system. For production VMs, try SSH into the host first.
15+ Minute Fix: Manual File Cleanup on ESXi
This is the real fix when everything else fails. You'll need SSH access to the ESXi host where the VM runs.
Step 1: Identify the Problem Files
SSH into the host and find your VM's folder. Replace your-vm-name with the actual name:
cd /vmfs/volumes/datastore1/your-vm-name/
ls -la | grep -E "(delta|snapshot|consolidate)"
Look for files ending in -delta.vmdk or -1.vmdk. If you see orphaned delta files (no base VMDK), those are the culprits.
Step 2: Check File Locks
Run this to see if any file is locked by ESXi:
esxcli storage filesystem list
lsof | grep 'your-vm-name'
If you see files held by a process like hostd or vobd, the lock is real. The next step will clear it.
Step 3: Unregister and Re-register the VM
This releases all locks. It's safe — you're not deleting the VM, just removing it from inventory and adding it back.
- In vCenter, right-click the VM and choose Remove from Inventory. Don't delete files.
- Wait 30 seconds. Then go to the datastore, find the VM's folder, right-click the
.vmxfile, and choose Add to Inventory. - Power on the VM and try consolidating again.
I've seen this fix work for about 70% of cases where the simple fixes failed. If it still doesn't work, you'll need to check the snapshot chain manually.
Step 4: Manual Snapshot Chain Repair (Advanced)
Only do this if you're comfortable with SSH and VMDK files. Back up the .vmx file first.
Run this command to see the snapshot tree:
cat your-vm-name.vmsd | grep -E "^snapshot|^parent|^uid|^filename"
If the chain looks broken (missing parent entries), you can edit the .vmsd file to remove orphaned snapshot entries. But honestly, if you're at this point, the safest bet is to create a new snapshot, delete all old ones, and consolidate again.
One more thing: if your storage is NFS, check for stale NFS handles. Run esxcli storage nfs list and remount the datastore if needed. I've seen NFS lock issues cause this error on vSphere 7.0U2.
When to Call VMware Support
If none of these steps work, you probably have a corrupted snapshot chain that manual editing won't fix. Open a case with VMware. They can provide a script to re-parent the delta files. But try these first — I'd say 9 out of 10 times, one of the above solutions will get you sorted.
Pro tip: After you fix the consolidation, go to the Snapshots tab and delete any old snapshots. Keep only one or two. This prevents the problem from coming back.
Hope this helps. I've been in your shoes — it's frustrating, but you'll get through it.