---
title: "Create a preemptible cloud server"
sidebar_label: "Create a preemptible server"
sidebar_position: 4
description: "How to create a preemptible cloud server"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import EditIcon from '@selectel/docux/icons/edit'
import {TabItemLabel} from '@selectel/docux/components'
import Formbricks from '@theme/MDXComponents/Formbricks'

# Create a preemptible server

:::danger

A preemptible server will be stopped by Selectel at any time within 24 hours of creation. If the preemptible server has a local disk, the data on it will be deleted.

:::

For more information on how preemptible servers work, see the [preemptible Servers](/cloud-servers/about/preemptible-servers.mdx) instruction.

<Tabs queryString="create-preemptible-server">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/servers/), on the top menu, click **Products** and select **Cloud Servers**.

    2. Click **Create server**.

    3. In the **Advanced Settings** block, check the **preemptible Server** checkbox.

    4. Select the rest of the server settings — see the [Create Cloud Server](/cloud-servers/create/create-server.mdx) instruction for details.

    5. Click **Create**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Create a cloud server:

       ```bash
       openstack server create \
           [--image <image> | --volume <volume> | --snapshot <snapshot>] \
           --flavor <flavor> \
           --availability-zone <pool_segment> \
           --nic net-id=<net_uuid> \
           --security-group <security_group> \
           --key-name <key_name> \
           --tag preemptible --os-compute-api-version 2.72 \
           <server_name>
       ```

       Specify:

       * source type:
         * `--image <image>` — to create a server from a [pre-built](/cloud-servers/images/about-images.mdx#default-images) or [custom image](/cloud-servers/images/about-images.mdx#own-images). The `<image>` parameter is the image ID or name. You can view the list of images using `openstack image list`;
         * `--volume <volume>` — to create a server from a [network volume](/cloud-servers/volumes/about-network-volumes.mdx). The `<volume>` parameter is the volume ID or name. You can view the list of network volumes using `openstack volume list`;
         * `--snapshot <snapshot>` — to create a server from a [snapshot](/cloud-servers/volumes/snapshots.mdx). The `<snapshot>` parameter is the snapshot ID or name. You can view the list of snapshots using `openstack snapshot list`;
       * `<flavor>` — flavor ID or name. Flavors correspond to [cloud server configurations](/cloud-servers/create/configurations.mdx) and determine the number of vCPUs, RAM, and the (optional) local disk size of the server. You can use fixed-configuration flavors or [create a flavor](/cloud-servers/create/create-flavor.mdx). For example, `1015` is the ID for creating a server with a fixed Standard configuration with 4 vCPUs and 16 GB RAM in the ru-7 pool. You can view the list of flavors using `openstack flavor list` or in the table [List of fixed-configuration flavors in all pools](/cloud-servers/create/configurations.mdx#server-flavors-full-list);
       * `<pool_segment>` — [pool segment](/infrastructure/locations.mdx#pool) in which the cloud server will be created, for example, `ru-7a`. A list of available pool segments can be found in the instructions [Product Availability by Location](/infrastructure/product-availability-by-location.mdx);
       * `<net_uuid>` — ID of the private or public network to which the server will connect. You can view the list using `openstack network list`;
       * `<security_group>` — security group ID or name. To create a server with a security group, [port security (traffic filtering](/cloud-servers/cloud-networks/about-networks.mdx#traffic-filtering-port-security)) must be enabled in the network. You can view the list of groups using the command `openstack security group list`;
       * `<key_name>` — name of the SSH key pair for the service user. If you have not created SSH keys, [generate them](/cloud-servers/manage/create-and-place-ssh-key.mdx#create-ssh-keys). You can view the list using `openstack keypair list`;
       * `--tag preemptible --os-compute-api-version 2.72` — tag for creating a preemptible server;
       * optional: `--block-device-mapping vdb=<extra_volume>` — ID or name of the additional disk. You can view the list using `openstack volume list`;
       * optional: `--property x_cloud_smt_enabled=false` — disable [Hyper-Threading (SMT](/cloud-servers/about/dedicated-cores.mdx#hyper-threading)). If this parameter is not specified, Hyper-Threading (SMT) will be enabled by default. Only available for flavors that support [dedicated cores](/cloud-servers/about/dedicated-cores.mdx). You can view the list of flavors in the table [List of fixed-configuration flavors in all pools](/cloud-servers/create/configurations.mdx#server-flavors-full-list);
       * optional: `--property x_cloud_numa_nodes=1` — place resources on a single NUMA node. Only available for flavors that support [dedicated cores](/cloud-servers/about/dedicated-cores.mdx). You can view the list of flavors in the table [List of fixed-configuration flavors in all pools](/cloud-servers/create/configurations.mdx#server-flavors-full-list);
       * optional: `--tag <tag_name> --os-compute-api-version 2.52` — [tag](/cloud-servers/manage/tags.mdx) to add additional information about the server;
       * optional: `--user-data <user_data.file>` — path to the script with Base64-encoded data. Scripts and tasks are executed when the operating system boots for the first time. You can see examples of scripts in the [User data](/cloud-servers/manage/user-data.mdx) instruction;
       * `<server_name>` — server name.
  </TabItem>
</Tabs>

<Formbricks />
