Uploading a disk image to Yandex.Cloud
The following instructions describe how to upload a disk image to Object Storage and use it to create an image in Compute Cloud.
1. Prepare an image
Supported image formats: Qcow2, VMDK, and VHD.
If you upload a boot disk image, make sure the following requirements are met:
- The OS is Linux-based.
- The latest OS updates are installed.
- The disk is mounted by its UUID rather than by name.
- The Linux kernel is running with the
- The SSH server starts automatically at VM startup.
- The network interface obtains the IP address via DHCP.
We recommend uploading 64-bit systems with the pre-installed
Optimize images before uploading them by using the
qemu-imgutility to import faster:
qemu-img convert -p -O qcow2 -o cluster_size=2M <name of your image file> <name of the new image file>
2. Upload an image to Object Storage
Upload your image to Yandex Object Storage and get a link to the uploaded image:
- If you don't have a bucket in Object Storage, create one.
- Upload the image to your bucket. In Object Storage terms, the uploaded image is called an object.
- Get a link to the uploaded image. Use this link when creating an image in Compute Cloud.
3. Create an image in Compute Cloud
Create a new image from the link obtained in Object Storage:
In the management console, select the folder where you want to create an image.
Select Compute Cloud.
On the Virtual machines page, go to the Images tab.
Click Upload image.
Enter the image name.
The name must be unique within the folder. The name may contain lowercase Latin letters, numbers, and hyphens. The first character must be a letter. The last character can't be a hyphen. The maximum length of the name is 63 characters.
If necessary, add a description of the image.
Insert the link to the image you received in Object Storage.
To create a new image via the link, use the flag
$ yc compute image create --name <IMAGE-NAME> --source-uri <IMAGE-URL>
<IMAGE-NAME>is the name to assign to the image.
<IMAGE-URL>is the link to the image obtained in Object Storage.
If necessary, add a description and specify the family that the image belongs to:
$ yc compute image create \ --name ubuntu-cosmic \ --description "Ubuntu Server 18.10 (Cosmic Cuttlefish)" \ --family ubuntu \ --source-uri "https://storage.yandexcloud.net/mybucket/cosmic-server-cloudimg-amd64.vmdk"
If you know the minimum requirements for the size of a disk that will be created from this image, specify the size in GB:
$ yc compute image create \ --name big-image \ --min-disk-size 20 \ --source-uri "https://storage.yandexcloud.net/mybucket/cosmic-server-cloudimg-amd64.vmdk"
min-disk-size value must be greater than the volume of the source data in the image and greater than the size of the virtual disk specified in the image.
min-disk-size value you specify is less than that allowed, an error will occur and no image will be created. The error description will contain the minimum value in bytes, for example,
Minimal disk size should be greater than or equal to 10737418240.
min-disk-size is specified, the minimum value will be used.
To create a new image via the link, use the Create method for the
Image resource. Pass the link to the image in the
After being created, the image will get the
CREATING status. Wait until the image status changes to
READY before using it.
4. Delete the image from Object Storage
For information about Object Storage pricing, see Pricing policy for Object Storage.