Overview
A volume is storage that outlives what uses it: a disk for a VM, or a folder apps and jobs keep across deploys and moves.
When to use it
- A VM needs a disk.
- An app writes files that must survive a new version.
- Several jobs share files.
How it works
- Filesystem volumes
- Engine volumes mounted into apps and jobs, read-only if you ask.
- Disk volumes
- Thin qcow2 files created with qemu-img: a 50 GiB disk takes only what is written.
Every replica and both revisions during a rolling deploy mount the same filesystem volume. Disk volumes belong to one VM at a time.
Architecture
- App replicas to Filesystem volume: mount
- VM to Disk volume: attach
Flows
Keeping files across deploys
- Create a filesystem volume and mount it in the app at a path.
- A deploy starts the new revision with the same volume.
- Files written before are still there.
Set it up
In the console
- Open Volumes and choose New volume.
- Choose filesystem or disk, and the size for a disk.
- Attach it from the app, job or VM form.
With the CLI
enclave volume create media --type filesystem --waitWith OpenTofu
OpenTofu configuration
resource "enclave_volume" "media" {
name = "media"
type = "filesystem"
}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 volume: 3–40 lowercase letters, digits or hyphens, starting with a letter. Changing it replaces the volume. |
type | text | required | disk or filesystem. Changing it replaces the volume. |
machine | text | optional | The machine to run on (default: EnclaveStack chooses, and this reads back its choice). Changing it moves the resource, with its data, in place; apply waits for the move. |
machine_labels | map of text | optional | Labels the machine must have, when machine isn't set (key=value, all must match). |
project | text | optional | The project to create it in. Defaults to the provider's project (ENCLAVE_PROJECT, else default). Changing it replaces the resource. |
size_gib | number | optional | A disk's size in GiB (default 10); it only grows, live. Filesystems have none. |
snapshot | text | optional | A snapshot of the same type to start from. Changing it replaces the volume. |
attached_to | text | output | What uses it, as comma-separated kind/name; refreshed by the server every minute or so. |
id | text | output | Resource ID. |
used_bytes | number | output | Space a filesystem's files use (measured every few minutes). |
Limits and security
Good to know
- A disk volume belongs to one VM at a time.
Security
- Volumes stay on the machine; take snapshots or backups for copies.