Academy/vSphere Foundation 9.0 Support (2V0-18.25)/Lab: VM Snapshot Consolidation & Lock File Cleanup
This lab targets VCF 9.0

Lab: VM Snapshot Consolidation & Lock File Cleanup

VCF 9.0Intermediatevcp-foundation⏱ 90 min

VVF 9.0 support lab (2V0-18.25). Built for a Holodeck VVF instance.

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

SystemUsernamePassword
vCenteradministrator@vsphere.localHolodeck documented default (Post Deployment table)
VCF OperationsadminHolodeck documented default (Post Deployment table)
Nested ESX hostsrootHolodeck documented default (Post Deployment table)

Tasks

Task 1 Consolidate snapshots and trace a file lock

Snapshot consolidation and lock file cleanup are common Day-2 support tasks. Understanding when snapshots need consolidation (parent/child disk chain mismatch) and how lock files prevent VM operations is essential for resolving stuck VMs.
Step 1

Create VM with multiple snapshots: Power on VM → Take 5 snapshots (VM → Snapshot → Take Snapshot, add name)

Step 2

VM → Snapshots → Manage Snapshots: confirm five snapshots in the tree

Step 3

Delete oldest snapshot: vCenter → VM → Snapshot → Delete Snapshot → Wait for consolidation (watch Recent Tasks)

Step 4

Check storage impact: Datastore → Monitor (or Summary) — note free space before and after consolidation

Step 5

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)

Step 6

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

Deleting snapshot files manually instead of using vCenter consolidation
Fix: Never delete .vmdk delta files manually from the datastore. Use vCenter: VM → Snapshot → Consolidate. Manual deletion breaks the disk chain and can cause data loss. If consolidation fails, collect vm-support bundle and engage Broadcom support.
Not checking for lock files when a VM fails to power on or migrate
Fix: A file lock indicates another host or process has claimed the VM's files. Common causes: previous host still holds lock after HA event, backup software holding snapshot lock, or orphaned lock from crashed hostd. Check: run vmfsfilelockinfo -p against the locked VMDK (flat, delta or sesparse file on VMFS; the .UUID.lck file on vSAN) to find the host holding the lock. VMFS volumes have no .lck files (their locks live in the VMFS metadata); .lck files exist on NFS and may be moved aside only for a powered-off VM. Otherwise release the lock by powering off the VM that holds it and rebooting the ESX host that holds the lock (Broadcom KB 314365).
Forcing VM power-off without checking for active snapshots
Fix: Force-killing a VM during an active snapshot operation (create, delete, consolidate) can leave the snapshot chain in an inconsistent state. Check snapshot status before force operations. If the VM is stuck in a snapshot operation, wait for the task to complete or timeout before forcing.
Not monitoring snapshot age as a proactive practice
Fix: Long-running snapshots let delta disks grow and add I/O overhead. vCenter's snapshot alarm trigger, 'VM Snapshot Size' (GB), is size-based and is added as a new alarm definition (Broadcom KB 375439); for age-based alerting use VCF Operations or a script that reports snapshot age. Common culprits: backup software that creates snapshots but doesn't clean them up, and manual snapshots forgotten after patching.

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

⚠ Known Pitfalls

Deleting .vmdk delta files directly from the datastore — this breaks the disk chain. Always use vCenter Consolidate.
Assuming every file lock is orphaned — identify the lock owner (vmfsfilelockinfo or the vSphere Client task) and verify no backup or HA process is actively using the VM before releasing locks; removing .lck files is documented only for NFS and only for a powered-off VM, and VMFS volumes have no .lck files (Broadcom KB 314365).

References

Was this page useful?
Type to search. ↑ ↓ to move, Enter to open, Esc to close.