Move the cloud server
The cloud server can Move to another pool segment, project or account. To do this, you need to create an image of the server boot disk, transfer the image and create a new server from it. When transferring the image to another project or account, you can also change the pool segment. It is not possible to transfer a server directly.
If it is important to keep the public IP address when migrating a server, or if you need to move cloud infrastructure (servers, networks, disks, backups and other resources), we recommend move the project to another account. All infrastructure will remain intact, including public IP addresses. You cannot select a different pool segment during this migration.
Move cloud infrastructure to another account
To migrate your cloud infrastructure to another account, migrate the following project.
You can only transfer a project within one pool segment. All project objects will be preserved: servers, networks, public IP addresses, disks and other resources.
To move the project to another account, use the instructions Transfer services to another account.
Move the cloud server to another pool segment, project or account
The cloud server can be moved to another pool segment, project and account. When you transfer an image to another project or account, you can also change the pool segment, including selecting a different pool and region.
Limitations when migrating a server using this method:
- The public IP address of the server will not be migrated. After the server is migrated, you can create a new IP address or public subnet. If you want to keep the public IP address, move the entire project to another account;
- other project resources are not migrated.
To move the server:
- See which cloud server disk is bootable.
- Create a boot disk image of the cloud server.
- Transfer the image to the account, project, or pool segment to which you want to migrate the cloud server.
- Create a cloud server from a boot disk image. If the image is larger than 50 GB, you must first create a disk from it, and then create a server from the disk.
- If additional disks are used on the source server, migrate them and connect them to the new server..
- If the transfer was not within the same pool, create a new public IP address for the server.
View the boot disk
- In control panel go to Cloud platform → Servers.
- Open the tab Servers → server page.
- Open the tab Configuration. If there is a field on the tab Local diskthen the server has a bootable local disk.
- Open the tab Network disks. If there is a tag in the disk line Loadingthen the server has a bootable network disk.
Create a bootable disk image
Control panel
OpenStack CLI
- If the disk is connected to a cloud server, we recommend that you shut down the cloud server — a non-consistent image may be created from a working disk.
- In control panel go to Cloud platform → Images.
- Click Create an image.
- Enter a name for the image.
- Select pool segment to which the image will be loaded. Images smaller than 16 GB are automatically replicated to neighboring segments in the pool.
- Select the disk as the image source.
- Select a disk — you can only create an image in the pool where the disk is located.
- Optional: check the checkbox Specify minimum disk and memory requirements. Specify the minimum amount of RAM in MB and disk capacity in GB. When you create a cloud server from this image, the control panel or API will automatically check these limits.
- Click Create.
The process of creating an image depends on the type of disk.
The image will only be available for the single project and pool for which you configured authorization in OpenStack API.
Local disk
Network disk
-
If the disk is connected to a cloud server, we recommend shutting down the cloud server — a non-consistent image may be created from a running disk:
openstack server stop <server>
Specify
<server>
— ID or server name. The list can be viewed using the commandopenstack server list
The server will go into status
SHUTOFF
. -
Create a local disk image:
openstack server image create --name <image_name> <server>
Specify:
<image_name>
— image name;<server>
— ID or server name. The list can be viewed withopenstack server list
-
If the disk is connected to a cloud server, we recommend shutting down the cloud server — a non-consistent image may be created from a running disk:
openstack server stop <server>
Specify
<server>
— ID or server name. The list can be viewed using the commandopenstack server list
The server will go into status
SHUTOFF
. -
Disconnect the network drive from the server:
openstack server remove volume <server> <volume>
Specify:
<server>
— ID or server name. The list can be viewed withopenstack server list
;<volume>
— ID or name of the network drive. You can view the list withopenstack volume list
-
Check that the network drive has reached the status of
AVAILABLE
:openstack volume list
-
Create a network disk image:
openstack image create --volume <volume> <image_name>
Specify
<image_name>
— image name.
Transfer the image
The image can be transferred to another account, project or pool segment.
When you move an image to another account or project, you can also change the pool segment.
Control panel
OpenStack CLI
-
In control panel go to Cloud platform → Images.
-
On the menu. of the boot disk image, select Copy the URL of the image.
-
Make sure you are in the account and project you want to move the server to. Open the projects menu (name of the current project) and select the desired project.
-
Click Create an image.
-
Enter a name for the image.
-
Select pool segment The cloud server will be moved to the same segment. The cloud server will be moved to the same segment.
-
Select URL as the image source.
-
Paste the URL of the image you copied in step 2.
-
Select the image format and container format.
If you do not know which formats to specify, specify the image format
raw
and the container —bare
. -
Select the operating system.
-
Optional: check the checkbox Specify minimum disk and memory requirements. Specify the minimum amount of RAM in MB and disk capacity in GB. When you create a cloud server from this image, the control panel or API will automatically check these limits.
-
Click Create.
-
In control panel go to Cloud platform → Images.
-
On the menu. of the boot disk image, select Copy the URL of the image.
-
Make sure that you configured authorization in OpenStack API for the account, project, and pool to which you want to migrate the cloud server.
-
Create an image:
glance image-create-via-import \
--import-method web-download \
--uri <image_url> \
--name <image_name> \
--disk-format <image_format> \
--container-format <container_format> \
--property hw_disk_bus=scsi \
--property hw_scsi_model=virtio-scsi \
--property x_sel_image_owner=Selectel \
--property hw_qemu_guest_agent=yes \
--store <pool_segment>Specify:
<image_url>
— URL of the image you copied in step 2;<image_name>
— image name;<image_format>
— image format. For more information about image formats, see the subsection Own images. If you do not know which format to specify, specifyraw
;<container_format>
— container format. More information about container formats in the subsection Own images. If you do not know which format to specify, specifybare
;<pool_segment>
— pool segment To which you want to move the cloud server, for exampleru-1a
. The list of available pool segments can be found in the instructions Availability matrix. The image will be moved to the same segment. Images smaller than 16 GB are automatically replicated to neighboring segments in the pool.
Create a cloud server
If the image size is less than 50 GB, you can create a cloud server directly from the boot disk image.
If the image size is larger than 50 GB, we recommend that you first disk image and then create a server from that disk. This will help to avoid an error when creating the server.
Control panel
OpenStack CLI
-
If the size of the boot disk image is more than 50 GB, create a disk from the image.
-
In control panel go to Cloud platform → Servers.
-
Click Create a server.
-
Enter the name of the cloud server. This will be set as the hostname in the operating system on the server.
-
Select pool segment into which you transferred the boot disk image.
-
Click on the default source name. Select the source from which the server will be created:
- If the size of the created disk image is less than 50 GB, open the tab My images. Select the boot disk image that you previously created;
- If the image size is more than 50 GB, open the tab Disks. Select the disk created from the boot disk image.
Click Select.
-
Select a cloud server configuration:
- fixed — lineup with different vCPU to RAM ratios up to 36 vCPUs, 128 GB of RAM and 1.25 TB of local disk capacity;
- arbitrary — choosing any resource ratio up to 32 vCPUs, 256 GB RAM and 1.23 TB of local disk space.
Different server configurations and lineups use different pool segments depending on the pool segment processors. GPUs can be added to the configurations — more details in the instructions Create a cloud server with GPU.
Once the server is created, you can reconfigure.
The amount of RAM that is allocated to the server may be less than the specified amount — the operating system kernel reserves some RAM depending on the kernel version and distribution. You can check the allocated capacity on an existing server using
sudo dmesg | grep Memory
-
Select the server boot (system) disk:
- local disk without network delays — check the box. Local SSD NVMe disk. If you chose an arbitrary configuration, specify the local disk size. If you selected fixed, the disk size will depend on the configuration;
- or network disk — in the field Disk type select disk type and specify its size.
Once the server is created, you can replace only the network boot disk.
Click Add.
-
Optional: To add an additional disk to the server, press Add. Multiple disks can be added.
Once the server is created, you can disconnect additional disks from it and connect new ones.
You can relocate additional disks that were connected to the original server.
-
Select or create the subnet to which the server will connect:
- private subnet — a subnet without access from the Internet;
- private subnet with public IP address — a private subnet and one static public IP address;
- public subnet — all addresses in the subnet will be accessible from the Internet.
-
To securely connect to the server, place an SSH key on the server. Multiple keys can be added. The supported key types are ed25519, rsa, ecdsa, and dsa.
Select an existing key or press Add an SSH key. Enter a key name and insert a public SSH key in OpenSSH format. Click Add.
If SSH keys have not been created, generate them.
-
Optional: copy and save the user password
root
(a user with unlimited rights to all system operations). Keep the password in a safe place and do not share it publicly. -
Optional: to create preemptible server and check the box Preemptible server.
-
Optional: if you plan to create multiple servers and want to increase the fault tolerance of your infrastructure, we recommend using accommodation groups or place cloud servers in different segments of the pool — in other cases we do not guarantee placement on different hosts.
Select an existing placement group or press Create a group and enter a group name. Select the placement policy:
- Preferably on different hosts — soft-anti-affinity, the system will try to place servers on different hosts. If there is no suitable host when creating a server, it will be created on the same host;
- Must be on different hosts — anti-affinity, servers in a group must be on different hosts. If we do not find a suitable host, the server will not be created.
Once a server is created, it cannot be added to a group directly — only through the copy creation.
-
Optional: to add additional information to the server or filter the servers in the list, add tag. Multiple tags can be added. Operating system and configuration tags are automatically added.
In the field Tags mark existing tags or enter a new one. The maximum length of a tag is 60 characters. You can use Latin and Cyrillic letters, numbers and hyphen sign.
-
Optional: in the field User data insert or upload a script that will be executed at system startup. The maximum size of a script with non-Base64 encoded data is 16 KB. Examples of scripts and supported formats can be found in the manual User data.
-
Click Create a server.
-
If the size of the boot disk image is more than 50 GB, create a disk from the image.
-
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> \
<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
;- 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:
--tag preemptible --os-compute-api-version 2.72
— creation tag of a preemptible 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:
Move additional disks
If additional disks are used on the original cloud server, you can migrate them.
- Create images of additional disks.
- Transfer the additional disk images to the account, project, or pool segment to which you migrated the cloud server.
- Create network disks from images.
- Connect the network drives to the new cloud server.
Create a public IP address for the server
Control panel
OpenStack CLI
- In control panel go to Cloud platform → Network.
- Open the tab Public IP addresses.
- Click Create an IP address.
- Select pool This will create a public IP address.
- Specify the number of public IP addresses.
- Click Create.
-
Create a public IP address:
openstack floating ip create external-network