> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preemptible virtual machines

*Preemptible VMs*, also known as spot VMs or spot instances, are virtual machines that Compute may stop at any time. This can happen when the system needs resources to launch a regular VM in the same region.

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 [cost less than regular ones](../resources/pricing#prices), but they do not provide guaranteed availability.

You can create a preemptible VM, but you cannot change the type of an existing VM—either from regular to preemptible or from preemptible to regular.

## Supported platforms

You can run preemptible VMs on all [VM platforms with GPUs](./types).

To get an up-to-date list of platforms, run the `nebius compute platform list` [command](/cli/reference/compute/platform/list). The platforms available for preemptible VMs are marked as `allowed_for_preemptibles: true`.

## How to create a preemptible VM

<Tabs group="interfaces">
  <Tab title="Web console">
    1. Go to the [web console](https://console.nebius.com), click **Create resource** and then select **Virtual machine**.
    2. When creating a VM, set the **VM type** parameter to **Preemptible**.
  </Tab>

  <Tab title="CLI">
    When [creating a VM](./manage):

    * Select a [platform that supports preemptible VMs](#supported-platforms).
    * Add the following parameters to the `spec` section of the VM configuration:

      ```bash theme={null}
      nebius compute instance create \
        --format json \
        - <<EOF
      {
        ...
        "spec": {
          "recovery_policy": "FAIL",
          "preemptible": {
            "priority": 1,
            "on_preemption": "STOP"
          },
        ...
        }
      }
      EOF
      ```

      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.
      * `priority` affects the order in which Compute tries to stop VMs in your projects. It starts with VMs that have lower priority values but does not guarantee the exact order. The value can range from `1` to `5`, where `5` indicates the highest priority.
      * `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.

    For details about the <code>nebius compute instance create</code> command, see the [Nebius AI Cloud CLI reference](/cli/reference/compute/instance/create).
  </Tab>

  <Tab title="Terraform">
    When creating a VM, select a [platform that supports preemptible VMs](#supported-platforms) and set the following parameters in the VM configuration:

    ```hcl theme={null}
    resource "nebius_compute_v1_instance" "instance" {
      ...
      recovery_policy = "FAIL"
      preemptible     = {
        on_preemption = "STOP"
        priority      = 1
      }
      ...
    }
    ```

    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.
    * `priority` affects the order in which Compute tries to stop VMs in your projects. It starts with VMs that have lower priority values but does not guarantee the exact order. The value can range from `1` to `5`, where `5` indicates the highest priority.
    * `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.

    For details about the <code>nebius\_compute\_v1\_instance</code> Terraform resource, see the [provider reference](/terraform-provider/reference/resources/compute_v1_instance).
  </Tab>
</Tabs>

<Tip>
  A dynamic IP address is released when a preemptible VM stops. To keep your workload stable, consider using a static IP address instead.
</Tip>

## 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](./stop-start) again. If you used a dynamic IP address, update all systems that depended on the old IP address.

You can also [create a regular VM](./manage) with the same attached volumes.
