Lab: VM Snapshot Consolidation & Lock File Cleanup
Objectives
- Consolidate a five-snapshot chain from the vSphere Client and measure the freed datastore space
- Identify the owner of a VM file lock with vmfsfilelockinfo or, on ESX 8.0 U2 and later, from the vSphere Client task (Broadcom KB 314365)
- Explain why a stale lock is cleared on the host that holds it (power off the VM holding the lock, then reboot that host), not by deleting lock files
Prerequisites
Holodeck VVF 9.0 instance with a test VM on the vSAN datastore; SSH enabled on two ESX hosts
Lab Environment
Holodeck vSphere Foundation 9.0 instance (New-HoloDeckInstance -VVF; -vSANMode OSA by default, ESA where the physical layer supports it): vCenter managing one vSAN cluster of nested ESX hosts, plus VCF Operations. VVF has no SDDC Manager and no NSX.
Credentials
| System | Username | Password |
|---|---|---|
| vCenter | administrator@vsphere.local | Holodeck documented default (Post Deployment table) |
| VCF Operations | admin | Holodeck documented default (Post Deployment table) |
| Nested ESX hosts | root | Holodeck documented default (Post Deployment table) |
Tasks
Task 1 Consolidate snapshots and trace a file lock
Create VM with multiple snapshots: Power on VM → Take 5 snapshots (VM → Snapshot → Take Snapshot, add name)
VM → Snapshots → Manage Snapshots: confirm five snapshots in the tree
Delete oldest snapshot: vCenter → VM → Snapshot → Delete Snapshot → Wait for consolidation (watch Recent Tasks)
Check storage impact: Datastore → Monitor (or Summary) — note free space before and after consolidation
Trace a lock: with the VM running, from another host run vmfsfilelockinfo -p /vmfs/volumes/<datastore>/<vm>/<vm>-flat.vmdk (on vSAN, run it against the VM's .UUID.lck file) and read the MAC/IP of the host holding the lock; add -v <vCenter> -u <SSO user> to map the MAC to a host. On ESX 8.0 U2 and later a lock failure also shows the file-lock owner in the vSphere Client under VM > Monitor > Tasks and Events > Tasks (Broadcom KB 314365)
Discuss only, do not perform: Broadcom KB 314365 releases a stale lock by powering off the VM that holds it and rebooting the ESX host that holds the lock; removing .lck files is documented only for NFS and only for a powered-off VM, so never delete lock files while the VM might be running. Powering the VM off releases its own locks.
Validation Gate
Check: Consolidate the snapshot chain, identify the lock owner of a running VM's disk, and confirm VM operations (power on/off, vMotion) succeed
Expected: Consolidation successful (no delta disks outside Snapshot Manager); lock owner identified (vmfsfilelockinfo or the vSphere Client task); VM operations complete without errors.
Common Errors
Final Validation
Gate: every check below passes with the evidence recorded in the lab log.
✓ Snapshot tree → Five snapshots shown in Snapshots > Manage Snapshots, then the chain consolidated
✓ Datastore free space → Higher after consolidation (Datastore > Monitor or Summary)
✓ Lock owner → Owner host MAC/IP identified with vmfsfilelockinfo (or from the vSphere Client task on ESX 8.0 U2 and later)
✓ VM operations → Power on/off and vMotion succeed
Cleanup / Restore
• Delete the test VM's remaining snapshots
• Disable SSH on the ESX hosts
Design Reflection (VCDX)
Snapshot management is an operational hygiene topic in VCDX. Designs should include snapshot policy (max age, monitoring, automated cleanup) as part of the operations plan.
Requirements
- Monitor snapshot age across all VMs
- Consolidate snapshot chains when needed
- Resolve lock file issues for stuck VMs
Constraints
- Never manually delete snapshot delta files
- Lock files must be verified as orphaned before removal
- Consolidation requires sufficient datastore free space
Assumptions
- Backup software is configured to clean up snapshots after backup
- vCenter 'VM Snapshot Size' alarms cover snapshot growth, and VCF Operations or a script reports snapshot age
Risks
- Performance degradation from long-running snapshots
- Data loss from manual snapshot file deletion