Transfer (copy) the image and set up image sharing
You can create or download an image:
- Transfer (copy) to another pool segment, project or account — a new image will be created, which can be managed in the source project and in the destination project. Storage of all copies of the image is paid for;
- or configure access to the image between projects within one pool — the image can be managed only in the source project. It is paid to store the image only in the source project.
In both cases, cloud servers and disks can be created from the images.
Transfer (copy) an image to another pool segment, project, or account
To copy an image, you need to get its URL and create a new image from it. You cannot transfer an image directly.
The image can be copied to another pool segment (including in a different availability zone or region), project or account. When copying an image to another project or account, you can also change the pool segment. If you need to copy an image within the same pool segment, configure access to the image between projects — will only pay for storage of the original image.
Storage of all copies of the image is charged at cloud platform payment models. You can manage the image and create cloud servers and disks from it in both the source and destination project.
After copying, you can remove the source image from the image repository.
Control panel
OpenStack CLI
-
In control panel go to Cloud platform → Images.
-
On the menu. image select Copy the URL of the image.
-
Open the projects menu (name of the current project) and select the destination project to which you want to copy the image.
-
Click Create an image.
-
Enter a name for the image.
-
Select pool segment into which the image will be loaded.
Images smaller than 16 GB are automatically replicated to neighboring segments in the pool.
-
Select the operating system.
-
Select the URL as the source of the image.
-
Enter the link you copied in step 2.
-
Select an image format or container format. For more information about formats, see the subsection Own images.
If you do not know which formats to specify, specify the image format
raw
and the container —bare
. -
Optional: check the checkbox Specify the minimum disk and memory capacity. 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.
-
Optional: delete the source image from the image repository.
-
In control panel go to Cloud platform → Images.
-
On the menu. image select Copy the URL of the image.
-
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>
— link that 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 into which the image will be loaded, e.g.ru-1a
. The list of available pool segments can be found in the instructions Availability matrix. Images smaller than 16 GB are automatically replicated to neighboring pool segments.
-
If the image is Linux-based, additionally add properties:
--property hw_disk_bus=scsi \
--property hw_qemu_guest_agent=yes \
--property hw_scsi_model=virtio-scsi \
--property os_distro=ubuntu \
--property os_type=linux \
--property x_sel_image_agent_type=cloud-init \
--property x_sel_image_os_arch=amd64 \
--property x_sel_image_os_dist=ubuntu \
--property x_sel_image_os_type=linux \
--property x_sel_image_type=master \ -
Optional: delete the source image from the image repository.
Customize image access between projects
You can configure image sharing between projects within one account. Cloud servers and disks can be created from the image in the recipient project, but the image can be managed only in the source project: rename, change the operating system, delete the image. Storage of the image is paid only in the source project — by cloud platform payment models.
You can configure the image to be accessed only internally pool.
In the recipient project, you can disable image access.
- In control panel go to Cloud platform.
- Copy the ID of the destination project to which you want to copy the image. To do this, open the projects menu (the name of the current project) and in the line of the desired project press .
- Make sure that you are in the project where the image is located. To do this, open the projects menu (name of the current project) and select the source project.
- Go to the section Cloud platform → Images.
- Open the image card.
- Click Add project.
- Paste the destination project ID you copied in step 2.
- Click .
- Copy the UUID of the image.
- Open the projects menu (name of the current project) and select the destination project.
- Go to the section Cloud platform → Images. Make sure you select the pool to which you want to transfer the image.
- On the section page, click .
- Paste the UUID of the image you copied in step 9.
- Click Get an image.