Skip to content

Data volumes

Updated

A data volume is a disk with its own lifecycle. It is created on its own, attached to a machine, and outlives that machine when you delete it. Volumes are where anything you cannot afford to lose belongs.

Create a volume from the Volumes page with a size, then attach it to a machine at a mount path. The host formats it and mounts it into the machine at that path, creating the directory if the image does not already have it.

Volumes can be attached read-only when the workload should not write to them.

OperationWhen
AttachWhile the machine is running, or before it starts
DetachOnly while the machine is stopped

The first time a new volume is attached, it takes its owner and permissions from the directory the image ships at that mount path.

The volume’s contents are its own. Attaching a volume does not copy anything from the image into it.

OperationEffect on volumes
Stop and bootKept, contents intact
Redeploy an AppVMKept, contents intact, while the system disk is reset
Delete the machineVolumes are separate objects and are not deleted
Snapshot a classic VMNot allowed while a volume is attached. See Snapshots

Database images often refuse to initialise into a directory that is not empty, and a freshly formatted volume has a lost+found directory at its root. Mount the volume on the parent directory and point the database’s data directory at a subdirectory of it. See Will my image run?.