Skip to main content
A sandbox created from a CAS image can change its CPU, memory, and root disk allocation while it runs. Processes keep running, the API reports the confirmed allocation, and the guest sees the new CPUs, memory, and disk capacity. GPU sandboxes can only grow their root disk, and sandboxes created from the default-format tensorlake/* images can’t be resized live; recreate those with the new size instead.

What You Can Change

  • CPUs: up or down, in whole vCPUs, with a minimum of 1.
  • Memory: up is always possible. Down goes no lower than the memory the sandbox booted with, and only as far as the guest can free memory at that moment. Memory changes happen in 128 MiB steps.
  • Disk: up only. The filesystem grows in place.
If the guest can’t release enough memory for a shrink, the resize stops above the target and is reported as failed with the size it reached, and the sandbox keeps that size. For example, a sandbox booted with 1 GiB, grown to 64 GiB, and still using 34 GiB can shrink to about 34 GiB, not back to 1 GiB. Each resize is a numbered generation. The sandbox’s resources always hold the confirmed allocation, and resource_resize describes the latest generation with its status: pending, succeeded, or failed.

Resize a Running Sandbox

Omitted dimensions keep their current allocation. A resize can’t be combined with name, port, or network changes in the same call.
The command waits up to 300s for the resize to complete. --wait-timeout changes the limit, and --no-wait returns as soon as the resize is admitted.

Wait for a Resize Later

Return as soon as the resize is admitted and wait for its generation when convenient, for example from another process:
With --no-wait, tl sbx update prints the tl sbx wait command to run, including the generation.
A wait that times out doesn’t cancel the resize. Wait for the same generation again to keep following it.

Resize and Snapshots

A memory snapshot records the resized allocation, so a sandbox restored from it starts with that size. The restored sandbox can be resized again, including shrinking memory down to the size the original sandbox booted with.

See Also

CAS Images

The image format that makes a sandbox resizable.

Lifecycle

Sandbox states, timeouts, and suspend/resume.

Snapshot and Clone

Save and restore a resized sandbox.