Use it when deleting/removing snapshots, reducing chain depth or completing checkpoint cleanup, while planning for temporary I/O, time and capacity overhead.
Snapshot Merge
Snapshot Merge reduces a snapshot/checkpoint dependency chain by copying or reconciling changed blocks into another layer according to platform rules, then updating metadata so the removed layer is no longer required.
1. Deleting a snapshot merges its changes into the parent.
2. Merging large deltas takes time and I/O.
3. Needs free space.
4. Don't interrupt.
5. Check for leftover files.
delta → merge into parent → chain shortened
Run representative workload/regression checks and confirm expected free-capacity reclamation.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
It does not show all application data is semantically correct or that unrelated snapshots/storage paths are healthy.
Next check: Run representative workload/regression checks and confirm expected free-capacity reclamation.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
delete/merge intent → capacity check → merge I/O → metadata commit → chain rescan → guest workload test
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Deleting a snapshot can trigger a merge; the data represented by that snapshot is not necessarily discarded.
- Merge can be I/O-intensive and may take significant time after the user-visible delete request.
- Interrupting or manually altering files during merge can corrupt chain relationships.
- Merge complete ≠ guest application healthy; verify the active disk and workload afterward.
virsh blockcommit <vm> vda --active --pivot— merge active layer (libvirt)qm delsnapshot <vmid> <name>— delete = merge (Proxmox)Remove-VMSnapshot <vm> -Name <n>— Hyper-V merge
ReferenceWhat it is1 section · depth on demand
How merging works
Deleting a snapshot writes the delta's changed blocks into its parent. Large deltas take long and add I/O; the VM keeps running (live merge). Ensure enough free space: the merge can temporarily need the size of the delta.
ReferenceImportant terms & boundaries3 sections · depth on demand
What this shows and what it does not
Snapshot delete requested ≠ merge completed ≠ chain healthy ≠ application verified.
Exact online/offline merge algorithms are platform and image-format specific.
In depth
External snapshot chains and why they need merging
An external snapshot freezes the current disk as a read-only backing file and sends new writes to an overlay. Every further snapshot adds another layer:
base.qcow2 ← snap1.qcow2 ← snap2.qcow2 ← (active)
The libvirt state-capture guide notes that external snapshots are fast when memory is not saved, and that virDomainBlockCommit() folds the overlay back into the original image — the standard way to finish a temporary snapshot (for example after a backup).
Merge the active layer back into the base (live)
# virsh domblklist web01
Target Source
--------------------------------------------
vda /var/lib/libvirt/images/web01.snap-backup
# virsh blockcommit web01 vda --active --pivot --verbose
Block commit: [100 %]
Successfully pivoted
# virsh domblklist web01
vda /var/lib/libvirt/images/web01.qcow2
# virsh snapshot-delete web01 --metadata snap-backup
--pivot switches the running VM to the base image when the copy is complete. Afterwards the overlay file can be deleted.
Choosing commit vs. pull
| Operation | Direction | Use |
|---|---|---|
blockcommit | Overlay → base | Usual case: discard the snapshot point, keep current state |
blockpull | Base → overlay | Make the overlay independent (base can be removed) |
Internal qcow2 snapshots and storage snapshots (ZFS, LVM-thin, RBD) are merged by deleting the snapshot: qm delsnapshot 101 before-upgrade. On qcow2 a large snapshot delete rewrites metadata and can take time; on ZFS it is near-instant.
Risks
| Risk | Mitigation |
|---|---|
| Not enough free space during commit | Base grows by the overlay's changed blocks — check qemu-img info sizes first |
| Commit interrupted | Chain stays consistent; retry blockcommit |
| Long chains left for months | Performance loss and complex recovery — merge snapshots within days |
*The external snapshot chain and block-commit progress above are illustrative examples, not captured from a lab or production host.*
Worked example
Merging (deleting/committing a snapshot) writes delta blocks back into the parent. Time is proportional to the delta size and the storage's write rate; the VM may stun briefly at the end.
Worked example: a snapshot left for two weeks on a database VM grew to 300 GB. At 200 MB/s effective merge rate that is ~25 minutes of heavy I/O on the datastore, plus temporary extra space on some platforms. Delete snapshots promptly to keep merges small, and merge large ones off-peak.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Snapshots & Checkpoints → Snapshot Merge. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Snapshots & Checkpoints → Snapshot Merge reference map
Fast snapshot/checkpoint boundaries for Snapshots & Checkpoints → Snapshot Merge.
| Boundary | Meaning | Evidence limit |
|---|---|---|
| Request | Remove/delete snapshot | May only start merge |
| Data move | Changed blocks integrated | I/O intensive |
| Metadata | Dependencies rewritten | Critical correctness step |
| Verification | Chain + guest I/O | Required after merge |