Uploading images for virtual machines
To upload an image
Admin panel
- On the Compute > Virtual machines > Images tab, click Add image.
-
In the Add image window, do the following:
- Click Browse and select a file in one of the supported formats: .iso, .img, .qcow2, .raw.
- Specify an image name to be shown in the admin panel.
-
Select the correct OS type from the drop-down list.
The OS type affects VM parameters such as hypervisor settings. VMs created from an image with an incorrect OS type may not work correctly, for example, they may crash.
-
If you have chosen an image in the QCOW2, RAW, or IMG format, select the UEFI boot check box, to mark the image as UEFI bootable. This option cannot be configured after the image is uploaded.
-
Select the Share between all projects check box. With the option disabled, the image will only be available in the admin project of the Default domain.
- Click Add to start uploading the image. The upload progress will be shown in the bottom right corner.
You can hide the pop-up window without interrupting the upload process. The upload progress will be available in the notification center.
Command-line interface
Use the following command:
vinfra service compute image create [--min-disk <size-gb>] [--min-ram <size-mb>] [--os-distro <os-distro>] [--protected | --unprotected] [--restricted] [--unrestricted] [--public] [--private] [--disk-format <disk_format>] [--container-format <format>] [--tags <tags>] --file <file> [--uefi] <image-name>
--min-disk <size-gb>
- Minimum disk size required to boot from image, in gigabytes
--min-ram <size-mb>
- Minimum RAM size required to boot from image, in megabytes
--os-distro <os-distro>
- OS distribution. To list available distributions, run
vinfra service compute cluster show
. --protected
- Protect image from deletion
--unprotected
- Allow image to be deleted
--restricted
- Make image download restricted
--unrestricted
- Allow image to be downloaded
--public
- Make image accessible to all users
--private
- Make image accessible only to the owners.
--disk-format <disk_format>
- Disk format:
detect
,iso
,qcow2
,raw
(default:detect
) --container-format <format>
- Container format:
bare
--tags <tags>
- A comma-separated list of tags
--file <file>
- Create image from a local file
--uefi
- Create image with UEFI boot
<image-name>
- Image name
For example, to create a Cirros image from the local file and upload it to the compute cluster:
# vinfra service compute image create mycirrosimg --file /distr/cirros-0.4.0-x86_64-disk.img Uploading image to server [elapsed time: 0:00:04]... |
The upload progress will be shown in the command output. To see all of the existing images in the compute cluster, run:
# vinfra service compute image list +---------------------+-------------+----------+--------+-------------+ | id | name | size | status | disk_format | +---------------------+-------------+----------+--------+-------------+ | 179f45ef-c5d6-<...> | mycirrosimg | 12716032 | active | qcow2 | | 4741274f-5cca-<...> | cirros | 12716032 | active | qcow2 | +---------------------+-------------+----------+--------+-------------+