CephCVI · RBD BackupRBD Backup
Rollback versus clone: choosing the recovery shape
What you'll learn
- Compare rollback and clone as recovery paths
- Perform each safely
- Choose based on what must be preserved
- Handle a clone that becomes permanent
Prerequisites
None — start here.
Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18
Why this matters in production
Rollback discards everything since the snapshot; clone preserves it. The choice is usually made under pressure and is hard to reverse.
The two paths
| Path | Effect | Reversible |
|---|---|---|
rbd snap rollback | the image returns to the snapshot state | no — post-snapshot data is gone |
rbd clone | a new image from the snapshot; original untouched | yes |
# rollback: destructive, in place
POOL=rbd-vms
IMAGE=vm-disk-01
SNAP=backup-20260818
rbd snap rollback ${POOL}/${IMAGE}@${SNAP}
# clone: additive, needs a protected snapshot
POOL=rbd-vms
IMAGE=vm-disk-01
SNAP=backup-20260818
rbd snap protect ${POOL}/${IMAGE}@${SNAP}
rbd clone ${POOL}/${IMAGE}@${SNAP} ${POOL}/${IMAGE}-recovered
The client must have the image unmapped and the VM stopped for a
rollback. Rolling back an image a guest is actively using corrupts what
the guest has in memory about it.
Performing a rollback safely
# 1. stop everything using the image
DOMAIN=vm-db-01
POOL=rbd-vms
IMAGE=vm-disk-01
virsh shutdown ${DOMAIN}
rbd status ${POOL}/${IMAGE} # confirm no watchers
# 2. preserve the current state before discarding it
POOL=rbd-vms
IMAGE=vm-disk-01
rbd snap create "${POOL}/${IMAGE}@pre-rollback-$(date +%Y%m%d-%H%M)"
# 3. roll back
POOL=rbd-vms
IMAGE=vm-disk-01
TARGET_SNAP=backup-20260818
rbd snap rollback ${POOL}/${IMAGE}@${TARGET_SNAP}
# 4. verify before restarting the workload
POOL=rbd-vms
IMAGE=vm-disk-01
DOMAIN=vm-db-01
rbd map ${POOL}/${IMAGE}
mount -o ro /dev/rbd/${POOL}/${IMAGE} /mnt/check && ls /mnt/check
umount /mnt/check && rbd unmap /dev/rbd/${POOL}/${IMAGE}
virsh start ${DOMAIN}
Step 2 is what makes an irreversible operation reversible. It costs
seconds and it is the step most often skipped.
Performing a clone
POOL=rbd-vms
IMAGE=vm-disk-01
SNAP=backup-20260818
rbd snap protect ${POOL}/${IMAGE}@${SNAP}
rbd clone ${POOL}/${IMAGE}@${SNAP} ${POOL}/${IMAGE}-recovered
rbd info ${POOL}/${IMAGE}-recovered | grep parent
# mount the clone and take what is needed
POOL=rbd-vms
IMAGE=vm-disk-01
rbd map "${POOL}/${IMAGE}-recovered"
mount "/dev/rbd/${POOL}/${IMAGE}-recovered" /mnt/recovered
cp -a /mnt/recovered/needed-file /restore-target/
A clone is the right answer when only part of the snapshot's content is
needed — copying one file out of a clone leaves the live image
untouched.
Choosing
| Situation | Path |
|---|---|
| The whole image must return to a prior state | rollback, after a pre-rollback snapshot |
| One file or directory is needed | clone, copy it out, remove the clone |
| Uncertainty about which snapshot is correct | clone each candidate and inspect |
| Post-snapshot data must be preserved | clone |
| The workload is running and cannot stop | clone |
| Disk space is very tight | rollback |
When in doubt, clone. It preserves the option to roll back afterwards;
rolling back does not preserve the option to clone.
A clone that becomes permanent
# a clone depends on its parent snapshot, which cannot be removed
POOL=rbd-vms
IMAGE=vm-disk-01
SNAP=backup-20260818
rbd snap unprotect ${POOL}/${IMAGE}@${SNAP} # fails while clones exist
rbd children ${POOL}/${IMAGE}@${SNAP}
# flatten to break the dependency
POOL=rbd-vms
IMAGE=vm-disk-01
SNAP=backup-20260818
rbd flatten ${POOL}/${IMAGE}-recovered
rbd info ${POOL}/${IMAGE}-recovered | grep -c parent || echo "independent"
rbd snap unprotect ${POOL}/${IMAGE}@${SNAP}
Flattening copies the parent's data into the clone, so it consumes full
capacity — which is the cost of making the clone independent.
Quiz
Knowledge check · 4 questions
Q1. Why is a clone instant regardless of image size?
Q2. A rollback can be undone if it turns out to have used the wrong snapshot.
Q3. Recover a single deleted file from a VM disk.
A user deleted an important file from a VM two hours ago. A snapshot from last night exists. The VM has been in active use since.
Q4. What does `rbd flatten` do and what does it cost?
Passing score: 75%. Answers are checked in this browser.
Production discipline
Clone when in doubt — it preserves the option to roll back afterwards, while rolling back does not preserve the option to clone. Always take a pre-rollback snapshot; the operation discards everything since the target with no undo.
Cross-course references
- Kubernetes: restoring to a new PVC preserves the original the same way
- Linux: prefer the additive recovery path when the correct source is uncertain