How to adjust/expand the size of Cinder in OpenStack

The
You can support us by downloading this article in PDF format via the link below.

Download the guide in PDF format

turn off
The

The
The

In the previous guide, we discussed how to create a Cinder volume in OpenStack and attach it to a running instance. This tutorial will introduce how to expand/increase the size of the Cinder volume.

Resize/expand Cinder volume in OpenStack from CLI

If you have configured the OpenStack CLI, you can use it to adjust the size of the Cinder volume. To complete the guide, we will 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 the instance:

 $ openstack server add volume fed31 test-volume

where:

  • Hello 31 Is the name of the instance of the volume we want to attach
  • Test volume Is the name of the volume

Confirm that the volume is attached to our VM.

[[email protected] ~]$ 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 adjust its size and confirm the changes in the VM.

# Syntax
$ openstack volume set --size  

where:

  • Is the size of the volume to be expanded (in GB)
  • Is the volume (name or ID) to be modified

But first, unmount all partitions in the instance (if configured), and then detach the volume.

# Inside VM unmount if mounted
# Then detach 

$ openstack server remove volume fed31 test-volume

I expand the disk to 20 National standard

 openstack volume set --size 20 test-volume

Reconnect it to the VM.

 $ openstack server add volume fed31 test-volume

Confirm the 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  20G  0 disk 

More information about OpenStack:

How to rename an instance/server in OpenStack

How to adjust the size of OpenStack instance/virtual machine

How to set or update VM hostname in AWS/OpenStack/DigitalOcean

How to create a CentOS 8 KVM image template on OpenStack

How to create OpenStack instance with fixed/static IP address

The
You can support us by downloading this article in PDF format via the link below.

Download the guide in PDF format

turn off
The

The
The

Sidebar