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 provides several volume types, which differ in performance characteristics, features and price: st2: Standard (HDD), st3: Standard (HDD), gp2: Universal (SSD), io2: Ultimate (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 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.

Main volume types#

Standard (HDD)

Universal (SSD)

Ultimate (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

  • Storing a big amount of data

  • Workloads involving sequential I/O

  • The boot devices

  • The critical business applications

  • Development and test environments

  • Tasks that require high performance (IOPS, MiB/s) and low latency

  • Critical business applications that require the highest IOPS performance

  • I/O intensive databases

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

Max throughput per volume, MiB/s

500

320

500

Legacy volume type#

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

  • 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: 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)``,
    

    but no more than 50 000 IOPS.

    It means that the max performance (50 000 IOPS) can be set for the io2 volume with size ≥ 1000 GiB. There is no need to stop an instance or increase the volume size to increase the IOPS performance of an attached io2 volume.

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

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

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),
    

    but not more than 500 MiB/s. It means that the maximum throughput of an st2 volume is between 8 MiB/s (for 32 GiB volume) and 500 MiB/s (for 2000 GiB to 4 TiB volumes). Max throughput is recalculated and applied with further increase of volume size.

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

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

You can also increase the IOPS performance for gp2: Universal (SSD) volume by increasing its size. Such volume 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.

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.