Skip to main content
A disk fits state that expects a local filesystem: git repositories, node_modules, databases, package caches. It is ext4 on the machine running the pod, so file locks, hard links, and fsync behave as they do on any Linux host. A volume fits files shared between workloads.

Declare a disk

The first deploy creates the disk, and every later deploy that names it gets the same files. A disk name means the same disk anywhere in the workspace. size takes the units memory does, from 1Gi to 1Ti. Deploying a larger size restarts the pod with the disk grown to it. A deploy with a smaller size fails, because a disk never shrinks. mount_path defaults to /, which makes the disk hold the container’s whole writable filesystem: packages installed with apt-get, files in /root, and anything else written outside a volume. The image still comes from the deployment, so a redeploy with a new image keeps what was written on top of it. Disk("cache", size="20Gi", mount_path="/cache") mounts at one directory instead. A devbox gets a root disk named after it without declaring one; it needs at least 10Gi and room for the image.

How it persists

While the pod runs, LazyCloud copies the parts that changed to your workspace’s storage every two minutes, sooner after a burst of writes, at once when a Spot machine is about to be reclaimed, and once more when the container stops. The next start can land on any machine, so a disk is never tied to one. A machine failure can lose up to the last two minutes of writes. A start does not wait for the disk to download, however large it is. Each part arrives the first time something reads it. While the container boots, the parts the disk read in its last start and the ones its last session read most recently arrive ahead of time. The first read of a part nobody has touched in a while waits for storage. A start soon after a stop goes back to the same machine when it has room, and reads what it already has there. If the machine stops serving the disk, the container stops and says why. One container writes a disk at a time. A pod with a disk runs one container, and a redeploy’s new container waits for the old one to hand the disk over.

List and delete

Deleting a pod or its deployment never deletes the disk, and deleting the disk removes everything written to it. A disk in use can’t be deleted. The storage page lists disks as well.

Pricing

Each disk is one line on the Usage page, priced from two rates on the pricing page. What the disk stores bills per GiB-month for as long as it exists, and that can be less than its size. Its declared size bills per GiB-month for the time a container holds it. Disks need a paid plan. The plan caps the total declared size of a workspace’s disks, and a deploy past the cap fails before anything builds, naming the cap and the plan that lifts it. A redeploy counts each disk once.