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:

Keep reading

Configure Samba File Share on Debian 13 / 12 Debian Configure Samba File Share on Debian 13 / 12 Backup and Restore Linux Systems with Timeshift Debian Backup and Restore Linux Systems with Timeshift Install and Configure Samba Share on Windows 11 Networking Install and Configure Samba Share on Windows 11 Install Filestash: Self-Hosted File Manager for Any Storage Containers Install Filestash: Self-Hosted File Manager for Any Storage Filestash Cheat Sheet: Admin Console, Backends and Config Containers Filestash Cheat Sheet: Admin Console, Backends and Config Using Rook-Ceph to Create and Write to S3 Buckets Cloud Using Rook-Ceph to Create and Write to S3 Buckets

Leave a Comment

Press ESC to close