Importing an image from another cloud or folder
To import an image from another cloud or folder:
-
Make sure you have the following roles for the cloud or folder hosting the required image:
- Role for cloud:
resource-manager.clouds.member
. - Role for folder:
viewer
orcompute.images.user
.
For more information about assigning roles, see Assigning roles.
- Role for cloud:
-
Import a copy of this image to your folder using the CLI:
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
parameter.-
See the description of the CLI command to create an image:
yc compute image create --help
-
To get a list of available images in the source cloud or folder, run the following command:
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 the following command:
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 the following command:
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 | +----------------------+--------------------+--------+----------------------+--------+