Importing an image from a different cloud or folder
To import an image from a different cloud or folder:
-
Make sure you have the following roles for the cloud or folder hosting your image:
- Role for the cloud:
resource-manager.clouds.member
. - Role for the folder:
viewer
orcompute.images.user
.
For more information about assigning roles, see Assigning roles.
- Role for the cloud:
-
Import a copy of this image to your folder using the CLI:
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the
yc config set folder-id <folder_ID>
command. You can specify a different folder using the--folder-name
or--folder-id
parameter.-
See the description of the CLI command for creating an image:
yc compute image create --help
-
To get a list of available images in the source cloud or folder, run
yc compute image list --folder-name <source_folder_name>
. Here is an example:yc compute image list --folder-name my-source-folder
Result:
+----------------------+-------------+--------+----------------------+--------+ | ID | NAME | FAMILY | PRODUCT IDS | STATUS | +----------------------+-------------+--------+----------------------+--------+ | fd8eq6b2fkut******** | first-image | | f2ehc12fue73******** | READY | +----------------------+-------------+--------+----------------------+--------+
-
Select
ID
orNAME
of the image you are importing. -
To import an image, run
yc compute image create --source-image-id=<source_image_ID>
. Here is an example:yc compute image create --source-image-id=fd8o0pt9qfbt********
Result:
done (12s) id: fd8eq6b2fkut******** folder_id: b1g07hj5r6i4******** created_at: "2024-08-14T17:45:44Z" storage_size: "2562719744" min_disk_size: "21474836480" product_ids: - f2ehc12fue73******** status: READY os: type: LINUX
-
-
Check the result by running
yc compute image list --folder-name <target_folder_name>
. Here is an example:yc compute image list --folder-name my-destination-folder
Result:
+----------------------+--------------------+--------+----------------------+--------+ | ID | NAME | FAMILY | PRODUCT IDS | STATUS | +----------------------+--------------------+--------+----------------------+--------+ | fd8eq6b2fkut******** | first-image | | f2ehc12fue73******** | READY | | fd8ghl1n3brd******** | second-image | | f2e87com7i95******** | READY | +----------------------+--------------------+--------+----------------------+--------+