How To

How To resize or extend Cinder Volume in OpenStack

In our last guide, we discussed on how to create Cinder Volumes in OpenStack and attach them to running instance. This tutorial will cover how you can extend /grow the size of a Cinder volume.

Original content from computingforgeeks.com - post 37963
extend cinder volume openstack

Resize / Extend Cinder Volume in OpenStack from CLI

If you have configured OpenStack CLI, you can use it to to resize a Cinder volume. To make our guide complete, we’ll create a new volume.

$ openstack volume create --size 10 test-volume
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attachments         | []                                   |
| availability_zone   | nova                                 |
| bootable            | false                                |
| consistencygroup_id | None                                 |
| created_at          | 2019-11-03T20:29:56.000000           |
| description         | None                                 |
| encrypted           | False                                |
| id                  | afec0c14-c5bb-42da-8f87-5a940ff18885 |
| migration_status    | None                                 |
| multiattach         | False                                |
| name                | test-volume                          |
| properties          |                                      |
| replication_status  | None                                 |
| size                | 10                                   |
| snapshot_id         | None                                 |
| source_volid        | None                                 |
| status              | creating                             |
| type                | None                                 |
| updated_at          | None                                 |
| user_id             | 336acbb7421f47f8be4891eabf0c9cc8     |
+---------------------+--------------------------------------+

Let’s attach it to an instance:

openstack server add volume fedoravm test-volume

Where:

  • fedoravm is the name of the instance we’re attaching created volume
  • test-volume is the name of the volume

Confirm volume is attached to our VM.

[fedora@fedoravm ~]$ lsblk 
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    252:0    0  20G  0 disk 
└─vda1 252:1    0  20G  0 part /
vdb    252:32   0  10G  0 disk 

Then resize it and confirm the change inside a VM.

# Syntax
$ openstack volume set --size <size> <volume>

Where:

  • <size> is the volume size to extend in GB
  • <volume> is the volume to modify (name or ID)

But first unmount any partitions inside the instance if configured, then detach the volume.

# Inside VM unmount if mounted
# Then detach 

$ openstack server remove volume fedoravm test-volume

I’ll extend the disk to 30 GB

openstack volume set --size 30 test-volume

Re-attach it to the VM.

openstack server add volume fedoravm test-volume

Confirm new size:

$ lsblk 
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    252:0    0  20G  0 disk 
└─vda1 252:1    0  20G  0 part /
vdb    252:32   0  30G  0 disk 

If the volume was mounted refer to guides below on how to resize:

More on OpenStack:

Related Articles

Storage Configure and Mount Hetzner Storage box on Linux using Ansible Storage Install Bareos Backup on Ubuntu 24.04 / 22.04 Openstack Install Magnum Container Service on OpenStack Security How Can I Recover Photos from My Computer?

Leave a Comment

Press ESC to close