Images#

General information#

If you often use a specific instance configuration, you can save it as an image. The image enables you to save launch parameters, so you don’t need to specify them every time you start an instance.

All images are grouped according to the following criteria:

  • K2 Cloud images – images that K2 Cloud offers;

  • own images – images created by a user in the Images subsection;

  • shared images – images accessible to a user.

Own and shared images can also include images created during the backup process. To display them in the resource table, enable Show recovery points.

An image is a list of volumes attached when an instance is created (Block Device Mapping). The list may contain both empty volumes and volumes created from a master snapshot. These volumes may exceed the source snapshot in size.

The table below lists all possible device options.

Device

Device name

Boot device

disk1

Additional volume

disk[2-9]

Creating/deleting an image#

You can create a new image in several ways:

Creating your image#

When creating your image, pay attention to the following:

  • OS must support ACPI to ensure correct instance shutdown;

  • OS must be able to obtain IP address via DHCP, otherwise the system will be inaccessible from an external network (even if an external IP address is allocated explicitly);

  • OS must have VirtIO drivers installed; otherwise attachment/detachment of additional volumes will be impossible;

  • Make sure that all services required for remote access to the system are launched when OS starts.

  1. Go to Virtual machines Storage Images.

  2. Click Create.

  3. В открывшемся окне на шаге Параметры задайте необходимые параметры:

    • image name;

    • description;

    • опцию поддержки устаревших ОС (её необходимо включить, если у экземпляра нет драйверов VirtIO).

    We recommend providing short descriptions for images for convenience, e.g., to indicate OS name and version.

  4. Нажмите Выбрать снимок диска для перехода на следующий шаг.

  5. В открывшемся окне выберите снимок и задайте конфигурацию диска.

    Parameter

    Description

    Snapshot

    The snapshot from which you plan to create an instance.

    Size

    Volume size in gibibytes (1 gibibyte = 1,024 mebibytes).

    Volume type

    Sets the desired volume type. For more information on volume features and parameters see page Volumes.

    IOPS

    The maximum total number of I/O operations per second. For volumes types gp2, st2 and st3 the number of IOPS is calculated automatically, for the volume type io2 you can specify the required number of IOPS.

    Throughput

    Maximum total speed, in MiB/s, at which data can be read from or written to a volume. It is calculated automatically for all existing volume types.

    Delete with the instance

    It specifies whether the volume must be automatically deleted after the instance is deleted.

    Для выбора дополнительных дисков нажмите Добавить диск.

    The volume marked with the icon will be bootable for the instance, while the rest volumes will be additional volumes. The bootable volume cannot be empty and, unlike additional volumes, cannot be detached from an instance.

  6. После добавления всех необходимых дисков нажмите Создать образ.

Creating an image from an instance#

Вы можете создать образ как из выключенного, так и работающего экземпляра.

Important

Crash consistency across all volumes is ensured when creating an image from a running instance. It means that snapshots of all volumes are taken simultaneously, and all data written to the volume is saved (data from RAM is not included in the snapshot). To ensure that all data is included in the snapshot, we recommend you flush the cache and suspend writing to volumes before running the image create command.

  1. Go to the Virtual machines section Compute Instances.

  2. Выберите экземпляр в таблице ресурсов и нажмите Создать образ.

  3. В открывшемся окне укажите имя и описание образа.

  4. Если необходимо назначить дополнительные теги, перейдите на следующий шаг, нажав Добавить теги. Укажите ключ тега и его значение.

  5. After setting all the required parameters, click Create.

When an image is created from an instance, snapshots of all volumes attached to the instance will be created as well.

Создать образ из объектов в бакете#

Вы можете создать образ из собственных снимков диска, загруженных в бакет. Для этого загрузите снимки в объектное хранилище и создайте из них образ.

Deleting an image#

  1. Go to Virtual machines Storage Images.

  2. Выберите образ в таблице ресурсов и нажмите Удалить. В открывшемся окне будет предложено удалить все снимки дисков, которые связаны с этим образом.

  3. Confirm deletion.

Create an instance from an image#

If necessary, you can start the instance from the created image straight away. You can do it both using instance wizard and directly from the image. Do the following:

  1. Go to Virtual machines Storage Images.

  2. Select an image in the resource table and click on Create instance. Alternatively you can right-click the line with the desired image and select Create instance.

    Note

    If the image contains a backup copy of the instance, we recommend creating the instance directly from the backup. In this case, you will not need to redefine the instance parameters.

  3. Follow the steps from 2 to 7 as described in instance wizard.

Set access#

Image is private by default. You can launch instances from an image only within the project in which it was created. You can grant access to an image for projects of your choice. To that end:

  1. Go to Virtual machines Storage Images and select the desired image in the table.

  2. Click Set access.

  3. In the dialog window, add project(s) that are to be granted access.

  4. Click Apply.

You can change access settings later, if necessary. To do this:

  1. Go to Virtual machines Storage Images, select the desired image in the resource table and click on the image ID to go to its page.

  2. In the Information tab, click the editing icon for the Common access parameter.

  3. In the dialog window, add or remove projects.

  4. Click Apply.

Note

You can use both procedures for initial access setting, as well for access editing.

Attention

When granting access to other projects, pay special note to licensed software. License cloning is not allowed in some cases. Be careful and do not grant access to images containing sensitive data.

Note

Before 02.08.2022, public access to the image could be granted to all authorized K2 Cloud users. If you have public images, you can make them private by clearing the respective checkbox when setting the access to the image. This operation is irreversible: you cannot make the image public again.

Assigning tags#

Once the image is created, you can assign tags to it.

Note

Information about assigned tags is not passed to other projects that are granted access to the image.

To add, modify or delete image tags:

  1. Go to Virtual machines Storage Images.

  2. In the resource table, select the image for which tags should be modified and click on the image ID to go to its page.

  3. Open the Tags tab.

  4. To add a tag, click Add tag and specify the Key and Value fields.

    To modify a tag, edit the required fields (Value and/or Key) of the respective tag.

    To delete a tag, click the icon next to the tag you no longer need.

    Note

    If no tags have been set earlier, you can add the Name tag by clicking Add Name tag and specifying its value.

  5. Click Apply to save the changes.

Information about an image#

General information about existing images can be viewed in the resource table in Virtual machines Storage Images.

To open the page of a particular image, click its ID in the resource table in the Images subsection.

The Information tab displays the main image characteristics and parameters:

  • image name;

  • description;

  • state;

  • project in which the image was created;

  • legacy OS support;

  • project(s), which can access the image;

  • boot menu state (on/off);

  • boot device;

  • number of volumes, included in the image.

Here you can modify the image description, modify access settings, create an instance and delete the image.

The Volumes tab displays a table with details of volumes included in the image:

  • volume name;

  • volume snapshot;

  • snapshot size;

  • volume type;

  • device type: boot or additional volume.

The Tags tab displays all tags assigned to the image. You can add new, modify existing, and delete no-longer-needed tags.