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#

Note

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.

Click Create in the Images subsection.

On the first step of creating a new cluster, set the required parameters:

  • Image name;

  • Description;

  • Enable support for legacy OS (if the instance does not have VirtIO drivers).

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

At the second step, set the volume configuration and click Create image.

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 st2 and gp2 volumes the number of IOPS is calculated automatically, for io2 volumes 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 st2, gp2 and io2.

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.

Creating an image from an instance#

You can create an image from both a stopped or running instance. Go to Virtual machines Compute Instances, select an instance and create an image from it.

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

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 disk 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.

Creating an image from an object in a bucket#

You can create an image from your volume snapshot stored in the bucket. To do this, download the snapshot into object storage and create an image from it.

Deleting an image#

Select the image you no longer need and click Delete. In the dialog window, you will be prompted to delete all volume snapshots associated with this image.

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 the Virtual machines section 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.