Concepts

Sandboxes, their states, sleep and wake, snapshots, forks and sizes

Sandboxes

A sandbox is one virtual machine, with its own kernel, its own disk and, on systems with a screen, its own display. It belongs to a project of your organization. Ids name what they are: a sandbox is sbx_…, a snapshot snp_…, an operation op_….

Creating a sandbox waits until it is running, 60 seconds by default and 300 at most (wait_timeout_s), and answers 201 with the sandbox. Send wait: false, or let the wait run out, and it answers 202 with the sandbox still creating: poll it with a get. A batch create always answers 202 at once. Other calls that change a sandbox answer at once with 202 and an operation, which you follow with Get an operation. Add wait=true and the call waits instead, 60 seconds by default and 300 at most, and answers the result. The SDKs and mpod wait for you.

States

StateWhat it meansBilled for compute
creatingBeing restored, or booted from a disk.No
runningAwake.Yes
stoppingLeaving running, towards sleeping or stopped.No
sleepingAsleep. tier says what is kept.No
wakingComing back from sleeping or stopped; queue_position when it waits for room.No
stoppedShut down. Disk kept, memory gone. Only a call brings it back.No
deletingGoing.No
deletedGone. Answers get for 24 hours.No
errorNeeds attention; reason says why. The disk is kept when it can be.No

A sandbox you no longer use goes to sleep by itself after its idle time, 15 minutes by default. API calls, terminal and screen use, network traffic, CPU use above a floor and activity reports all count as use. Set idle_s when you create it, or a default for the project.

Sleep and wake

Sleep keeps the sandbox as it was. tier says how:

tierWhat a sleeping sandbox keeps
memoryPaused in the server's memory.
diskMemory saved on the server's drive.
noneMemory not kept; the next wake boots.

A wake from memory is the fastest. A sandbox whose memory was not kept boots from its disk, with its files as they were. A wake never fails for lack of room: it waits in a queue and the sandbox shows its queue_position.

Stop is different from sleep: the sandbox shuts down, keeps its disk and loses its memory, and only a call starts it again. A time limit (time_limit_s) stops a sandbox that long after it starts; extend it while it runs.

Snapshots and forks

A snapshot saves a sandbox so you can start new ones from it. A new sandbox made from a snapshot is a restore, which takes seconds rather than a boot. A fork makes up to 10 running copies of a running sandbox at once, each with its own disk from that moment on.

Create a sandbox with no_save to refuse snapshots, share links and forks to every key but the one that made it.

A fork may name a first_action: in each copy, the parent's commands you name in stop_execs are stopped, then one command runs before anything else, with POD_FORK_INDEX (0 for the first copy), POD_FORK_COUNT and POD_FORK_PARENT set, so each copy can take its own slice of the work. The fork's operation lists each copy's command, which you read as any other command.

Many sandboxes at once

Not available yet Groups of sandboxes are not offered yet.

A create with count above 1, a swarm name or roles makes 2 to 1000 sandboxes as one swarm, and answers at once with the swarm's group, each sandbox still creating, and any copy no server took (unplaced). Each sandbox has a name on the group's private network: <role>-<n> with roles, member-<n> without. Every sandbox carries its group; read a group to list its sandboxes. A sandbox made alone is a group of one.

Placement

Sandboxes run in the US West.

A create may name hints: the volumes and snapshots the sandbox will use, up to 16 ids, so a server that already holds them is preferred. A hint never refuses a create.

On a CI size of at least 16 cores, hold_server: true holds a whole server for the create when none has room now. The answer is still no_capacity, and server_held says whether a server is held: retry at retry_after_s with the same Idempotency-Key, within 30 seconds, and the sandbox lands there.

nested_virtualization: true places the sandbox on servers kept for sandboxes that run VMs of their own. They sell the shared sizes, run Linux only, and the catalog says whether they have room now (has_room).

Sizes

SizeClassvCPUMemoryDisk
smallshared24 GiB40 GiB
mediumshared48 GiB80 GiB
largeshared816 GiB160 GiB
xlargeshared1632 GiB320 GiB
ci-2ci28 GiB100 GiB
ci-4ci416 GiB100 GiB
ci-8ci832 GiB100 GiB
ci-16ci1664 GiB100 GiB

A stock Linux sandbox needs at least 4 GiB of memory, which every size above has.

ClassWhat it is
sharedShared servers; vCPUs are threads under core scheduling.
ciCI servers: each vCPU is a whole core.
nestedA pool of servers kept for sandboxes that run VMs of their own (nested virtualization); Linux only. It sells the shared sizes and never shares a server with another class.

Change a sandbox's size at any time. A running sandbox restarts on the new size; a sleeping one stays asleep and wakes on it. Its disk is kept either way.

Disks

A sandbox's disk is persistent by default: it is kept while the sandbox sleeps, stops or moves to another server. A throwaway disk stays on its server and is never sent to object storage, so it is lost with its server; CI sizes always have one. How much a server's loss can cost is in Durability.

Billing

A sandbox is billed by the second while it is running, at its size's hourly rate. Its disk and snapshots are billed for what they store. Read your usage by sandbox, size, project, end user or product, in seconds and bytes; with include=cost, each row also carries Pod's estimate of what it costs, for when you resell. The invoice is the bill.

Without a card on file, the free plan runs the small size, 1 sandbox awake at a time, for 10 hours awake a month and 1 GiB of outbound traffic a month.

A person who may read billing moves the organization between the free plan and Pro: moving up starts at once, moving down waits for the start of next month. Cancelling Pro keeps it to the end of the month already paid for. Prepaid credit is bought into the organization's wallet, and invoices draw from it first. Each needs a fresh second factor; no key can do them.