Skip to content

Block storage

Block storage gives your instances persistent disks, managed by Cinder and backed by Ceph. A volume lives independently of any instance: you can detach it from one instance and attach it to another, and it survives the instance being deleted.

Storage types

Every volume has a type that decides which disks it is stored on and how it is protected. If you do not choose one, you get balanced.

Type Disks Protection Use for
fast NVMe 3 copies Latency-sensitive data such as databases
balanced (default) NVMe Erasure coded, 6+2 General-purpose storage and system disks
bulk HDD Erasure coded, 6+2 Large data that is read and written in bulk

Erasure coding 6+2 splits the data into 6 parts and adds 2 parity parts, stored on different servers. A volume survives the loss of any two servers and needs about 1.3 times its size in raw storage, compared to 3 times for 3 copies. Small random writes are slightly slower than with fast. See Durability, quotas and billing for details.

List the types available to you with:

openstack volume type list

See the reference for pricing per type.

Volumes of the older type rbd1

Volumes created earlier with the type rbd1 (3 copies on NVMe) keep working. Sunet will move them to balanced, with advance notice to the project owners. New volumes should use one of the types above.

Create and attach a volume

openstack volume create --size 50 data-disk
openstack server add volume my-instance data-disk

Without --type the volume is balanced. Choose another type with --type, for example --type bulk for a large archive disk or --type fast for a database.

Inside the guest the volume appears as a new block device (for example /dev/vdb). Partition, format, and mount it as you would any disk:

sudo mkfs.ext4 /dev/vdb
sudo mkdir /data
sudo mount /dev/vdb /data

Add an /etc/fstab entry so it mounts on boot.

Boot from a volume

Booting from a volume makes the root disk persistent, which is required for b2.* flavors that have no local disk and useful whenever you want the instance's system disk to survive being rebuilt. See Launching instances.

Snapshots

A snapshot is a point-in-time copy of a volume, handy before a risky change:

openstack volume snapshot create --volume data-disk before-upgrade

You can create a new volume from a snapshot later. Snapshots live in the same Ceph cluster as the volume, so they are not a substitute for an off-platform backup. Block storage is not backed up by Sunet by default; see Durability, quotas and billing.

Resize a volume

Detach the volume, extend it, then re-attach and grow the filesystem inside the guest:

openstack server remove volume my-instance data-disk
openstack volume set --size 100 data-disk
openstack server add volume my-instance data-disk
# inside the guest, for an ext4 filesystem
sudo resize2fs /dev/vdb