Extending an in-use cinder volume?
Hello!
I have a recently deployed CentOS 7 VM with OpenStack rocky deployed using the PackStack all-in-one deployment, in order to evaluate and learn about OpenStack.
In the PackStack setup, the LVM Volume Driver is used by Cinder. The Libvirt driver is used by Nova. (The volume_type is shown as iscsi, I'm not sure why, I think this might be misleading.)
Right now I'm investigating the use case of being able to extend a volume that is currently attached to a running instance, in order to provision extra storage space on the fly. As far as I can tell, work was done in 2017 to add this functionality to Pike, as per the following specs:
- https://specs.openstack.org/openstack/cinder-specs/specs/pike/extend-attached-volume.html (Cinder Specs: Extend a volume while volume is attached to an instance)
- https://specs.openstack.org/openstack/nova-specs/specs/pike/implemented/nova-support-attached-volume-extend.html (Nova Specs: Allow an attached volume to be extended)
What I'm trying to do is to extend an online volume - i.e. grow the available disk space available to an instance without rebooting it, and without adding an additional volume.
Consulting the https://docs.openstack.org/cinder/rocky/reference/support-matrix.html#operation_online_extend_support (Cinder Driver Support Matrix (Rocky)), I have also been able to confirm that this is supported by the LVM driver.
According to the Nova spec:
The initial implementation aims to support virt drivers using os-brick such as libvirt and hyper-v.
So, as far as I can tell, the configuration I'm running (PackStack all-in-one) should support this functionality.
However, I have not been able to find this functionality exposed anywhere in the OpenStack CLI or Horizon. So, I tried an API call as per the https://developer.openstack.org/api-ref/block-storage/v3/index.html?expanded=extend-a-volume-size-detail#volume-actions-volumes-action (API Documentation (Block Storage volume actions)).
The API call below aims to try to extend the volume that's currently attached to the VM from 1 GB to 2 GB.
$ curl -s -H "Content-Type: application/json" -H "X-Auth-Token: <redacted>" http://<redacted>:8776/v3/a17f01bc783445f5b352209283f4cc02/volumes/006e4fcc-aa4d-414b-981c-5b2360d30202/action -d '{"os-extend":{"new_size":2}}'
{"badRequest": {"message": "Invalid volume: Volume 006e4fcc-aa4d-414b-981c-5b2360d30202 status must be '{'status': 'available'}' to extend, currently in-use.", "code": 400}}
As we can see, an error is thrown by Cinder, indicating that an in-use volume cannot be extended.
What am I missing? Is there something about OpenStack as deployed by Packstack that is incompatible with this functionality - i.e. being able to resize volumes on the fly? Or is the functionality simply not there, despite the documentation to the contrary?
For reference, here's a view of the cinder volume and the nova instance to which it is connected:
[root@localhost ~(keystone_demo)]# cinder show 006e4fcc-aa4d-414b-981c-5b2360d30202
+------------------------------+-------------------------------------------------+
| Property | Value |
+------------------------------+-------------------------------------------------+
| attached_servers | ['1dcd32a3-41d0-443d-abd4-9e054cb1844d'] |
| attachment_ids | ['e67c034c-b800-42e8-9478-71e712f60ed2'] |
| availability_zone | nova |
| bootable | true |
| consistencygroup_id | None |
| created_at | 2019-02-10T18:16:37.000000 |
| description | |
| encrypted | False |
| id | 006e4fcc-aa4d-414b-981c-5b2360d30202 |
| metadata | attached_mode : rw |
| | readonly : False |
| multiattach | False |
| name | |
| os-vol-tenant-attr:tenant_id | a17f01bc783445f5b352209283f4cc02 |
| readonly | False |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | in-use |
| updated_at | 2019-02-10T18 ...
Have you verified that your openstack version installed by packstack is actually Pike or newer? What does the output of
nova-manage --version
show? Pike version is 16.X.@eblock
nova-manage --version
shows18.1.0
. I installed Packstack using thecentos-release-openstack-rocky
yum package. So, as I wrote in the question, I expect I'm running rocky.Progress! I was missing a version header with the API call. Adding
-H "OpenStack-API-Version: volume 3.42
to the curl command gave me a positive response.cinder
now shows the volume as 2GB. I can't get Cirros to see the extra space but that might be a cirros thing. I'll try another OS.