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 move a cloud server to another pool segment, project, or account. To do this, you need to create and transfer the server boot disk image. When moving the image to another project or account, you can also change the pool segment. It is not possible to transfer 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 you migrate a 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.
To move the 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 original server, migrate them and connect them to the new server.
-
If the migration was not within the same pool, create a new public IP address for the server.
1. View 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 bootable disk image
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.
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>
— Server ID or name. The list can be viewed withopenstack 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>
— Server ID or 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 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 Control panel, 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 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 is larger than 50 GB, we recommend that you first create a disk from the image and then create a server from that disk. This will help you avoid an error when creating the server.
Control panel
OpenStack CLI
-
If the boot disk image is larger than 50 GB, create a disk from the image.
-
In the Control panel, 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 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 My Images tab. Select the bootable disk image you created earlier;
- If the image size is more than 50 GB, open the Disks tab. Select the disk created from the boot disk image.
-
Press Select.
-
Select a cloud server configuration:
- fixed — lines with different vCPU to RAM ratios up to 36 vCPUs, 128 GB of RAM, and 1.25 TB of local disk capacity;
- arbitrary — select any resource ratio up to 32 vCPUs, 256 GB RAM and 1.23 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.
-
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 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;
- Must be on different hosts — anti-affinity, servers in a group must be 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.
-
If the boot disk image is larger 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 off-the-shelf or custom image. Parameter<image>
— ID or name of the image. The list of images can be viewed withopenstack 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 usingopenstack 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 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 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 usingopenstack 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 withopenstack network 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 withopenstack keypair list
;- optional:
--block-device-mapping vdb=<extra_volume>
— ID or name of the extra 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
— 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:
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