Move a cloud server or cloud infrastructure
If you need to migrate the configured infrastructure (servers, networks, disks, backups and other resources) or it is important to keep the public IP address when migrating a server, we recommend migrating the infrastructure project to another account. You cannot select a different pool segment during this migration.
You can migrate a cloud server to another pool segment, project, or account.To do this, you must create and migrate a boot disk image of the server or migrate the server disk directly.When migrating the image to another project or account, you can also change the pool segment.You cannot migrate the server directly.
Move a cloud infrastructure project to another account
To migrate your cloud infrastructure to another account, migrate the project.
You can migrate a project only within one pool segment.All project objects will be preserved: servers, networks, public IP addresses, disks and other resources.
To transfer a project to another account, use the Transfer Services to Another Account instructions.
Move the cloud server to another pool segment, project or account
When migrating the server, the public IP address of the cloud server and other project resources will not be migrated.After migrating the server, you can create a new IP address or public subnet.If you want to keep the public IP address, migrate the entire project to another account.
You can move the cloud server to a different pool segment, project, and account.When you move the image to a different project or account, you can also change the pool segment, including selecting a different pool and region.
You can move a server in two ways:
- Transfer the boot disk image to use it to create a new server in a different pool segment, project, or account. We recommend using this method to migrate a server with a small amount of data;
- move the server disk directly to a server in another pool segment, project or account. We recommend using this method to migrate a server with a large amount of data.
Transfer disk image
Transfer the disk directly
-
Look at the name and type of boot disk of the source cloud server.
-
If additional disks are used on the source server, migrate them and connect them to the target server.
-
If the source and target servers are in different pools, create a new public IP address for the server.
1. View the name and type of the boot disk of the source server
-
In the Dashboard, on the top menu, click Products and select Cloud Servers.
-
Open the Servers tab → Server page.
-
Open the Configuration tab. If the tab has the Local Disk field, the server has a bootable local disk.
-
Open the Network Disks tab. If there is a Bootable tag in the disk line, the server has a bootable network disk.
2. Create a bootable disk image of the source server
Control panel
OpenStack CLI
-
In the control panel top menu, click Products and select Cloud Servers.
-
From the server menu, select Shutdown. The server will enter the
SHUTOFF
status. -
Go to the Images section.
-
Click Create Image.
-
Enter a name for the image.
-
Select the pool segment to which the image will be loaded. Images smaller than 16 GB are automatically replicated to neighboring pool segments.
-
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 box 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 image will only be available for one project and pool for which you have configured authorization in the OpenStack API.
The process of creating an image depends on the type of disk you looked at earlier.
Local disk
Network disk
-
Shut down the server — a non-consistent image may be created from a running disk:
openstack server stop <server>
Specify
<server>
— server ID or name. The list can be viewed using theopenstack server list
command.The server will go into
SHUTOFF
status. -
Create a local disk image:
openstack server image create --name <image_name> <server>
Specify:
<image_name>
— image name;<server>
— The server ID or name. The list can be viewed with the commandopenstack server list
.
-
Shut down the server — a non-consistent image may be created from a running disk:
openstack server stop <server>
Specify
<server>
— server ID or name. The list can be viewed using theopenstack server list
commandThe server will go into
SHUTOFF
status. -
Disconnect the network drive from the server:
openstack server remove volume <server> <volume>
Specify:
<server>
— The server ID or name. The list can be viewed with the commandopenstack server list
;<volume>
— ID or name of the network drive. You can view the list with the commandopenstack volume list
.
-
Check that the network drive has entered the
AVAILABLE
status:openstack volume list
-
Create a network disk image:
openstack image create --volume <volume> <image_name>
Specify
<image_name>
— image name.
3. Transfer the image
The image can be moved 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
-
In the Dashboard, on the top menu, click Products and select Cloud Servers.
-
Go to the Images section.
-
From the menu of the boot disk image, select Copy link.
-
Go to the account you want to move the server to.
-
Open the projects menu (name of the current project) and select the desired project.
-
Click Create Image.
-
Enter a name for the image.
-
Select the pool segment to which you want to migrate the image. 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 3.
-
Select the image format and container format.
If you don't know what formats to specify, specify
raw
image format,bare
container format. -
Select the operating system.
-
Optional: check the box 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.
4. Create a target server from the image
Control panel
OpenStack CLI
-
In the dashboard, on the top menu, click Products and select Cloud Servers.
-
Click Create Server.
-
Enter the name of the cloud server. This will be set as the hostname in the operating system on the server.
-
Select the pool segment to which you transferred the boot disk image.
-
Click the default source name → My Images tab.
-
Select the boot disk image you created earlier.
-
Press Select.
-
Select a cloud server configuration:
- fixed — lines with different vCPU to RAM ratios up to 48 vCPUs, 320 GB of RAM, and 1.25 TB of local disk capacity;
- arbitrary — select any resource ratio up to 32 vCPUs, 256 GB RAM and 2 TB of local disk space.
Different configurations and server lines use different processors depending on the pool segment. You can add GPUs to the configurations — more details in the Create a cloud server with GPU instructions.
After the server is created, you can change the configuration.
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 amount on an existing server with
sudo dmesg | grep Memory
. -
Select the server boot (system) disk:
- local disk without network latency — check the box Local SSD NVMe disk. If you have selected 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 Disk Type field, select the type of disk and specify its size.
Once the server is created, only the network boot disk can be replaced.
-
Click Add.
-
Optional: To add an additional disk to the server, click Add. Multiple disks can be added.
After the server is created, you can disconnect additional disks from the server and connect new disks.
You can migrate additional disks that were attached to the source server.
-
In the Network block, connect an existing private subnet with the cloud router or create a new one:
Existing private subnet
New private subnet
12.1 Click Private Subnet.
12.2. In the Public IP Address for Internet Access field, select New Public IP Address.
12.3. Expand the block with private subnet settings.
12.4. In the Subnet field, select an existing subnet.
12.5. In the Private IP field, specify the private IP address of the server. The public IP address will be automatically connected to the private address.
12.1 Click Private Subnet.
12.2. In the Public IP Address for Internet Access field, select New Public IP Address.
12.3. Expand the block with private subnet settings.
12.4 If you have existing networks in the project, select New Subnet in the Subnet field.
12.5 Optional: Change the CIDR of the subnet.
12.6 Optionally: enable the DHCP toggle switch.
12.7. Optional: in the Gateway field, change the IP address of the default gateway.
12.8. In the Network field, select the existing network where the subnet will be created or New network. For a private subnet with a public IP address,
router-<network_name>
, where<network_name>
is the network name, will be automatically created.12.9. If you selected New Network, enter the name of the network.
-
Select security groups to filter traffic on server ports. Without security groups, traffic will not be allowed. If there is no block, port security is disabled on the server network . With traffic filtering disabled, all traffic will be allowed.
-
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 click Add SSH Key. Enter a key name and insert a public SSH key in OpenSSH format. Click Add.
If SSH keys are not created, generate them.
-
Optional: Copy and save the password of the
root
user (a user with unlimited rights to all actions on the system). Store the password in a safe place and do not share it in plaintext. -
Optional: To create an interruptible server, check the Interruptible Server checkbox.
-
Optional: if you plan to create multiple servers and want to increase the resiliency of your infrastructure, we recommend using placement groups or placing cloud servers in different segments of the pool — otherwise we do not guarantee placement on different hosts.
Select an existing placement group or click Create Group and enter a group name. Select a 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;
- necessarily on different hosts — anti-affinity, servers in a group are necessarily located 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 the group directly — only by creating a copy.
-
Optional: to add additional information to the server or filter the servers in the list, add a tag. Multiple tags can be added. Operating system and configuration tags are automatically added.
In the Tags field, check the existing tags or enter a new one. The maximum length of the tag is 60 characters. You can use Latin and Cyrillic letters, numbers and hyphen sign.
-
Optional: in the User data field, 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 User data instruction.
-
Click Create Server.
-
Create a cloud server:
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> \
<server_name>
Specify:
- source type:
--image <image>
— to create a server from off-the-shelf or custom image. Parameter<image>
— ID or name of the image. The list of images can be viewed with the commandopenstack image list
;--volume <volume>
— to create a server from network disk. Parameter<volume>
— ID or disk name. You can view the list of network disks with the commandopenstack volume list
;--snapshot <snapshot>
— to create a server from snapshot. Parameter<snapshot>
— ID or name of the snapshot. The list of snapshots can be viewed with the commandopenstack 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 create a flavor. For example,4011
— ID to create a Memory Line fixed configuration server with 2 vCPUs, 16 GB RAM in a ru-9 pool. You can view the list of flavors using the commandopenstack flavor list
or in the table List of fixed configuration flavors in all pools;<pool_segment>
— pool segment in which the cloud server will be created, e.g.ru-9a
. The list of available pool segments can be found in the instructions. Availability matrices;<net_uuid>
— ID of the private or public network to which the server will be connected. The list can be viewed with the commandopenstack network list
;<security_group>
— The ID or name of the security group that will be assigned to all ports on the server. To create a server with a security group, the network must have port security enabled. port security. The list of groups can be viewed with the commandopenstack security group list
;<key_name>
— name of the SSH key pair for the service user. If SSH keys are not created, generate them. The list can be viewed with the commandopenstack keypair list
;- optional:
--block-device-mapping vdb=<extra_volume>
— ID or name of the extra disk. The list can be viewed using theopenstack volume list
command; - 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
— tag to create an interruptible server; - optional:
--user-data <user_data.file>
— path to the script with Base64 encoded data. 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 User data instruction; <server_name>
— server name.
5. Move additional disks
If additional disks are used on the original cloud server, you can migrate them.
6. Create a public IP address for the server
Control panel
OpenStack CLI
-
Create a public IP address:
openstack floating ip create external-network
-
Look at the name and type of boot disk of the source cloud server.
-
If additional disks are used on the source server, migrate them and connect them to the target cloud server.
1. View the name and type of the boot disk
-
In the dashboard, on the top menu, click Products and select Cloud Servers.
-
Open the Servers tab → Server page.
-
Open the Configuration tab. If the tab has the Local Disk field, the server has a bootable local disk.
-
Open the Network Disks tab. If there is a Bootable tag in the disk line, the server has a bootable network disk.
2. Create a target server
Control panel
OpenStack CLI
-
In the Dashboard, on the top menu, click Products and select Cloud Servers.
-
Click Create Server.
-
Enter the name of the cloud server. This will be set as the hostname in the operating system on the server.
-
Select a pool segment.
-
Click on the default source name.
-
Select the source from which the server will be created. The boot type of the source (BIOS or UEFI) must match the boot type of the source server.
-
Press Select.
-
Select a cloud server configuration:
- fixed — lines with different vCPU to RAM ratios up to 48 vCPUs, 320 GB of RAM, and 1.25 TB of local disk capacity;
- arbitrary — select any resource ratio up to 32 vCPUs, 256 GB RAM and 2 TB of local disk space.
Different configurations and server lines use different processors depending on the pool segment. You can add GPUs to the configurations — more details in the Create a cloud server with GPU instructions.
After the server is created, you can change the configuration.
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 amount on an existing server with
sudo dmesg | grep Memory
. -
Select the server boot (system) disk:
- local disk without network latency — check the box Local SSD NVMe disk. If you have selected 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 Disk Type field, select the type of disk and specify its size.
The disk must be at least as large as the disk size of the source server.
Once the server is created, only the network boot disk can be replaced.
-
Click Add.
-
Optional: To add an additional disk to the server, click Add. Multiple disks can be added.
After the server is created, you can disconnect additional disks from the server and connect new disks.
You can migrate additional disks that were attached to the source server.
-
In the Network block, connect an existing private subnet with the cloud router or create a new one:
Existing private subnet
New private subnet
12.1 Click Private Subnet.
12.2. In the Public IP Address for Internet Access field, select New Public IP Address.
12.3. Expand the block with private subnet settings.
12.4. In the Subnet field, select an existing subnet.
12.5. In the Private IP field, specify the private IP address of the server. The public IP address will be automatically connected to the private address.
12.1 Click Private Subnet.
12.2. In the Public IP Address for Internet Access field, select New Public IP Address.
12.3. Expand the block with private subnet settings.
12.4. If you have existing networks in the project, select New Subnet in the Subnet field.
12.5 Optional: Change the CIDR of the subnet.
12.6 Optionally: enable the DHCP toggle switch.
12.7. Optional: in the Gateway field, change the IP address of the default gateway.
12.8. In the Network field, select the existing network where the subnet will be created or New network. For a private subnet with a public IP address,
router-<network_name>
, where<network_name>
is the network name, will be automatically created.12.9. If you selected New Network, enter the name of the network.
-
Select security groups to filter traffic on server ports. Without security groups, traffic will not be allowed. If there is no block, port security is disabled on the server network . With traffic filtering disabled, all traffic will be allowed.
-
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 click Add SSH Key. Enter a key name and insert a public SSH key in OpenSSH format. Click Add.
If SSH keys are not created, generate them.
-
Optional: Copy and save the password of the
root
user (a user with unlimited rights to all actions on the system). Store the password in a safe place and do not share it in plaintext. -
Optional: To create an interruptible server, check the Interruptible Server checkbox.
-
Optional: if you plan to create multiple servers and want to increase the resiliency of your infrastructure, we recommend using placement groups or placing cloud servers in different segments of the pool — otherwise we do not guarantee placement on different hosts.
Select an existing placement group or click Create Group and enter a group name. Select a 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;
- necessarily on different hosts — anti-affinity, servers in a group are necessarily located 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 the group directly — only by creating a copy.
-
Optional: to add additional information to the server or filter the servers in the list, add a tag. Multiple tags can be added. Operating system and configuration tags are automatically added.
In the Tags field, check the existing tags or enter a new one. The maximum length of the tag is 60 characters. You can use Latin and Cyrillic letters, numbers and hyphen sign.
-
Optional: in the User data field, 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 User data instruction.
-
Click Create Server.
-
Create a cloud server:
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> \
<server_name>Specify:
- source type:
--image <image>
— to create a server from off-the-shelf or custom image. Parameter<image>
— ID or name of the image. The list of images can be viewed with the commandopenstack image list
;--volume <volume>
— to create a server from network disk. Parameter<volume>
— ID or disk name. You can view the list of network disks with the commandopenstack volume list
;--snapshot <snapshot>
— to create a server from snapshot. Parameter<snapshot>
— ID or name of the snapshot. The list of snapshots can be viewed with the commandopenstack 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 create a flavor. For example,4011
— ID to create a Memory Line fixed configuration server with 2 vCPUs, 16 GB RAM in a ru-9 pool. You can view the list of flavors using the commandopenstack flavor list
or in the table List of fixed configuration flavors in all pools;<pool_segment>
— pool segment in which the cloud server will be created, e.g.ru-9a
. The list of available pool segments can be found in the instructions. Availability matrices;<net_uuid>
— ID of the private or public network to which the server will be connected. The list can be viewed with the commandopenstack network list
;<security_group>
— The ID or name of the security group that will be assigned to all ports on the server. To create a server with a security group, the network must have port security enabled. port security. The list of groups can be viewed with the commandopenstack security group list
;<key_name>
— name of the SSH key pair for the service user. If SSH keys are not created, generate them. The list can be viewed with the commandopenstack keypair list
;- optional:
--block-device-mapping vdb=<extra_volume>
— ID or name of the extra disk. The list can be viewed using theopenstack volume list
command; - 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
— tag to create an interruptible server; - optional:
--user-data <user_data.file>
— path to the script with Base64 encoded data. 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 User data instruction; <server_name>
— server name.
- source type:
3. Transfer the source server disk to the destination server
-
Look up the boot disk ID, to do this, bring up the disk information:
lsblk
The response will show information about the server disks. The value
/boot/efi
in theMOUNTPOINTS
column indicates the boot disk. For example:NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part /mnt/data
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 16G 0 part [SWAP]
└─nvme0n1p3 259:3 0 449.3G 0 part /Here
nvme0n1
is the disk ID. -
Copy the boot disk ID you got in step 2.
-
Look at the disk IDs, to do this, bring up the disk information:
lsblk
The response will show information about the server disks. The value
/boot/efi
in theMOUNTPOINTS
column indicates the boot disk. For example:NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 1.8T 0 disk
└─sda1 8:1 0 1.8T 0 part /mnt/data
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part /mnt/backup
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 16G 0 part [SWAP]
└─nvme0n1p3 259:3 0 449.3G 0 part /Here
nvme0n1
is the disk ID. -
Copy the boot disk ID that you obtained in step 6.
-
Transfer the disk to the target server:
ssh root@NEW-IP '> /dev/<target_disk_id>' < /dev/<source_disk_id>
Specify:
<target_disk_id>
— The disk identifier of the target server. The target server's drive letter can be the same as the source server's drive letter;<source_disk_id>
— the disk ID of the source server.
4. Move additional disks
If additional disks are used on the original cloud server, you can migrate them.