Volumes#

General information#

Volume is the main storage for instance data in K2 Cloud.

All volumes are attached via VirtIO protocol and thus, require specialized support from the OS. All OS images officially supported by K2 Cloud contain all the required drivers.

Virtual volume can be created either independently of an instance, or during it’s creation. When creating an instance, volumes attached to it are also created. Wherein, the first volume in the list will be the boot device and others will be additional ones. Unlike additional devices, boot volume cannot be detached from an instance. After detaching, additional volume becomes available for further attaching to an instance. All volume data is saved when detaching a volume from an instance. You can attach a volume to a running instance. You can attach up to 16 volumes to an instance, but each volume can be attached to only one instance at a time.

When creating an instance, you can select the Delete with the instance option to specify whether the volume must be deleted when the instance is deleted. If this option is not selected for the volume, or the volume was attached to the instance after the instance creation, the volume will be detached from the instance when it is deleted and can be attached to another instance.

Each new volume is either an empty volume or a copy of the master snapshot. Master snapshots contain an installed and configured OS and are mainly used for boot volumes. Volume created from the master snapshot may exceed the master volume in size. In this case, additional space appears on such volume. Later on, you can use this space to create an additional partition or expand the file system so that it occupies the entire volume.

В K2 Cloud представлены несколько типов дисков, отличающихся характеристиками, возможностями и стоимостью: st2: Стандартный (HDD), st3: Стандартный (HDD), gp2: Универсальный (SSD), io2: Максимальный (SSD).

You can increase the volume size after its creation. It is possible to increase the size of the volume, attached to a running instance without the need of stopping it. For some volume types, increasing the size leads to the growth of volume characteristics. You can’t decrease the volume size. For more information about features and characteristics of volumes see the Volume types section.

Each volume has a set of parameters:

  • ID — unique volume ID.

  • A Name tag is a tag with the Name key and a value set by a user. To learn more about this parameter, please see Tags section.

  • State — information on volume status.

  • Availability Zone — the data center in which physical hardware is located.

  • Type – volume type.

  • Size — maximum amount of data that a volume can hold.

  • Creation date.

Volume types#

K2 Cloud предоставляет пользователям несколько типов дисков, отличающихся характеристиками, возможностями и стоимостью. В таблицах представлены примеры использования и основные характеристики типов дисков. По умолчанию при создании экземпляра и диска выбирается тип st2.

Important

В регионе ru-spb доступны типы дисков gp2 и st3.

Основные типы дисков#

Standard (HDD)

Universal (SSD)

Ultimate (SSD)

API name

st3

gp2

io2

Description

Недорогой HDD-диск для хранения больших объёмов данных. Возможность кратковременного превышения лимита пропускной способности у дисков небольших размеров

Универсальный SSD-диск с высокой производительностью для широкого спектра задач

SSD-диск с самой высокой производительностью для самых требовательных к IOPS приложений

Use cases

  • Storing a big amount of data

  • Workloads involving sequential I/O

  • The boot devices

  • The critical business applications

  • Development and test environments

  • Задачи, где необходима высокая производительность (IOPS, МиБ/с) и низкие задержки

  • Critical business applications that require the highest IOPS performance

  • Базы данных со множеством операций ввода/вывода

The size of the volume

20 ГиБ — 4 ТиБ

8 GiB — 4 TiB

8 GiB — 4 TiB

Max performance per volume, IOPS

1 000

10 000

50 000

Max throughput per volume, MiB/s

500

320

500

Устаревший тип дисков#

Standard (HDD)

API name

st2

Description

Недорогой HDD-диск для задач, связанных с хранением больших объёмов данных. Диски большого объёма имеют высокую пропускную способность

Use cases

  • Storing a big amount of data

  • Workloads involving sequential I/O

The size of the volume

32 GiB — 4 TiB

Max performance per volume, IOPS

1 000

Max throughput per volume, MiB/s

500

st3: Стандартный (HDD)#

API name: st3

Диск типа st3 — недорогой диск на основе магнитных накопителей (HDD) для задач, связанных с хранением больших объёмов данных. Особенность диска st3 — рост базовой пропускной способности с увеличением размера диска и возможность её временного превышения для дисков небольшой ёмкости (до 128 ГиБ).

Characteristics#

  • Based on hard disk drives (HDD).

  • Размер диска — от 20 ГиБ до 4 ТиБ с шагом 1 ГиБ.

  • IOPS performance:

    • 500 IOPS for volumes with < 2000 GiB size.

    • 1000 IOPS for volumes with ≥ 2000 GiB size.

  • Базовая пропускная способность диска зависит от его размера 1:

    • 8 МиБ/с для дисков от 20 до 32 ГиБ;

    • для дисков от 32 до 2000 ГиБ рассчитывается по формуле:

      Размер диска (ГиБ) * 0,25 (МиБ/с на 1 ГиБ);
      
    • 500 МиБ/с для дисков размером от 2 до 4 ТиБ.

    1

    Пропускная способность дисков меньше 128 ГиБ может быть выше базовой благодаря возможности кратковременно превышать лимит.

При увеличении размера диска базовая пропускная способность пересчитывается.

Кратковременное превышение лимита#

Базовая пропускная способность диска st3 размером до 128 ГиБ может быть превышена и достигать 32 МиБ/с на протяжении 10 мин. Таким образом, небольшие диски с малой пропускной способностью способны какое-то время работать как диски большего размера и благодаря этому лучше справляться с кратковременными всплесками нагрузки, например во время загрузки операционной системы или при старте приложения.

Частое превышение базового лимита может сигнализировать о том, что вам нужен диск большего размера с большим базовым лимитом. Превышение лимита не тарифицируется.

Для временного повышения пропускной способности сверх базовых значений диски st3 используют модель пула кредитов. Кредиты накапливаются, когда диск простаивает или использует не всю базовую пропускную способность. При всплесках нагрузки накопленные кредиты тратятся на увеличение пропускной способности.

Пропускная способность может быть увеличена максимум до 32 МиБ/с. При работе на такой скорости весь пул кредитов будет исчерпан за 600 с. Однако если диск не использует все доступные 32 МиБ/с, то кредиты будут тратиться дольше 600 сек. Когда пул кредитов исчерпан, то максимально возможная пропускная способность равна базовой. Если диск работает с базовой пропускной способностью, то кредиты не копятся.

Максимальный размер пула кредитов зависит от базовой пропускной способности диска и рассчитывается по формуле:

(32 МиБ/с - базовая пропускная способность) * 600 с.

При превышении базовой пропускной способности пул кредитов каждую секунду уменьшается на разницу между реальным и базовым значением. И наоборот, если пропускная способность меньше базовой, а размер пула меньше максимального, то он увеличивается на разницу между базовым и реальным значением (см. пример расчёта ниже).

Чем меньше диск и чем, соответственно, ниже его базовая пропускная способность, тем больше может быть повышена его пропускная способность, и наоборот. Например, для диска размером 100 ГиБ базовая пропускная способность равна:

100 ГиБ * 0,25 (МиБ/с) / 1 ГиБ = 25 МиБ/c.

Таким образом, возможное повышение пропускной способности составит всего:

32 МиБ/с - 25 МиБ/с = 7 МиБ/с

При размере диска 128 ГиБ базовая пропускная способность становится равной 32 МиБ/с, поэтому для дисков такого и большего размера повышение их скорости выше базовой невозможно.

Пример расчёта пула кредитов#

Для диска объёмом 20 ГиБ базовая пропускная способность равна 8 МиБ/с. Соответственно, максимальный пул кредитов составляет:

(32 МиБ/c - 8 МиБ/с) * 600 с = 14400 МиБ.

Размер пула пересчитывается каждую секунду. Если пропускная способность повысилась, скажем, до 20 МиБ/с, то размер пула уменьшится на

(20 МиБ/с - 8 МиБ/с) * 1 с = 12 МиБ.

и составит, таким образом, 14388 МиБ.

Если в следующую секунду она упала, например, до 4 МиБ/с, то размер пула увеличится на

(8 МиБ/с - 4 МиБ/с) * 1 с = 4 МиБ.

и составит 14392 МиБ.

gp2: Universal (SSD)#

API name: gp2

Диск типа gp2 — универсальный диск на основе твердотельных накопителей (SSD), обладающий высокой производительностью и подходящий для широкого спектра задач. Особенность диска gp2 — рост его производительности в IOPS с увеличением размера.

  • Based on solid-state drives (SSD).

  • The volume size varies from 8 GiB to 4 TiB. The volume size is a multiple of 8 GiB.

  • IOPS performance is calculated using the following formula:

    Макс (IOPS) = Размер (ГиБ) * 10 (IOPS на 1 ГиБ),
    

    но не более 10 000 IOPS.

    То есть производительность в IOPS диска gp2 может варьироваться от 80 IOPS (для диска размером 8 ГиБ) до 10 000 IOPS (для дисков размером от 1000 ГиБ до 4 ТиБ). Производительность диска в IOPS пересчитывается и применяется при увеличении размера диска.

  • Max throughput per volume:

    • 160 MiB/s for a volume size < 120 GiB.

    • 320 MiB/s for volumes with ≥ 120 GiB size.

io2: Ultimate (SSD)#

API name: io2

Диск типа io2 — диск SSD с самой высокой производительностью, предназначенный для самых требовательных к IOPS приложений. Особенность диска io2 — возможность выбрать производительность диска в IOPS при создании и в последствии менять её в онлайн режиме, без остановки экземпляра.

  • Based on high-performance solid-state drives (SSD).

  • The volume size varies from 8 GiB to 4 TiB. The volume size is a multiple of 8 GiB.

  • Производительность в IOPS — задаётся пользователем в диапазоне от 100 до:

    Размер (ГиБ) * 50 (IOPS на 1 ГиБ),
    

    но не более 50 000 IOPS.

    То есть максимальное значение в 50 000 IOPS можно задать для диска io2 размером ≥ 1000 ГиБ. Есть возможность изменения производительности в IOPS диска io2 в онлайн режиме, без остановки экземпляра и без изменения размера диска.

  • Max throughput per volume, MiB/s — 500.

  • How to create a volume, please see terraform-examples

st2: Standard (HDD)#

API name: st2

Диск типа st2 — недорогой диск на основе магнитных накопителей (HDD) для задач, связанных с хранением больших объёмов данных. Особенность диска st2 — рост его максимальной пропускной способности с увеличением размера.

  • Based on hard disk drives (HDD).

  • Volume size — from 32 GiB to 4 TiB. The volume size must be multiple of 8 GiB.

  • IOPS performance:

    • 500 IOPS for volumes with < 2000 GiB size.

    • 1000 IOPS for volumes with ≥ 2000 GiB size.

  • Максимальная пропускная способность диска в МиБ/с рассчитывается по формуле:

    Макс. пропускная способность (МиБ/с) = Размер (ГиБ) * 0,25 (МиБ/с на 1 ГиБ),
    

    но не более 500 МиБ/с. То есть максимальная пропускная способность диска st2 может варьироваться от 8 МиБ/с (для диска размером 32 ГиБ) до 500 МиБ/с (для дисков размером от 2000 ГиБ до 4 ТиБ). Максимальная пропускная способность пересчитывается и применяется при увеличении размера диска.

Creating / deleting a volume#

You can use different methods to create a new volume:

  1. Create a new empty volume

  2. Create a volume from a snapshot

Create a new empty volume#

Click Create in Volumes subsection. Set the required parameters: volume size, availability zone, volume type, IOPS (if possible for this volume type), tags, and click Create Volume.

Create a volume from a snapshot#

To create a volume from a snapshot, select Create volume from snapshot in the volume creation menu. You can use both K2 Cloud snapshots and user-created or backup-related snapshots.

Note

To display backup-related snapshots, enable Show recovery points.

Set the required parameters of new volume and click Create volume.

A unique ID in vol-XXXXXXXX format is assigned to the volume when it is created. We recommend using tags for more convenient operations with volumes.

Deleting a volume#

Important

Only volumes with available status (which aren’t attached to any instance) can be deleted.

Click Delete to delete the volume.

Operations with volumes#

Attaching/detaching a volume#

Important

A volume can be attached to an instance if they are in the same availability zone.

Only volumes with Available status (which aren’t attached to any instance) can be attached to an instance.

Attention

Please note that you can attach max. 4 volumes to instances with the hvm-legacy virtualization type.

Click Attach to attach the volume to the instance.

Important

You can detach only non-boot volumes from the instance.

Click Detach to detach the volume from instance and the volume will be available for the next attachment.

Creating a snapshot#

To create a snapshot, from which you can later create an image or which you can use for data backup, click Create snapshot.

Volume version management#

A volume version is a snapshot of volume content at the time the version is created.

The main difference between a volume version and volume snapshot is that the volume version is not copied to another storage, but remains with the volume in the same storage. Once successfully created, the version is immediately available for use. There is no need to wait until the volume content is copied to another storage, as in case of a volume snapshot.

A volume that has versions can be restored to any of them. Restoring to a version means that the volume content will return to its state at the time when the version was created. The volume is restored to the selected version instantly and can be used right after successful restore.

Volume versions are useful to retain volume content before system, application, or other critical updates. If an update fails, you can very quickly roll back, without having to wait first when the volume snapshot will be created and second when a new volume will be created from the snapshot.

Volume versions can also be part of a backup policy. For example, you can create a new version once an hour and a volume snapshot once a day, so that the volume copy is saved to a separate storage other than the storage where the volumes and their versions reside.

You only pay for the disk space occupied by versions. For example, if the volume content is almost unchanged after the version was created, then the version won’t occupy much space. However, if changes are significant, then one version may occupy as much space as the entire volume.

Note

For billing purposes, the total space occupied by all versions of one volume is rounded up to the nearest 1 GiB.

Note

You cannot create another volume directly from a version. If you need a new volume with the same data as in the volume version, create a volume snapshot first and then create the new volume from that snapshot.

Create a volume version#

To create a volume version, go to the Volumes subsection, select the desired volume and click Create Version, or go to the volume page and click Create Version in the Information tab. In the dialog window, you can set the Name tag value. To specify additional tags, click Add tags. Or you can do it later in the Versions tab.

In addition, you can create a version in the Versions tab on the volume page using the Create version button.

Note

If a volume is attached to a running instance, then to ensure data consistency between the volume and its version, you are recommended to flush the cache first and suspend writing to the volume. Consistency conditions for a version are the same as for a volume snapshot.

The version is created instantly, but the next version can be created only after a timeout of 1 minute. Up to five versions per volume may be created. To create a new version when the maximum number of versions is reached, you must delete at least one existing version. To keep the content of the version you want to delete, create a volume snapshot from it.

Restore volume from the version#

A volume can be restored to a certain version without being detached from the instance. A volume is restored in a fraction of a second, because you do not have to wait when the volume will be created from the snapshot.

Note

If the volume is attached to an instance, then you should first stop this instance. Restoring a volume to a certain version is only possible when the volume is not attached to an instance or when such an instance is stopped.

To restore a volume from an existing version, go to the Versions tab on the volume page, select the desired version, and click Restore to a version. Restoring a volume from a version is subject to the same one-minute timeout for repeating the action as when creating a version.

Attention

If the volume has increased in size after a version was created, then restoring the volume to that version starts with restoring the content and then expanding the restored volume to the size it had at the time of restoring.

For example, when a version was created, the volume was 32 GiB and then its size was increased to 64 GiB. Upon restoring to that version, the volume will still be 64 GiB, where the first 32 GiB are occupied by the content of the version being restored and the next 32 GiB are an unallocated area added by the automatic volume expansion mechanism.

Creating a snapshot from a version#

You can create volume snapshots from versions. This feature can be useful when you need to create new versions, but you have already reached the maximum number of versions and want to keep their content. Another use case is when you need to create new volumes with the same content as that of the version. Keep in mind that additional volumes can be created in any availability zone, not just the one where the volume and its versions are located if there are multipe availability zones in the region.

To create a volume snapshot from a version, go to the volume page, select the desired version in the Versions tab, and click Create snapshot from version. In the dialog window, you can set the Name tag value and provide a snapshot description. To specify additional tags, click Add tags.

Note

Please note that the volume snapshot created from a version will have the same creation time as the version itself.

Delete versions#

To delete unnecessary versions, check them in the list in the Versions tab on the volume page and click Delete.

Note

With more changes on the volume, the versions occupy more space and a storage fee increases respectively, so we recommend deleting unnecessary versions from time to time.

Deleting a volume deletes all its existing versions as well. To keep the content of the version you want to delete, create a volume snapshot from it.

Changing a volume parameters#

Increasing the volume size#

Go to the volume page and modify the Volume size field to increase the volume size. There is no need to stop the instance.

Note

При увеличении объёма диска с типом st2: Стандартный (HDD) каждый 1 ГиБ ёмкости увеличивает максимальную пропускную способность диска на 0,25 МиБ/с. На объёме 2000 ГиБ пропускная способность достигает максимума для типа st2 (500 МиБ/с) и более не растёт, а производительность диска увеличивается с 500 до 1000 IOPS.

Note

При увеличении объёма диска с типом gp2: Универсальный (SSD) каждый 1 ГиБ ёмкости увеличивает производительность диска на 10 IOPS. На объёме 1000 ГиБ производительность достигает максимума для типа gp2 (10 000 IOPS) и более не растёт.

Note

Увеличение объёма диска с типом io2: Максимальный (SSD) даёт возможность увеличить производительность диска на 50 IOPS за каждый 1 ГиБ ёмкости. На объёме 1000 ГиБ максимально допустимая производительность диска в IOPS достигает предела для типа io2 (50 000 IOPS) и более не растёт.

В отличие от диска с типом gp2 текущее значение производительности в IOPS диска io2 не привязано к размеру. Поэтому при желании увеличить значение IOPS с увеличением размера диска, нужно сделать это самостоятельно, отредактировав поле IOPS на странице диска.

You can find more information about the characteristics of volumes in the Volume types.

Changing the volume IOPS performance#

You can change the IOPS performance without changing the volume size for io2: Ultimate (SSD) type volume by modifying the IOPS field on the volume page.

Диапазон допустимых значений IOPS для io2 диска:

from 100 to Size (GiB) * 50 (IOPS per GiB), but no more than 50 000 IOPS.

Note

Увеличить производительность в IOPS можно также у дисков типа gp2: Универсальный (SSD), увеличивая их размер. Каждый 1 ГиБ ёмкости увеличивает производительность диска на 10 IOPS. На объёме 1000 ГиБ производительность достигает максимума для типа gp2 (10 000 IOPS) и более не растёт.

Specifying tags#

To add, modify or delete volume tags:

  1. Go to Virtual machines Storage Volumes.

  2. In the resource table, select the volume for which the tags should be modified and click on the volume 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.

    Note

    You can also modify the Name tag in the Information tab by editing the corresponding field.

  5. Click Apply to save the changes.

Volume information#

General information about volumes can be viewed in the resource table in Virtual machines Storage Volumes. To go to the specific volume page, click the link with its ID in the volume’s table in the Volumes subsection.

The Information tab displays the main volume parameters:

  • state;

  • volume name (Name tag);

  • creation date;

  • VPC in which the volume is located;

  • size;

  • type;

  • IOPS performance;

  • instance which the volume is attached to.

Here you can:

The Versions tab displays a table with details of existing volume versions:

  • version ID;

  • version name;

  • version creation date.

The sequence and scope of the displayed data may vary depending on the table settings.

Here you can:

To edit, add or delete tags, select the volume version and click Set tags.

The Metrics tab displays the volume read / write rate statistics. You can display statistics for current or selected time period.

On the Alarms tab you can see alarms, set for this volume. You can modify or delete alarms, set for this volume.

The Tags tab shows what tags have been assigned to a volume (each resource may have up to 50 tags). Here you can add tags, edit keys and values, and delete tags.