Create a preemptible cloud server
A preemptible cloud server is a cloud server that runs for no more than 24 hours after creation and can be stopped by Selectel at any time, for example, if the virtual host does not have enough resources for other cloud servers.
When a system interrupt occurs, the cloud server is not deleted — it stops and goes to status EXPIRED
. After an interruption, the server can be restored. On a server with a network boot disk all data is saved, with a local boot disk all data is deleted. Read more about to restore the preemptible server.
Preemptible servers support all the features that are available for regular cloud servers, while costing an average of 70% less.
You can make the cloud server preemptible when server creation or after-- change server type. Any server can be made preemptible configurations.
What tasks are suitable for
Suitable for fault-tolerant systems where multiple servers are used and when some of them fail, the load is redistributed to other servers:
- for parallel batch data processing;
- CI/CD testing;
- Hadoop and Kubernetes projects;
- scaling fault-tolerant web services at peak load times;
- any fault-tolerant projects with variable load.
Limitations
Preemptible cloud servers are temporarily available only in the pool ru-7.
We do not guarantee the same level of availability as conventional cloud servers — preemptible servers have no effect SLA for cloud platform.
Cost
The cost of a preemptible server is on average 70% lower than the cost of a regular cloud server with the same configuration.
During operation, preemptible cloud servers are charged at the cloud platform payment models.
After the interruption:
- vCPU, RAM, GPU, local disks are no longer charged starting from the next hour after the stop;
- public IP addresses, public subnets and network disks continue to be charged.
Create a preemptible server
A preemptible server will be stopped by Selectel at any time within 24 hours of creation.
Control panel
OpenStack CLI
- In control panel go to Cloud platform → Servers.
- Click Create a server.
- In the block Additional settings check the box Preemptible server.
- Select the rest of the server settings — more details in the instructions Create a cloud server.
- Click Create.
-
Create a cloud server:
openstack server create \
[--image <image> | --volume <volume> | --snapshot <snapshot>] \
--flavor <flavor> \
--availability-zone <pool_segment> \
--nic net-id=<net_uuid> \
--key-name <key_name> \
--tag preemptible --os-compute-api-version 2.72 \
<server_name>Specify:
- source type:
--image <image>
— to create a server from finished or own image. Parameter<image>
— ID or image name. You can view the list of images usingopenstack image list
;--volume <volume>
— to create a server from network drive. Parameter<volume>
— ID or disk name. You can view the list of network drives byopenstack volume list
;--snapshot <snapshot>
— to create a server from snapshot. Parameter<snapshot>
— ID or name of the snapshot. You can view the list of snapshots withopenstack snapshot list
;
<flavor>
— The ID or name of the flavor. The flavors correspond to cloud server configurations and determine the number of vCPUs, RAM, and local disk size (optional) of the server. You can use fixed-configuration flavors or flavor. For example,4011
— ID to create a Memory Line fixed configuration server with 2 vCPUs, 16GB RAM in a ru-9 pool. The list of flavors can be viewed withopenstack flavor list
or in a table List of fixed-configuration flavorings in all pools;<pool_segment>
— pool segment where the cloud server will be created, e.g.ru-9a
. The list of available pool segments can be found in the instructions Availability matrix;<net_uuid>
— The ID of the private or public network to which the server will be connected. The list can be viewed byopenstack network list
;<key_name>
— the name of the SSH key pair for the service user. If SSH keys have not been created, generate them. The list can be viewed withopenstack keypair list
;--tag preemptible --os-compute-api-version 2.72
— a tag to create a preemptible server;- optional:
--block-device-mapping vdb=<extra_volume>
— ID or name of the additional disk. The list can be viewed withopenstack volume list
; - optional:
--tag <tag_name> --os-compute-api-version 2.52
— tag to add more information about the server; - optional:
--user-data <user_data.file>
— path to the script with data encoded in Base64. Scripts and tasks from the script will be executed at the first boot of the operating system. Examples of scripts can be found in the instructions User data; <server_name>
— server name.
- source type:
Change server type
You can change the type of cloud server — make a non-preemptible server preemptible and vice versa.
A preemptible server will be stopped by Selectel at any time within 24 hours of creation. After each change of server type to a preemptible server, the 24 hour countdown starts over.
Control panel
OpenStack CLI
- In control panel go to Cloud platform → Servers.
- Open the server page → tab Configuration.
- In the block Server type click .
- Check the new server cost and click Modify.
-
Change the server type to preemptible:
openstack server set \
--tag preemptible \
--os-compute-api-version 2.72 \
<server>Or preemptible:
openstack server unset \
--tag preemptible \
--os-compute-api-version 2.72 \
<server>Specify
<server>
— ID or server name, can be viewed with the commandopenstack server list
Restore a preemptible server
You can restore a preemptible server to status EXPIRED
— to reopen it.
Recovery depends on the type of boot disk:
- if the disk is networked, the server recovers from the disk and continues to operate in the state it was in when it stopped;
- if the disk is local, a new cloud server is created from the image from which it was created. Data that appeared on the server during the process is not restored.
Once restored, the server will continue to be preemptible and will be stopped by Selectel at any time within 24 hours of restoration.
Control panel
OpenStack CLI
- In control panel go to Cloud platform → Servers.
- On the menu. of the server select Resume.
-
Reactivate the cloud server:
openstack server unshelve <server>
Specify
<server>
— ID or server name, can be viewed with the commandopenstack server list