A snapshot is a point-in-time copy of a volume. Use them for backups before risky changes, for cloning VMs, or as a recovery point you can promote into a new instance.
Types
| Type | What it captures | When to use |
|---|---|---|
| Volume snapshot | One disk (root or data) at a single instant | Backups; quick recovery points |
| VM snapshot | All volumes + RAM | Whole-VM rollback (KVM-dependent — confirm the option appears in the console for your instance) |
For a clean volume snapshot, stop write activity first — either stop the VM, or sync and quiesce databases. CloudStack captures the disk as-is.
Take a snapshot
Console
- Storage → Volumes.
- Click the volume you want to snapshot (e.g.
ROOT-<vm-id>). - Click Take Snapshot, name it (e.g.
backup-pre-upgrade), confirm.
CLI
# Find the root volume of an instance
VM=$(cmk list virtualmachines name=hello-atlas | jq -r '.virtualmachine[0].id')
VOL=$(cmk list volumes virtualmachineid=$VM type=ROOT | jq -r '.volume[0].id')
cmk create snapshot volumeid=$VOL name=backup-pre-upgrade
cmk list snapshots filter=id,name,state,createdScheduled snapshots
You can automate snapshots on an interval with a retention policy:
cmk create snapshotpolicy volumeid=$VOL intervaltype=DAILY \
schedule="03:00" timezone="UTC" maxsnaps=7Without a retention policy (maxsnaps), recurring snapshots accumulate forever and your storage bill will grow. Set a sensible cap.
Console equivalent: Storage → Volumes → click volume → Recurring Snapshots → +.
Restore from a snapshot
You don’t “restore in place” — you create a new volume from the snapshot and attach it.
SNAP=<snapshot-id>
NEWVOL=$(cmk create volume snapshotid=$SNAP name=restored-root | jq -r '.volume.id')
# Stop the VM, detach the old root, attach the new one
cmk stop virtualmachine id=$VM
cmk detach volume id=$VOL
cmk attach volume id=$NEWVOL virtualmachineid=$VM
cmk start virtualmachine id=$VMOr, promote the snapshot to a Template and launch a fresh instance from it:
cmk create template snapshotid=$SNAP name=my-template ostypeid=<linux-ostype>Billing
Snapshots are billed by the storage they consume — incremental, so successive snapshots typically use less than the volume itself. See Operations for the current rate.
Common failures
- Snapshot stuck in
Allocating— CloudStack’s snapshot pipeline is async; wait a few minutes. If it persists, retry. If it persists after retry, contact help@runatlas.is. - Restore can’t attach the new volume — the source VM must be stopped, and only one volume can occupy the root slot at a time. Detach the old root first.