Snapshots ยท Volumes
A copy of the disk, taken without unplugging it.
A snapshot is a point-in-time, crash-consistent copy of a volume, stored independently of it. Delete the volume and the snapshot stays. Use snapshots to back a volume up, or to stamp out new VMs that all boot from the same known-good image.
$ exc compute snapshot create --volume_id 7
$ exc compute snapshot create --volume_id 7 โ created โ snapshot 99 ยท from app-data $ exc compute create --name web-2 \ --image_id 1 --instance_type m1a.large \ --root_volume_source_snapshot_id 99 --wait โ running โ web-2 ยท cloned from snapshot 99
Two uses
One command, two different jobs.
The CLI makes no distinction between backup and golden image โ that's decided by what you do with the snapshot once it exists.
Backup
Take a snapshot before a risky migration, on a schedule, or right before you let someone new run rm -rf near production. If the volume is corrupted afterwards, the snapshot wasn't.
Golden image
Install your stack once, snapshot the volume, then boot every new VM with --root_volume_source_snapshot_id. Every clone starts from the exact same disk โ no provisioning drift between web-1 and web-37.
How it works
What the snapshot captures is whatever is on disk when the API call lands.
The volume stays attached during the snapshot โ there's no quiescing of the guest OS. That gives you crash consistency: the same state you'd get from pulling the power cord. For a plain filesystem that's fine. For a database or anything with caches still in RAM, run flush, fsync, or xfs_freeze first if you can't tolerate replay on restore.
- Snapshots are stored independently โ deleting the source volume doesn't delete them
- Restoring means booting a new VM with --root_volume_source_snapshot_id
- There's no native scheduler yet โ a cron job or the Terraform excloud_snapshot resource fills the gap
| Action | Required permission |
|---|---|
| Create | compute:snapshot:create |
| List | compute:snapshot:list |
| Delete | compute:snapshot:delete |
Full list in the permissions reference.
Get started
The ten-second backup you'll actually have when something goes wrong.
Run the create command, then boot a second VM with --root_volume_source_snapshot_id. When the clone comes up clean, you know the snapshot is good.
$ exc compute snapshot create --volume_id 7