Skip to main content

Create

Each example below is an equivalent alternative; clients do not share the same in-memory handle. The TypeScript SDK does not accept a network policy on create, so use the Python SDK, CLI, or HTTP API when you need create-time network controls.
disk_mb sets the minimum rootfs size (MB). On cold create the disk is grown to this size before boot. Snapshot-backed templates fix their disk size at build time, so for those set the size with Template.build(..., disk_mb=...) rather than per-create — passing a larger disk_mb than the template’s built-in size is rejected.

Create From A Template Warm Pool

Use a template warm pool when many machines should start from the same ready custom template. Pass an explicit pool ID and checkout mode. The TypeScript SDK does not expose warm-pool checkout on create, so use the Python SDK, CLI, or HTTP API:
prefer may cold-fallback, require fails with warm_pool_unavailable, and bypass forces cold create. Snapshot restore, resume, fork, hibernate, and pause do not use template warm-pool checkout.

Connect

Use connect when another process created the machine or when a previous script handed you a machine ID.
If the ID points at a paused machine alias, connect() resumes the snapshot and returns a running machine handle. For a read-only lookup that does not wake paused work, use Machine.get_info_by_id("mch_123"), nullspace machine get mch_123, or GET /v1/machines/mch_123 (see Inspect).

List

Filter lists by state, template, or metadata:
Use fields when you only need a compact response:
When fields is set, the SDK returns raw dictionaries instead of a MachinePaginator.

Inspect

For read-only inspection without resuming a paused machine, call Machine.get_info_by_id("mch_123"). For metrics without a handle, use Machine.get_metrics_by_id("mch_123").

Cleanup

Use a context manager for short-lived tasks:
For long-lived sessions, call machine.kill() or Machine.kill_by_id("mch_...") when the work is complete.