Volumes
In this article:
Volumes#
General information#
Диск в K2 Cloud является основным хранилищем данных экземпляра. K2 Cloud поддерживает как виртуальные, так и выделенные физические диски. Виртуальные диски автоматически реплицируются, для выделенных дисков репликация не поддерживается.
В K2 Cloud представлены несколько типов дисков, отличающихся характеристиками, возможностями и стоимостью: st3: Стандартный (HDD), st2: Стандартный (HDD), gp2: Универсальный (SSD), io2: Максимальный (SSD), nv1: Нереплицируемый (NVMe SSD).
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.
Диск можно создать либо отдельно от экземпляра, либо вместе с экземпляром. При создании экземпляра создаваемые диски присоединяются к нему, при этом первый диск из списка будет являться загрузочным для экземпляра, а остальные дополнительными.
Загрузочный диск, в отличие от дополнительных, нельзя отсоединять от экземпляра. Дополнительные диски после отсоединения могут быть подключены к экземплярам, находящимся в той же зоне доступности. При отключении диска от экземпляра данные сохраняются.
Подключать диски можно без остановки экземпляра.
Вы можете присоединить до 16 дисков к экземпляру, но не более трёх дисков nv1
.
Каждый диск в один момент времени может быть присоединён только к одному экземпляру.
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.
Каждый новый диск является пустым или представляет собой копию эталонного снимка диска. Эталонные снимки чаще всего применяются для загрузочных дисков и содержат установленную и настроенную операционную систему. Размер диска, созданного из эталонного снимка, может превышать размер эталона. В этом случае на диске появляется дополнительное пустое пространство. Впоследствии можно создать дополнительный раздел или увеличить размер файловой системы, чтобы она заняла весь диск.
Размер диска можно увеличить после его создания (кроме дисков nv1
).
Увеличить размер диска, присоединённого к экземпляру, можно без остановки экземпляра.
Для дисков некоторых типов увеличение размера приводит к росту их производительности.
Уменьшать размер диска нельзя.
Подробнее ознакомиться с особенностями и характеристиками дисков можно в подразделе Типы дисков.
Each volume has a set of parameters:
ID — unique volume ID.
Тег Name — Тег с ключом Name и значением, заданным пользователем. Подробнее ознакомиться с этим параметром можно в разделе Теги.
Состояние — Текущее состояние диска.
Зона доступности — Место расположения физического оборудования, к которому подключён диск.
Тип — Тип диска.
Размер — Максимальный объём данных, который способен вместить диск.
Creation date.
Volume types#
K2 Cloud provides several volume types, which differ in performance characteristics, features and price. The following tables show the use cases and main characteristics for each volume type. The default volume type when creating an instance or a volume is st2.
Реплицируемые диски#
В таблице представлены примеры использования и основные характеристики для типов виртуальных дисков с поддержкой репликации.
Important
In the ru-spb region, gp2
and st3
volume types are available.
Стандартный (HDD) |
Универсальный (SSD) |
Максимальный (SSD) |
|
---|---|---|---|
API name |
st3 |
gp2 |
io2 |
Description |
Low-cost HDD volume for storing large amounts of data. For small-size volumes, baseline throughput can be temporarily exceeded |
Universal high-performance SSD volume suited for a wide variety of workloads |
Highest-performance SSD volume for the most IOPS-demanding applications |
Use cases |
|
|
|
The size of the volume |
20 GiB — 4 TiB |
8 GiB — 4 TiB |
8 GiB — 4 TiB |
Max performance per volume, IOPS |
1 000 |
10 000 |
50 000 |
Максимальная пропускная способность, МиБ/с |
500 |
320 |
500 |
Standard (HDD) |
|
---|---|
API name |
st2 |
Description |
Low-cost HDD volume designed for storing a big amount of data. Big-size volumes have high max throughput characteristic |
Use cases |
|
The size of the volume |
32 GiB — 4 TiB |
Max performance per volume, IOPS |
1 000 |
Max throughput per volume, MiB/s |
500 |
Нереплицируемые диски#
В таблице представлены примеры использования и основные характеристики дисков с типом nv1
.
Диски этого типа являются выделенными, репликация для них не поддерживается.
Нереплицируемый (NVMe SSD) |
|
---|---|
API name |
nv1 |
Description |
Диск NVMe SSD без репликации |
Use cases |
|
The size of the volume |
2,9 ТиБ |
100 000 и более для Windows |
|
Максимальная пропускная способность, МиБ/с |
1000 |
st3: Standard (HDD)#
API name: st3
The st3
type volume is a low-cost HDD-based volume designed for storing a big amount of data. For this volume type, baseline throughput grows with the volume size and can be temporarily exceeded for small-size volumes (up to 128 GiB).
Characteristics#
Based on hard disk drives (HDD).
Volume size — from 20 GiB to 4 TiB at 1 GiB increment.
IOPS performance:
500 IOPS for volumes with < 2000 GiB size.
1000 IOPS for volumes with ≥ 2000 GiB size.
The baseline throughput depends on the volume size 1:
8 MiB/s for volumes from 20 to 32 GiB;
for volumes from 32 to 2,000 GiB, it is calculated by the formula:
Volume size (GiB) * 0.25 (MiB/s per 1 GiB);
500 MiB/s for volumes from 2 to 4 TiB.
- 1
For volumes smaller than 128 GiB, throughput can be higher than the baseline due to the ability to temporarily exceed the baseline.
When the volume size increases, the baseline throughput is recalculated.
Burst bucket model#
The baseline throughput of an st3
volume with a size of up to 128 GiB can be exceeded and reach 32 MiB/s for up to 10 minutes. Thus, small volumes with low throughput can operate for some time like larger volumes and thus better handle short bursts of load, such as during OS loading or application startup.
Frequent exceeding of the baseline may indicate that you need a larger volume with a higher baseline throughput. Exceeding the baseline is not billed.
For temporarily increasing the baseline throughput, st3
volumes use a burst bucket model. Credits accumulate when the volume is idle or consumes less than the full baseline throughput. During load bursts, the accumulated credits are spent to increase throughput.
Throughput can be increased up to a maximum of 32 MiB/s. At this speed, the entire credit pool will be exhausted in 600 seconds. However, if the volume does not use the full available 32 MiB/s, credits will be spent longer than 600 seconds. Once the credit pool is exhausted, the maximum possible throughput equals the baseline. If the volume operates at baseline throughput, credits do not accumulate.
The maximum credit pool size depends on the volume’s baseline throughput and is calculated by the formula:
(32 MiB/s – baseline throughput) * 600 s.
When the actual throughput exceeds the baseline one, the credit pool decreases each second by the difference between the actual and baseline values. And vice versa, if the actual throughput is lower than the baseline one and the pool size is less than the maximum, it increases by the difference between the baseline and actual values (see a calculation example below).
The smaller the volume and, accordingly, the lower its basic throughput, the more its throughput can be increased, and vice versa. For example, for a 100 GiB volume, the basic throughput is:
100 GiB * 0.25 (MiB/s) / 1 GiB = 25 MiB/s.
Thus, the possible throughput increase is only:
32 MiB/s – 25 MiB/s = 7 MiB/s.
For a 128 GiB volume, the baseline throughput becomes 32 MiB/s, so for volumes of this size or larger, increasing their speed beyond the baseline one is impossible.
Credit pool calculation example:#
For a 20 GiB volume, the baseline throughput is 8 MiB/s. Accordingly, the maximum credit pool is:
(32 MiB/s – 8 MiB/s) * 600 s = 14,400 MiB.
The pool size is recalculated every second. If the throughput increases, for example, to 20 MiB/s, the pool size will decrease by
(20 MiB/s – 8 MiB/s) * 1 s = 12 MiB,
and will be 14,388 MiB.
If the next second it drops, for example, to 4 MiB/s, the pool size will increase by
(8 MiB/s – 4 MiB/s) * 1 s = 4 MiB,
and will be 14,392 MiB.
gp2: Universal (SSD)#
API name: gp2
gp2
is a high-performance universal SSD volume. This volume type is suitable for a wide range of tasks. The hallmark of the gp2
volume type is that its performance in IOPS grows as its size increases.
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:
Max (IOPS) = Size (GiB) * 10 (IOPS per GiB),
but no more than 10,000 IOPS.
It means that IOPS performance of a
gp2
volume varies from 80 IOPS (for 8 GiB volume) to 10 000 IOPS (for 1000 GiB to 4 TiB volumes). IOPS performance is recalculated and increased if volume size increases.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
volume — a highest-performance SSD volume, designed for the most demanding for IOPS performance applications. io2
volume type feature is the possibility to set IOPS performance on volume creation and to change it later without stopping the instance.
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 performance is set by the user in the range from 100 to:
``Size (GiB) * 50 (IOPS per GiB)``,
но не более 50 000 IOPS. То есть максимальное значение в 50 000 IOPS можно задать для диска
io2
размером ≥ 1000 ГиБ.Производительности в IOPS диска
io2
можно менять без остановки экземпляра и без изменения размера диска.Max throughput per volume, MiB/s — 500.
Пример создания диска можно посмотреть в terraform-examples
nv1: Нереплицируемый (NVMe)#
API name: nv1
Диск типа nv1
— это выделенный физический диск NVMe SSD, доступ к которому осуществляется по высокоскоростному сетевому протоколу.
Он обеспечивает минимальную задержку среди всех доступных типов дисков, а реальная производительность составляет порядка 100-300 тыс. IOPS.
Note
Максимальная производительность в IOPS не ограничена и зависит от производительности экземпляра, количества виртуальных ядер, числа параллельно отправляемых запросов, типа нагрузки и других факторов. Для экземпляров с операционной системой Windows она составляет 100-150 тыс. IOPS, а для экземпляров с ОС Linux — 200-300 тыс IOPS. Разница в производительности обусловлена особенностями работы драйверов в этих ОС.
Для дисков этого типа репликация не поддерживается, поэтому их рекомендуется использовать с приложениями со встроенной репликацией, в отказоустойчивых кластерных решениях и для хранения временных данных. Во избежание одновременной потери нескольких дисков их можно включить в группу размещения дисков, чтобы они гарантированно находились на разных физических узлах.
Для нереплицируемых дисков поддерживаются только базовые операции: создание и удаление, подключение и отключение. Создание снимков и версий дисков, резервное копирование, экспорт, увеличение размера диска и изменение его типа, метрики и алармы не поддерживаются. При резервном копировании экземпляра такие диски автоматически исключаются из резервной копии.
Выделенный твердотельный диск NVMe SSD.
Фиксированные размеры диска: 2,9 ТиБ.
Максимальная пропускная способность диска — 1000 МиБ/с.
st2: Standard (HDD)#
API name: st2
st2
volume — a low-cost volume, based on magnetic drives (HDD), designed for storing a big amount of data. st2
volume type feature is max throughput scaling with increasing of volume size (0.25 MiB/s per 1 GiB).
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.
The maximum volume throughput in MiB/s is calculated by the formula:
Max. throughput (MiB/s) = Size (GiB) * 0.25 (MiB/s per 1 GiB),
но не более 500 МиБ/с. То есть максимальная пропускная способность диска
st2
может варьироваться от 8 МиБ/с (для диска размером 32 ГиБ) до 500 МиБ/с (для дисков размером от 2000 ГиБ до 4 ТиБ).Максимальная пропускная способность пересчитывается и применяется при увеличении размера диска.
Creating / deleting a volume#
Создать новый диск можно двумя основными способами:
Новому диску при создании присваивается уникальный идентификатор вида vol-XXXXXXXX
.
Для удобства работы с дисками рекомендуется использовать теги.
Create a volume#
Go to Virtual machines Storage Volumes.
Click Create.
In the window that opens, set the required parameters:
Тег Name (Опционально)
Зона доступности
Volume type
Группа размещения (Только для дисков
nv1
)Размер диска
IOPS (Если поддерживается для этого типа дисков)
Пропускная способность (Если поддерживается для этого типа дисков)
Если дополнительные теги задавать не требуется, нажмите Создать диск. В противном случае нажмите Добавить теги.
Чтобы добавить тег, нажмите Добавить тег и задайте ключ и значение тега. Если ни один тег не был задан, то вы можете добавить тег Name, нажав Добавить тег Name и задав его значение. После задания всех тегов нажмите Создать диск.
Create a volume from a snapshot#
Мастер создания диска из снимка аналогичен мастеру создания диска. Вы можете использовать как снимки дисков, предоставляемые K2 Cloud, так и созданные самостоятельно, а также полученные при создании резервных копий.
Note
To display backup-related snapshots, enable Show recovery points.
Go to Virtual machines Storage Volumes.
Выберите в меню создания диска Создать диск из снимка диска.
В открывшемся окне выберите снимок диска и задайте необходимые параметры.
Тег Name (Опционально)
Зона доступности
Volume type
Группа размещения (Только для дисков
nv1
)Размер диска
IOPS (Если это возможно для данного типа дисков)
Пропускная способность (Если это возможно для данного типа дисков)
Если дополнительные теги задавать не требуется, нажмите Создать диск. В противном случае нажмите Добавить теги.
Чтобы добавить тег, нажмите Добавить тег и задайте ключ и значение тега. Если ни один тег не был задан, то вы можете добавить тег Name, нажав Добавить тег Name и задав его значение. После задания всех тегов нажмите Создать диск.
Deleting a volume#
Important
Only volumes with available status (which aren’t attached to any instance) can be deleted.
Go to Virtual machines Storage Volumes.
Выберите диск в таблице ресурсов. Одновременно можно выбрать несколько дисков.
Click Delete.
In the window that opens, confirm the action.
Operations with volumes#
Attaching/detaching a volume#
Чтобы подключить диск к экземпляру, оба ресурса должны находиться в одной зоне доступности.
Only volumes with Available status (which aren’t attached to any instance) can be attached to an instance.
Important
К экземплярам с типом виртуализации hvm-legacy можно присоединить не более 4 дисков.
Attach a volume#
Перейдите в раздел Виртуальные машины Хранение Диски.
Выберите диск в таблице ресурсов.
Click Attach.
В открывшемся окне выберите экземпляр из раскрывающегося списка.
Нажмите Присоединить.
Detach a volume#
Important
You can detach only non-boot volumes from the instance.
Перейдите в раздел Виртуальные машины Хранение Диски.
Выберите диск в таблице ресурсов.
Click Detach.
In the window that opens, confirm the action.
Creating a snapshot#
Чтобы создать снимок диска:
Перейдите в раздел Виртуальные машины Хранение Диски.
Выберите диск в таблице ресурсов.
Click Create snapshot.
В открывшемся окне задайте тег Name и описание диска (опционально). По умолчанию задаётся тег Name, в котором указаны идентификатор диска и дата создания снимка. Если дополнительные теги задавать не требуется, нажмите Создать. В противном случае нажмите Добавить теги.
Чтобы добавить тег, нажмите Добавить тег и задайте ключ и значение тега. Если ни один тег ещё не был задан, то вы можете добавить тег Name, нажав Добавить тег Name и задав его значение. После задания всех тегов нажмите Создать.
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#
Go to Virtual machines Storage Volumes.
Select the volume in the resource table and click on Create version. Alternatively, you can go to the volume page and select Create instance in the Information tab.
In the window that opens, you can set a value for the Name tag.
If you need to assign additional tags, go to the next step by clicking Add Tags. Enter the tag key and value. Or you can do this later in the Versions tab.
After setting all the required parameters, click Create.
Alternatively, 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 the volume from an existing version:
Go to Virtual machines Storage Volumes.
Find the volume in the resource table and click the volume ID to go to its page.
In the Versions tab, select the desired version and click Revert to version.
Confirm that you want to restore the volume state to the selected 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 snapshot from a version:
Go to Virtual machines Storage Volumes.
Find the volume in the resource table and click the volume ID to go to its page.
In the Version tab, select the desired version and click Create snapshot from version.
In the window that opens, you can set a value for the Name tag and snapshot 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.
Note
Please note that the volume snapshot created from a version will have the same creation time as the version itself.
Delete versions#
Go to Virtual machines Storage Volumes.
Find the volume in the resource table and click the volume ID to go to its page.
In the Version tab, select the versions you no longer need, and click Delete.
Confirm deletion.
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#
Important
To increase the volume size, there is no need to stop the instance.
Go to Virtual machines Storage Volumes.
Find the volume in the resource table and click the volume ID to go to its page.
Edit the Volume size field in the Information tab.
Note
With increasing the size of st2: Standard (HDD) type volume, it gets additional 0.25 MiB/s of max volume throughput for each 1 GiB. At 2000 GiB of volume size the max volume throughput reaches the maximum for st2
type (500 MiB/s) and doesn’t grow further and the IOPS performance boosts from 500 to 1000.
Note
With increasing the size of gp2: Universal (SSD) type volume, it gets additional 10 IOPS in performance for each 1 GiB. At 1000 GiB of volume size the IOPS performance reaches the maximum for gp2
type (10 000 IOPS) and doesn’t grow further.
Note
Increasing the size of io2: Ultimate (SSD) type volume allows to increase volume IOPS performance by 50 IOPS for each 1 GiB. At 1000 GiB of volume size the max available IOPS performance for volume reaches the limit for io2
type (50 000 IOPS) and doesn’t grow further.
Unlike the gp2
volume the current IOPS performance value of io2
volume isn’t tied to its size. So if you need to increase volume IOPS value with its size, you should do it separately, by modifying the IOPS field on the volume page.
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.
The range of available IOPS performance values for io2
volume:
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) и более не растёт.
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:
change volme name (Name tag);
modify volume size and performance in IOPS (if possible for this volume type);
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:
customize tags for versions;
To edit, add or delete tags, select the volume version and click Customize tags.
На вкладке Метрики отображается статистика скорости дисков на чтение и запись. Вы можете настроить период, для которого строится график метрики, статистику и интервал, с которым она рассчитывается. Кроме того, вы можете вывести на график линию с максимальным возможным значением метрики. Для этого включите переключатель Показать лимит.
Для автоматического обновления графика включите опцию Автообновление, для обновления вручную нажмите Обновить.
Important
Автоматическое обновление невозможно, когда выбран произвольный период и/или интервал.
On the Alarms tab you can see alarms, set for this volume. You can modify or delete alarms, set for this volume.
Вкладка Теги содержит информацию о присвоенных диску тегах (максимальное количество тегов на ресурс — 50). Здесь вы можете добавить новые, изменить существующие и удалить ненужные теги.