start_cmd plus readiness probes already produce the state each
sandbox should start from.
Warm pools do not preserve per-run mutable state. A checkout claims one ready
VM and turns it into a normal sandbox; it is not recycled back into the pool
after use.
Keeping a pool warm reserves runtime capacity. Treat min_ready, max_ready,
CPU, and memory as cost-bearing choices, and drain or delete pools when the
burst ends.
Create A Pool
Build or identify a template first, then create a pool with public readiness targets:Template.create_warm_pool(...) is a
convenience wrapper around TemplateWarmPool.create(...).
The equivalent CLI flow uses --json for automation:
/v1/template-warm-pools with create, list, get,
update, delete, status, enable, disable, drain, and reconcile operations.
Create From A Pool
Pass the explicit pool ID when creating sandboxes:warm_pool_checkout is present when create considered a warm pool. It reports
source, hit, id, and mode so callers can distinguish a ready checkout
from a cold fallback or explicit bypass.
Checkout Modes
| Mode | Behavior |
|---|---|
prefer | Wait up to warm_pool_wait_ms for ready inventory, then fall back to cold create on a miss. |
require | Wait up to warm_pool_wait_ms, then fail with warm_pool_unavailable instead of cold creating. |
bypass | Force cold create. This may omit warm_pool when the caller wants to skip pools for one request. |
prefer for general latency improvement and require when the work should
only run if ready capacity is available. In the CLI, pass
--warm-pool-mode require for the latter behavior.
Poolable Shape
Templatestart_cmd and readiness are the pool startup contract. The command
runs during template build before snapshotting, and warm pools restore that
ready template state.
create-time envs, volume mounts, cwd overrides, desktop settings, custom
networking, non-destroy timeout policy, and auto-resume are not poolable
startup state. In prefer mode, unsupported create-time shape falls back to a
cold create. In require mode, it fails with warm_pool_unavailable.
snapshot restore, resume, fork, hibernate, and pause do not use template
warm-pool checkout. Use reusable snapshots or fork when you need mutable state
captured from a running sandbox, hibernate or auto-resume when one sandbox
should pause and continue later, and volumes when data must persist across
sandbox cleanup.
Version Policy
pinned_build pools resolve the template ref to one build and continue filling
that build until updated.
track_tag pools follow a template tag. When the tag moves, the pool records a
new rollout generation, stops filling old ready or warming inventory, drains
old ready rows, and fills the new build. Sandboxes already claimed from the old
build continue as normal user sandboxes.
Status And Troubleshooting
Inspect status before a burst:target, ready, warming, claimed, draining,
failed, expired, and unavailable.
Common degraded reasons:
| Reason | Meaning |
|---|---|
no_eligible_hosts | No compatible runtime host can fill the pool. |
artifact_not_ready | The resolved template artifact is not ready on an eligible host yet. |
artifact_prewarm_failed | Preparing the template artifact for pool fill failed. |
quota_exceeded | Warm capacity is blocked by an account or deployment quota. |
template_build_unavailable | The resolved template build or artifact is no longer usable. |
controller_disabled | Pool reconciliation is disabled by the deployment. |
drain_active | The pool is draining and will not refill ready capacity. |
require and handle
warm_pool_unavailable explicitly. If cold fallback is acceptable, use
prefer and inspect warm_pool_checkout.source after create.