This feature is in public preview.
How it works
The deployment runs a continuous loop.- Calculates how many more instances it needs to reach the target.
- Places orders.
- Adds allocation from filled orders to the selected pool.
- Creates instances from the selected template as allocation becomes available.
- Extends compute-time purchases while matching sell orders remain available within the maximum rate.
Create a spot deployment
Create a pool and instance template first, then run the create command.--max-rate in dollars per node-hour.
--min-runtime sets the minimum continuous window of compute time that the deployment tries to
purchase before launching each instance. It accepts values from 1 minute to 24 hours and defaults to
10 minutes. Boot time counts toward the window, so a short window may leave little or no usable time
after the instance starts.
Minimum runtime is purchase granularity, not a guaranteed lifetime. The deployment secures a full
minimum-runtime block before it launches an instance. Because each buy order is all-or-nothing, it
never runs an instance on a shorter sliver. It does not stop a running instance from being preempted
(see Preemption).
Raising the minimum runtime does not change the price you pay per node-minute, but it can lower the
chance of filling. Each order must match sell orders spanning the entire, longer window at or below
your maximum rate.
A spot deployment manages both allocation and instances. It cannot share the same pool and SKU
with another spot deployment, standard deployment, or procurement.
View spot deployments
Spot and standard deployments share the same commands. TheTYPE column identifies spot
deployments.
--deployment filter; the default order list omits
deployment-managed orders.
Update a spot deployment
Spot deployments use the same update command as standard deployments. Change the target instance count, minimum runtime, instance template, name, or instance name template.Preemption
The deployment marks an instance preempting when it can no longer keep that instance’s compute time secured within your maximum rate. A contract lapses when no matching sell order is available to extend it within your maximum rate. This happens when a competing buyer’s higher bids take the sell orders the deployment needs to extend. A node whose host fails is reported as a failed instance, not a preemption. Lowering the target is not preemption. It is an immediate scale-down that stops excess instances without a preemption notice, sopreemption_at stays null for those instances (see
Update a spot deployment).
The deployment does not preempt an instance while it still holds secured compute time, and it
secures a full minimum-runtime block before launching one. So an instance runs at least its minimum
runtime unless you lower the target or its host fails.
When the deployment preempts an instance, it sets a preemption time about 2 minutes ahead and stops
the instance at that time. This 2-minute notice is current behavior, not a guarantee. Minimum
runtimes of 2 minutes or lower run without a notice (see
Create a spot deployment).
Detect preemption by polling the in-instance metadata endpoint GET /v1/instance/spot. It returns
the preemption time as {"preemption_at": <unix_seconds>} while a notice is in effect, or
{"preemption_at": null} otherwise. There is no push notification or Advanced Configuration and
Power Interface (ACPI) event, so the instance must poll.
At runtime a spot instance is an ordinary instance. The only differences are that it can be
preempted and that the metadata endpoint reports its preemption time.
Pause a spot deployment
The CLI does not include a pause command yet. Pause through the update endpoint by settingenabled to
false. Get the deployment ID from sf deployments get batch-workers.
enabled to true to resume.
Pause to stop spending without stopping running work. Pausing stops the deployment from placing buy
or sell orders and from creating new instances. Running instances are not extended and lapse when
their purchased compute time ends. The deployment removes pending instances that are not yet
assigned; assigned instances continue running until their allocation ends.
Resuming restarts the automation toward its configured target.
Pausing and deleting both leave running instances alone. To stop running instances now, set the
target to 0 for an immediate scale-down (see Update a spot deployment).
Delete a spot deployment
Delete the deployment when you no longer need it to buy compute time.Pricing
The maximum rate is the most the deployment pays per node-hour. Spot buy orders clear on the same orderbook as every other order for that SKU; there is no separate spot venue. A filled order executes at the matching sell order’s price, at or below your maximum rate. You pay the seller’s price rather than your maximum. Compute time is billed per node-minute. The deployment’s orders are immediate-or-cancel. Each one matches right away or cancels, so it never rests on the orderbook and leaves no standing hold on your balance. Placing an order still requires enough balance to cover its full contract period at your maximum rate. If your balance cannot cover it, the deployment does not place the order and reports insufficient balance. Waiting does not reserve compute time, and an unfilled order does not purchase compute time or incur a charge. When an order fills, you purchase its complete contract period. You pay for that period at the matched price. This charge includes minutes while the instance is booting, idle, or never becomes healthy. Preemption does not add a charge or round up to another minimum-runtime block; you pay only for the compute time secured up to the stop.When a deployment is below target
Check the reconciliation status withsf deployments get batch-workers, then review the
deployment’s filled and unfilled orders with sf orders list --deployment batch-workers.
These are the most common reasons a deployment runs below its target.
- No compatible sell orders are available within the maximum rate.
- Only some of the independently placed buy orders can fill.
- Your organization has insufficient balance to place more orders.
- Purchased allocation is available, but instances are still starting.