Create an instance
Create an instance on a pool with an image and a startup script.--no-input) must pass --pool, --image, and
--sku (with a sku_… ID from sf skus list), plus --cloud-init when the image is an SF
Compute public image.
Instance lifecycle
The API and CLI report the status as a snake_case value. The console shows the same status under a friendlier label.
An instance in
awaiting_allocation starts running when the pool’s allocation schedule covers the
current time. For example, if you buy compute time starting at now, the instance starts within
about a minute. If the order starts in the future, the instance waits until then. The image download
and boot process takes up to 10 minutes before SSH is available.
Why is my instance pending?
An instance staysawaiting_allocation (Pending in the console) until a node is assigned to it.
A node is only assigned when the pool has allocation for the instance’s SKU at the current time.
Check these in order:
- The pool has no allocation. Creating an instance does not buy compute; you also need a
filled buy order on the pool. Run
sf pools get <pool>and check theTOTAL SCHEDULEline, or open the pool in the console. If the schedule is empty, place a buy order on the pool. - The allocation starts in the future. If the schedule’s first segment starts later than now, the instance waits until then.
- The allocation is for a different SKU. An instance only runs on nodes of its own SKU. Run
sf pools get <pool> --verboseto see the schedule per SKU and compare it with the instance’s SKU fromsf instances get <instance>. See Mixed hardware. - The pool has fewer nodes than instances. Allocation covers a node count. If you created more instances than the pool has nodes right now, the extra ones wait. Terminate an instance or buy more nodes.
- The buy order hasn’t filled yet. Orders add to the schedule only once they fill. Check the order status.
running until the platform stops it and its status becomes terminated.
terminated is one-way; an instance never returns to running. Terminated instances remain in
sf instances list and GET /preview/v2/instances until you delete them.
The CLI’s default view buckets recent terminated instances into their own section; pass
--status terminated to list all of them.
The platform stops an instance with no in-band push signal to the guest OS. There’s no ACPI
(Advanced Configuration and Power Interface) shutdown notice before it powers off the VM (current
behavior, not a guarantee).
Spot-managed instances can poll ahead using the in-instance metadata endpoint described in
Preemption. For everything else, build in a margin before
your pool’s allocation ends instead of waiting for a signal. See
Allocation schedule.
Images
List available images to find one to use with your instance.sf images list) or ID when creating an instance. Public images
require the full sfc:image:sfcompute:public:... name; SF Compute rejects the short trailing
segment on its own.
Cloud-init
Pass a startup script or cloud-config YAML via--cloud-init to configure the VM on first boot. SSH
access depends on this. SF Compute public images ship with no default password or key, and
sf instances create does not add your local key, so the CLI requires --cloud-init for them: a
non-interactive run fails without it, and the interactive prompt offers to create a script, pick a
recent one, or provide a path. A custom image may omit it if it already includes your key. Either
way, you need a cloud-init script or cloud-config that adds your public key to authorized_keys
before you can connect.
A shell script can inject your SSH public keys. Key files that don’t exist are skipped.
startup.yaml
Check instance status
List your instances and their statuses.--created-after and --created-before accept a datetime, Unix timestamp, or a duration like 24h
or 7d. A duration counts back from now, so 24h means 24 hours ago. You can also use --since
and --until as aliases.
Get details on a specific instance.
SSH into an instance
Connect to a running instance over SSH.The instance must be in
running status and the image must be fully booted. This typically takes
less than 5 minutes after the instance starts, but can take up to 10.View logs
View an instance’s logs.--after and --before accept flexible time expressions: "now", "in -1h", a date like mar 1,
ISO 8601, or a Unix timestamp.
Terminate an instance
Stop the VM immediately. The instance moves toterminated status.
Replace an instance
Replace an instance with a new one on the same pool and SKU. Replacing terminates the original and creates a fresh instance with a new image and startup script (and optionally a new name).Replacing does not carry cloud-init over from the original instance. When the new image is an SF
Compute public image,
--cloud-init is required. For a custom image, omitting it starts the
replacement with no startup script, so SSH only works if the image already includes your key.Delete an instance
Permanently delete an instance. The instance must be terminated first.Instance priority
When a pool’s quota drops below the number of running instances, the system terminates instances to match. Instance priority controls which ones survive. The system keeps higher-priority instances longer and terminates lower-priority ones first. Among instances of equal priority, it terminates the newest first. Priority has 4 levels, orderedyield < normal < preferred < critical. Every instance defaults to
normal.
Set priority on an existing instance.
priority_level in the body of
POST /preview/v2/instances to set it at create time.
priority_level to default to normal.
Update one instance with PATCH /preview/v2/instances/{id}.
priority_level to leave it unchanged. Pass "normal" to reset to the default.
Update many instances atomically by PATCHing the collection.
- A single call can include up to 10,000 entries.
- All instances in a batch must belong to the same workspace.
- The API rejects the whole request with a
422if any entry has an unknown id or belongs to another organization. - A batch spanning more than one workspace is also rejected with a
422. - The entire request rolls back, so no instance is modified.
- An empty
datareturns200with no writes. - When the same
idappears more than once, the last occurrence wins.
Instance: Write permission. Read-only tokens see priority_level on
GET responses but receive 403 on writes.
Limitations
- No persistent storage. If the underlying physical host dies, you get a replacement but not the same disk.
- Public IPv4 is available only on SKUs that support it, and only when enabled at create time. See IP addresses.
- No InfiniBand.
- Instances don’t share a VPC or VLAN. Configure a VPN if you need connectivity between instances.
- Boot time can be up to 10 minutes for image download and startup.
- No GPU monitoring. GPUs may occasionally become undetectable (fall off the PCIe bus). Terminate and recreate the instance, or email support@sfcompute.com.