Preemptible VMs, also known as spot VMs or spot instances, are virtual machines that Compute may stop at any time. This can happen, for example, when the system needs resources to launch a regular VM in the same region, or if the current spot price exceeds the maximum price set in the pricing policy associated with the preemptible VM.Compute sends a SIGTERM signal 60 seconds before stopping the VM. If your system does not respond in time, Compute sends a SIGKILL signal to force shutdown.Compute preserves all data on the volumes attached to a stopped preemptible VM. It does not preserve dynamic resources, such as dynamic public IP addresses.Preemptible VMs can help reduce computing costs for workloads that tolerate interruptions, but they don’t provide guaranteed availability. Preemptible VMs are charged at the current spot price. To manage the cost of preemptible VMs, you can:
You can run preemptible VMs on all VM platforms with GPUs.To get an up-to-date list of platforms, run the nebius compute platform listcommand. The platforms available for preemptible VMs are marked as allowed_for_preemptibles: true.
When you create a preemptible VM, configure one of the spot pricing settings. You can select a pricing policy to set the maximum price, or follow the spot price to have the VM run at the current spot price.
Web console
CLI
Terraform
Go SDK
Python SDK
JavaScript SDK
In the sidebar, go to Compute → Virtual machines.
Click Create resource → Virtual machine.
If you have capacity block groups, on the General step, select Pay-as-you-go VM. If you do not have capacity block groups, the wizard skips the General step and opens Compute instead.
On the Compute step, select With GPUs or Without GPUs, set the VM type to Preemptible and select a platform and preset.
Add one of the following spot pricing parameters. The example command below uses --follows-spot-price:
--spot-pricing-policy-id <pricing_policy_ID>: Select a pricing policy that sets the maximum spot price. For information on how to get a pricing policy ID or create a new policy, see Managing pricing policies.
--follows-spot-price: Accept the current spot price without setting a maximum spot price.
Add the following parameters to the nebius compute instance create command:
In this configuration, the following values are specified:
recovery_policy defines what Compute does with a VM after it’s preempted or fails. Preemptible VMs support only the FAIL value, which stops the VM. They do not support the RECOVER value, which tries to restart the VM. Setting RECOVER for a preemptible VM results in an error.
on_preemption specifies what happens when the VM is preempted. The only supported value is STOP: Compute stops the VM without deleting or restarting it.
In this configuration, the following values are specified:
recovery_policy defines what Compute does with a VM after it’s preempted or fails. Preemptible VMs support only the FAIL value, which stops the VM. They do not support the RECOVER value, which tries to restart the VM. Setting RECOVER for a preemptible VM results in an error.
on_preemption specifies what happens when the VM is preempted. The only supported value is STOP: Compute stops the VM without deleting or restarting it.
follows_spot_price accepts the current spot price without setting a maximum price. To set a maximum price, use spot_pricing_policy = { id = "<pricing_policy_ID>" } with the ID of a pricing policy instead.
For details about the nebius_compute_v1_instance Terraform resource, see the provider reference.
In this configuration, the following values are specified:
RecoveryPolicy defines what Compute does with a VM after it’s preempted or fails. Preemptible VMs support only the FAIL value, which stops the VM. They do not support the RECOVER value, which tries to restart the VM. Setting RECOVER for a preemptible VM results in an error.
OnPreemption specifies what happens when the VM is preempted. The only supported value is STOP: Compute stops the VM without deleting or restarting it.
FollowsSpotPrice accepts the current spot price without setting a maximum price. To set a maximum price, use SpotPricingPolicy with the ID of a pricing policy instead.
In this configuration, the following values are specified:
recovery_policy defines what Compute does with a VM after it’s preempted or fails. Preemptible VMs support only the FAIL value, which stops the VM. They do not support the RECOVER value, which tries to restart the VM. Setting RECOVER for a preemptible VM results in an error.
on_preemption specifies what happens when the VM is preempted. The only supported value is STOP: Compute stops the VM without deleting or restarting it.
follows_spot_price accepts the current spot price without setting a maximum price. To set a maximum price, use spot_pricing_policy with the ID of a pricing policy instead.
In this configuration, the following values are specified:
recoveryPolicy defines what Compute does with a VM after it’s preempted or fails. Preemptible VMs support only the FAIL value, which stops the VM. They do not support the RECOVER value, which tries to restart the VM. Setting RECOVER for a preemptible VM results in an error.
onPreemption specifies what happens when the VM is preempted. The only supported value is STOP: Compute stops the VM without deleting or restarting it.
followsSpotPrice accepts the current spot price without setting a maximum price. To set a maximum price, use spotPricingPolicy with the ID of a pricing policy instead.
A dynamic IP address is released when a preemptible VM stops. To keep your workload stable, consider using a static IP address instead.
How to continue working with a stopped preemptible VM
When Compute stops a preemptible VM, it preserves all data on the attached volumes. To resume work, start the VM again. If you used a dynamic IP address, update all systems that depended on the old IP address.If the VM uses local SSD disks, use them with caution. Local SSD disks are ephemeral, meaning any data stored on them will be lost when the preemptible VM stops.You can also create a regular VM with the same attached volumes.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.