Extend Volumes
Extending volumes in OpenStack can be performed for both the root volume and additional data volumes. Here, we will discuss the processes for both cases.
Important
Always ensure you have proper backups before performing any volume operations.
Extend the Root Volume
- Shut off the Instance: navigate to Project > Compute > Instances and in the Actions dropdown select
Shut Off Instance
. - Extend the Volume: navigate to Project > Compute > Volumes and in the Actions column click
Extend Volume
. In the popup window that appears specify the new size of the volume and click Extend Volume. - Start the Instance: Once the volume is extended, navigate to Project > Compute > Instances and in the Actions dropdown select
Start Instance
.
Stop the server (if successful, no output):
Verify the results:
Example output
+--------------------------------------+------------------+---------+------------------------------------------------+--------------------------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+------------------+---------+------------------------------------------------+--------------------------+----------+
| 525f7b2c-6d71-4123-988f-e637e383fbd6 | my-CLI-instance2 | ACTIVE | myNetwork=192.168.11.150, 2001:620:6:e021::1b | N/A (booted from volume) | c001r001 |
| f946a80d-1e24-462e-a297-25293bc12f86 | my-CLI-instance | SHUTOFF | myNetwork=192.168.11.163, 2001:620:6:e021::31a | N/A (booted from volume) | c001r001 |
+--------------------------------------+------------------+---------+------------------------------------------------+--------------------------+----------+
Get Volume ID
of the root volume:
Example output
+----------+--------------------------------------+--------------------------------------+------+------------------------+--------------------------------------+--------------------------------------+
| Device | Server ID | Volume ID | Tag | Delete On Termination? | Attachment ID | BlockDeviceMapping UUID |
+----------+--------------------------------------+--------------------------------------+------+------------------------+--------------------------------------+--------------------------------------+
| /dev/sda | f946a80d-1e24-462e-a297-25293bc12f86 | 83d11c7a-d11f-4fb1-b74a-ce85f3fcd5d6 | None | False | 31b883ec-f8b4-4ca1-b46d-cb44c73ca449 | 707562f6-b73a-4faa-82cc-810dccf0c740 |
+----------+--------------------------------------+--------------------------------------+------+------------------------+--------------------------------------+--------------------------------------+
Extend the volume (if successful, no output):
Verify the volume size:
Example output
+--------------------------------------+------+-----------+------+-------------------------------------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+------+-----------+------+-------------------------------------------+
| 66f13145-1f7f-43e5-9f86-e640465defdd | | available | 20 | |
| 563fcad7-9579-48cd-aaec-ed916d5adf7b | | in-use | 20 | Attached to my-CLI-instance2 on /dev/sda |
| 83d11c7a-d11f-4fb1-b74a-ce85f3fcd5d6 | | in-use | 60 | Attached to my-CLI-instance on /dev/sda |
+--------------------------------------+------+-----------+------+-------------------------------------------+
Restart the server; the server will automatically resize its filesystem (if succesful, no output):
Verify the server is active:
Example output
+--------------------------------------+------------------+--------+------------------------------------------------+--------------------------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+------------------+--------+------------------------------------------------+--------------------------+----------+
| 525f7b2c-6d71-4123-988f-e637e383fbd6 | my-CLI-instance2 | ACTIVE | myNetwork=192.168.11.150, 2001:620:6:e021::1b | N/A (booted from volume) | c001r001 |
| f946a80d-1e24-462e-a297-25293bc12f86 | my-CLI-instance | ACTIVE | myNetwork=192.168.11.163, 2001:620:6:e021::31a | N/A (booted from volume) | c001r001 |
+--------------------------------------+------------------+--------+------------------------------------------------+--------------------------+----------+
To further verify you can connect to the instance:
Verify the disk size by listing block devices:
Example output
Check the Filesystem Size:
Example output
Filesystem Size Used Avail Use% Mounted on
tmpfs 96M 1.1M 95M 2% /run
efivarfs 256K 17K 235K 7% /sys/firmware/efi/efivars
/dev/sda1 58G 1.5G 56G 3% /
tmpfs 479M 0 479M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda16 881M 61M 758M 8% /boot
/dev/sda15 105M 6.1M 99M 6% /boot/efi
tmpfs 96M 12K 96M 1% /run/user/1000
Extend Additional Data Volumes
For additional data volumes, the process does not require shutting down and starting the instance. Otherwise, follow the same steps as outlined for extending the root volume.
However, you will need to resize the filesystem: use the resize2fs
command within the instance to resize the filesystem to utilize the new volume size. Check the OpenStack CLI tab in this chapter.
For additional data volumes, the process does not require shutting down and starting the instance. Otherwise, follow the same steps as outlined for extending the root volume.
However, you will need to resize the filesystem.
Connect to the instance:
Verify the disk size by listing block devices:
Example output
Resize the filesystem:
Verify the filesystem is resized: