Overview
A snapshot is a full copy of a volume or a VM’s disk at one moment, taken while it is in use. New volumes and VMs can start from it.
When to use it
- Before an upgrade, to go back.
- To copy a VM you set up once.
- To keep files from a certain day.
How it works
- QMP drive-backup
- A running VM’s disk is copied to a new qcow2 without pausing it.
- qemu-img convert
- An idle disk is copied as a file.
- Archive copy
- A filesystem volume is mounted read-only in a short-lived container and streamed out as a tar.
Snapshots are files in the machine’s data directory. A volume or VM made from one is a full copy, so the snapshot can be deleted afterwards.
Architecture
- Volume or VM disk to Snapshot: full copy
- Snapshot to New volume or VM: start from
Flows
Cloning a VM
- Set up a VM once and take a snapshot.
- Launch new VMs from the snapshot; each gets a full copy of the disk.
Set it up
In the console
- Open a volume or VM and choose Take snapshot.
- Name it.
- From the snapshot, choose Create volume or Launch VM.
With the CLI
enclave snapshot create media-before --from volume/media --waitWith OpenTofu
OpenTofu configuration
resource "enclave_snapshot" "media_before" {
name = "media-before"
source = "volume/media"
}Settings reference
Every setting and output of the OpenTofu resource; the console and the CLI use the same names in their own words. Generated from platform 4d30582.
| Name | Type | Use | What it does |
|---|---|---|---|
name | text | required | Name of the snapshot: 3–40 lowercase letters, digits or hyphens, starting with a letter. Changing it replaces the snapshot. |
source | text | required | What to copy: volume/NAME or vm/NAME. |
project | text | optional | The project to create it in. Defaults to the provider's project (ENCLAVE_PROJECT, else default). Changing it replaces the resource. |
id | text | output | Resource ID. |
size_bytes | number | output | Size of the copy on the machine's disk. |
taken_at | text | output | When the copy was taken (UTC, RFC 3339). |
type | text | output | disk or filesystem. |
Limits and security
Good to know
- A snapshot takes as much disk as what it copies.
- It stays on this machine; use backups to keep copies elsewhere.
Security
- Snapshot files are readable only by EnclaveStack (mode 0600).