VMware Snapshot Management
At a glance#
- Purpose: Take, verify, consolidate and remove VM snapshots safely, and recover from snapshot-related datastore problems.
- Applies to: VMware vSphere 7.0 and 8.0.
- Risk: High — forgotten snapshots fill datastores and can halt every VM sharing them.
- Time: 10 minutes to take; consolidation can run for hours.
Overview#
A snapshot freezes a VM's disk at a point in time and redirects all new writes to a delta file. It is the standard safety net before a patch, upgrade or risky change.
It is not a backup. A snapshot depends on the original base disk — if that is lost or corrupted, the snapshot is worthless. It protects against a bad change, not against storage failure.
Warning: Snapshots grow without limit until the datastore fills. A full datastore suspends every VM on it, not just the one with the snapshot. This is the most common self-inflicted production outage in a virtual estate.
Key facts:
- Delta files grow with write volume, not VM size. A busy database can add hundreds of GB in a day.
- Performance degrades as the chain lengthens. Never exceed 2–3 snapshots per VM.
- Snapshots of VMs with independent or RDM disks do not capture those disks.
- Deleting a snapshot commits its changes — it does not discard them. Reverting discards.
Policy#
| Rule | Value |
|---|---|
| Maximum age | 72 hours |
| Maximum per VM | 3 |
| Memory snapshots | Only when a rollback must preserve running state |
| Naming | CHANGE-REF - purpose - your name |
| Before taking | Confirm the datastore has free space of at least the VM's provisioned size |
Before you start#
- vCenter access with snapshot privileges.
- Datastore free space checked.
- A named reason and a planned removal time.
Check free space first:
Get-VM 'web01' | Get-Datastore |
Select-Object Name, @{N='FreeGB';E={[math]::Round($_.FreeSpaceGB,1)}},
@{N='FreePct';E={[math]::Round(($_.FreeSpaceGB/$_.CapacityGB)*100,1)}}Warning: Do not take a snapshot when the datastore is below 20% free. Consolidation itself needs working space, so a low-space datastore can leave you unable to remove the snapshot you just created.
Taking a snapshot#
vSphere client#
Right-click the VM → Snapshots → Take Snapshot
- Name:
CHG-1042 - pre kernel patch - anup - Description: what is being changed and how to roll back
- Snapshot the virtual machine's memory: usually unticked
- Quiesce guest file system: ticked if VMware Tools is installed and the VM runs a database
PowerCLI#
New-Snapshot -VM 'web01' `
-Name 'CHG-1042 - pre kernel patch - anup' `
-Description 'Rollback point before kernel 5.15 upgrade. Remove by 2026-08-05.' `
-QuiesceWith memory state, for a rollback that must resume mid-operation:
New-Snapshot -VM 'web01' -Name 'CHG-1042' -MemoryNote: Memory snapshots take much longer, briefly stun the VM, and consume space equal to its allocated RAM. Only use them when the guest cannot be cleanly restarted.
Finding and reporting on snapshots#
The report that prevents outages. Run it weekly at minimum:
Get-VM | Get-Snapshot |
Select-Object VM, Name, Created,
@{N='AgeDays';E={[int]((Get-Date) - $_.Created).TotalDays}},
@{N='SizeGB';E={[math]::Round($_.SizeGB,2)}},
Description |
Sort-Object AgeDays -Descending | Format-Table -AutoSizeOnly those breaching the 72-hour policy:
Get-VM | Get-Snapshot |
Where-Object { $_.Created -lt (Get-Date).AddHours(-72) } |
Select-Object VM, Name, Created, SizeGB |
Sort-Object CreatedTotal space consumed by snapshots:
$total = (Get-VM | Get-Snapshot | Measure-Object -Property SizeGB -Sum).Sum
"Total snapshot space: {0:N1} GB" -f $totalRemoving a snapshot#
Removing commits the delta into the base disk. The VM keeps all changes made since the snapshot was taken.
vSphere client#
Right-click VM → Snapshots → Manage Snapshots → select → Delete
Delete All consolidates every snapshot in the chain and is normally what you want once a change is confirmed good.
PowerCLI#
# one snapshot
Get-VM 'web01' | Get-Snapshot -Name 'CHG-1042*' |
Remove-Snapshot -Confirm:$false
# all snapshots on a VM
Get-VM 'web01' | Get-Snapshot | Remove-Snapshot -Confirm:$false
# everything older than 7 days - review first
Get-VM | Get-Snapshot |
Where-Object { $_.Created -lt (Get-Date).AddDays(-7) } |
Remove-Snapshot -WhatIfWarning: Run bulk removal with -WhatIf first, every time. Removing snapshots across the estate simultaneously generates heavy storage I/O and can affect production performance.
Removal is not instant. A large delta can take hours, and the VM may become sluggish while it runs. Schedule it outside business hours.
Reverting to a snapshot#
Reverting discards everything since the snapshot was taken.
Set-VM -VM 'web01' -Snapshot (Get-Snapshot -VM 'web01' -Name 'CHG-1042*') -Confirm:$falseWarning: Every change since the snapshot is lost — including database writes, log entries and received mail. On a mail or database server, reverting is almost never the right answer. Confirm with the service owner first.
The VM is powered off during a revert unless the snapshot included memory state.
Consolidation#
vSphere sometimes leaves orphaned delta files after a failed removal. The VM summary then shows a "Virtual machine disks consolidation is needed" warning.
Find affected VMs:
Get-VM | Where-Object { $_.ExtensionData.Runtime.ConsolidationNeeded } |
Select-Object NameConsolidate:
(Get-VM 'web01').ExtensionData.ConsolidateVMDisks()Or in the client: Right-click VM → Snapshots → Consolidate.
Note: Consolidation warnings are easy to ignore and should not be. The delta files are still growing, and the snapshot manager shows nothing — so the space disappears with no visible cause.
Verification#
After taking a snapshot:
Get-VM 'web01' | Get-Snapshot | Select-Object Name, Created, SizeGBAfter removal, confirm none remain and no consolidation is pending:
Get-VM 'web01' | Get-Snapshot
(Get-VM 'web01').ExtensionData.Runtime.ConsolidationNeededThe first should return nothing; the second should return False.
Confirm the datastore recovered its space:
Get-VM 'web01' | Get-Datastore | Select-Object Name, FreeSpaceGBCheck within the guest that the application is healthy after consolidation — heavy I/O occasionally upsets latency-sensitive services.
Emergency: datastore full because of snapshots#
If a datastore has filled and VMs are suspended:
- Identify the largest offenders.
Get-Datastore 'DS01' | Get-VM | Get-Snapshot |
Sort-Object SizeGB -Descending |
Select-Object -First 10 VM, Name, Created, SizeGB- Free space immediately — migrate a powered-off VM to another datastore, or delete a known-disposable VM. Consolidation itself needs headroom.
- Remove the largest snapshot first. It reclaims the most and takes the longest, so start it early.
- Resume suspended VMs once free space is comfortable.
- Afterwards, set a datastore alarm at 80% and schedule the weekly snapshot report.
Troubleshooting#
| Symptom | Cause and fix |
|---|---|
| Removal appears to hang | Normal for large deltas. Check task progress in vCenter; do not cancel. |
| "Unable to access file since it is locked" | Another task or a backup job holds the disk. Wait for it, then retry. |
| Consolidation needed but fails | Insufficient free space. Free space on the datastore first. |
| Snapshot missing from Snapshot Manager but deltas exist on disk | Orphaned deltas. Run consolidation. |
| VM very slow with a snapshot present | Expected — all writes go through the delta. Remove the snapshot. |
| Quiesce fails | VMware Tools missing, outdated, or the guest has no VSS writer. Snapshot without -Quiesce, accepting a crash-consistent copy. |
| Snapshot did not capture a disk | That disk is independent or an RDM. Those are excluded by design. |
| Datastore full, VMs suspended | Follow the emergency procedure above. |