Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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:

What I'm trying to do is to extend an online volume.

Consulting the 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 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:16:48.000000                      |
| user_id                      | 2b2c9c98ce6948e28ba007722a2f9588                |
| volume_image_metadata        | checksum : f8ab98ff5e73ebab884d80c9dc9c7290     |
|                              | container_format : bare                         |
|                              | disk_format : qcow2                             |
|                              | image_id : f56c4b1f-f5a8-4662-bff3-bf98bacebb74 |
|                              | image_name : cirros                             |
|                              | min_disk : 0                                    |
|                              | min_ram : 0                                     |
|                              | signature_verified : False                      |
|                              | size : 13267968                                 |
| volume_type                  | iscsi                                           |
+------------------------------+-------------------------------------------------+
[root@localhost ~(keystone_demo)]# nova show 1dcd32a3-41d0-443d-abd4-9e054cb1844d
+--------------------------------------+----------------------------------------------------------------------------------+
| Property                             | Value                                                                            |
+--------------------------------------+----------------------------------------------------------------------------------+
| OS-DCF:diskConfig                    | AUTO                                                                             |
| OS-EXT-AZ:availability_zone          | nova                                                                             |
| OS-EXT-STS:power_state               | 1                                                                                |
| OS-EXT-STS:task_state                | -                                                                                |
| OS-EXT-STS:vm_state                  | active                                                                           |
| OS-SRV-USG:launched_at               | 2019-02-10T18:16:56.000000                                                       |
| OS-SRV-USG:terminated_at             | -                                                                                |
| accessIPv4                           |                                                                                  |
| accessIPv6                           |                                                                                  |
| config_drive                         |                                                                                  |
| created                              | 2019-02-10T18:16:33Z                                                             |
| description                          | -                                                                                |
| flavor:disk                          | 1                                                                                |
| flavor:ephemeral                     | 0                                                                                |
| flavor:extra_specs                   | {}                                                                               |
| flavor:original_name                 | m1.tiny                                                                          |
| flavor:ram                           | 512                                                                              |
| flavor:swap                          | 0                                                                                |
| flavor:vcpus                         | 1                                                                                |
| hostId                               | 954938b63d01d6a101067c563bc8bb167e482418dbfc9cb9fe9c0d73                         |
| id                                   | 1dcd32a3-41d0-443d-abd4-9e054cb1844d                                             |
| image                                | Attempt to boot from volume - no image supplied                                  |
| key_name                             | devstack-keypair2                                                                |
| locked                               | False                                                                            |
| metadata                             | {}                                                                               |
| name                                 | cirros1                                                                          |
| os-extended-volumes:volumes_attached | [{"id": "006e4fcc-aa4d-414b-981c-5b2360d30202", "delete_on_termination": false}] |
| private network                      | 10.0.0.20, 192.168.1.245                                                         |
| progress                             | 0                                                                                |
| security_groups                      | default                                                                          |
| status                               | ACTIVE                                                                           |
| tags                                 | []                                                                               |
| tenant_id                            | a17f01bc783445f5b352209283f4cc02                                                 |
| trusted_image_certificates           | -                                                                                |
| updated                              | 2019-02-10T19:10:00Z                                                             |
| user_id                              | 2b2c9c98ce6948e28ba007722a2f9588                                                 |
+--------------------------------------+----------------------------------------------------------------------------------+
[root@localhost ~(keystone_demo)]#

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:

What I'm trying to do is to extend an online volume. volume - i.e. grow the available disk space available to an instance without rebooting it, and without adding an additional volume.

Consulting the 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 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:16:48.000000                      |
| user_id                      | 2b2c9c98ce6948e28ba007722a2f9588                |
| volume_image_metadata        | checksum : f8ab98ff5e73ebab884d80c9dc9c7290     |
|                              | container_format : bare                         |
|                              | disk_format : qcow2                             |
|                              | image_id : f56c4b1f-f5a8-4662-bff3-bf98bacebb74 |
|                              | image_name : cirros                             |
|                              | min_disk : 0                                    |
|                              | min_ram : 0                                     |
|                              | signature_verified : False                      |
|                              | size : 13267968                                 |
| volume_type                  | iscsi                                           |
+------------------------------+-------------------------------------------------+
[root@localhost ~(keystone_demo)]# nova show 1dcd32a3-41d0-443d-abd4-9e054cb1844d
+--------------------------------------+----------------------------------------------------------------------------------+
| Property                             | Value                                                                            |
+--------------------------------------+----------------------------------------------------------------------------------+
| OS-DCF:diskConfig                    | AUTO                                                                             |
| OS-EXT-AZ:availability_zone          | nova                                                                             |
| OS-EXT-STS:power_state               | 1                                                                                |
| OS-EXT-STS:task_state                | -                                                                                |
| OS-EXT-STS:vm_state                  | active                                                                           |
| OS-SRV-USG:launched_at               | 2019-02-10T18:16:56.000000                                                       |
| OS-SRV-USG:terminated_at             | -                                                                                |
| accessIPv4                           |                                                                                  |
| accessIPv6                           |                                                                                  |
| config_drive                         |                                                                                  |
| created                              | 2019-02-10T18:16:33Z                                                             |
| description                          | -                                                                                |
| flavor:disk                          | 1                                                                                |
| flavor:ephemeral                     | 0                                                                                |
| flavor:extra_specs                   | {}                                                                               |
| flavor:original_name                 | m1.tiny                                                                          |
| flavor:ram                           | 512                                                                              |
| flavor:swap                          | 0                                                                                |
| flavor:vcpus                         | 1                                                                                |
| hostId                               | 954938b63d01d6a101067c563bc8bb167e482418dbfc9cb9fe9c0d73                         |
| id                                   | 1dcd32a3-41d0-443d-abd4-9e054cb1844d                                             |
| image                                | Attempt to boot from volume - no image supplied                                  |
| key_name                             | devstack-keypair2                                                                |
| locked                               | False                                                                            |
| metadata                             | {}                                                                               |
| name                                 | cirros1                                                                          |
| os-extended-volumes:volumes_attached | [{"id": "006e4fcc-aa4d-414b-981c-5b2360d30202", "delete_on_termination": false}] |
| private network                      | 10.0.0.20, 192.168.1.245                                                         |
| progress                             | 0                                                                                |
| security_groups                      | default                                                                          |
| status                               | ACTIVE                                                                           |
| tags                                 | []                                                                               |
| tenant_id                            | a17f01bc783445f5b352209283f4cc02                                                 |
| trusted_image_certificates           | -                                                                                |
| updated                              | 2019-02-10T19:10:00Z                                                             |
| user_id                              | 2b2c9c98ce6948e28ba007722a2f9588                                                 |
+--------------------------------------+----------------------------------------------------------------------------------+
[root@localhost ~(keystone_demo)]#