Images
In this article:
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.
Go to Virtual machines Storage Images.
Click Create.
In the window that opens, set the required parameters on the Parameters step:
image name;
description;
legacy OS support option (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.
Click Select snapshot to proceed to the next step.
In the window that opens, select the snapshot and set the volume configuration.
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.
To select additional volumes, click Add volume.
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.
Once you have added all the required volume, click Create image.
Creating an image from an instance#
You can create an image from both a stopped and a running 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.
Go to the Virtual machines section Compute Instances.
In the resource table, select the instance and click Create image.
In the window that opens, enter the image name and description.
If you need to set additional tags, go to the next step by clicking Add tags. Specify the tag key and value.
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.
Creating an image from objects in a bucket#
You can create an image from your volume snapshot stored in the bucket. To do this, upload the snapshots into object storage and create an image from them.
Deleting an image#
Go to Virtual machines Storage Images.
Select the image in the resource table and click Delete. In the window that opens, you will be prompted to delete all volume snapshots associated with this image.
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:
Go to Virtual machines Storage Images.
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.
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:
Go to Virtual machines Storage Images and select the desired image in the table.
Click Set access.
In the window that opens, add project(s) that are to be granted access.
Click Apply.
You can change access settings later, if necessary. To do this:
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.
In the Information tab, click the editing icon for the Common access parameter.
In the window that opens, add or remove projects.
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.
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.