Skip to content

Extend Volumes

A volume can be extended while keeping its existing data, as long as the filesystem supports resizing (Ext4 and XFS both do). Volumes cannot be shrunk — only grown.

The process has two steps:

  1. Extend the volume (OpenStack side)
  2. Resize the filesystem (inside the VM)

Extend the Volume

Horizon

  1. Navigate to Volumes > Volumes.
  2. Find the volume and open the actions menu.
  3. Select Extend Volume.
  4. Enter the new size (must be larger than the current size).
  5. Click Extend Volume.

CLI

openstack volume set --size <NEW-SIZE-GB> <VOLUME-NAME>

Example — extend data-vol-01 from 100 GB to 150 GB:

openstack volume set --size 150 data-vol-01

Check the new size:

openstack volume show data-vol-01 -c size -c status

Resize the Filesystem

After extending the volume, you must resize the filesystem inside the VM so the OS can use the new space.

Ext4

sudo resize2fs /dev/sdb1

If the filesystem is not mounted, mount it first:

sudo mount /dev/sdb1 /mnt/data
sudo resize2fs /dev/sdb1

XFS

For XFS, the filesystem must be mounted before resizing:

sudo mount /dev/sdb1 /mnt/data
sudo xfs_growfs /mnt/data

Verify

df -h /mnt/data

Note

If the VM doesn't see the new size, you may need to stop and start the instance (not reboot — use stop then start):

openstack server stop <INSTANCE-NAME>
openstack server start <INSTANCE-NAME>

Common Errors

Volume is in-use

Failed to set volume size: Volume is in in-use state,
it must be available before size can be extended

The volume is attached to a VM. You have two options:

Option 1 — Use the Cinder client (no detach needed):

The openstack client cannot resize in-use volumes, but the cinder client can. Note that cinder requires the volume ID, not the name.

sudo apt install python3-cinderclient
cinder --os-volume-api-version 3.42 extend <VOLUME-ID> 150

After extending, stop and start the VM so the new size is recognized:

openstack server stop <INSTANCE-NAME>
openstack server start <INSTANCE-NAME>

Option 2 — Detach, extend, reattach:

sudo umount /mnt/data
openstack server remove volume <INSTANCE-NAME> <VOLUME-NAME>
openstack volume set --size 150 <VOLUME-NAME>
openstack server add volume <INSTANCE-NAME> <VOLUME-NAME>

Quota Exceeded

VolumeSizeExceedsAvailableQuota: Requested volume or snapshot
exceeds allowed Gigabytes quota. (HTTP 413)

Your project's total volume storage exceeds the quota. Request a quota increase via the Cloud Services Portal under Quota Management.

Volume Limit Exceeded

VolumeLimitExceeded: Maximum number of volumes allowed (N) exceeded

You have exceeded the number of volumes allowed in your project. Request a limit increase via the Cloud Services Portal under Quota Management.

Cannot Shrink a Volume

Volumes can only be extended, not shrunk. If you need a smaller volume, create a new smaller volume, copy the data over, and delete the old one.