Cinder fails to automatically map availability zones to volume types
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
High
|
Unassigned |
Bug Description
Scenario:
- Multi-AZ OpenStack deployment
$ openstack availability zone list --compute
+------
| Zone Name | Zone Status |
+------
| az1 | available |
| az2 | available |
| internal | available |
+------
- Multiple Cinder-Ceph storage backends each available in their respective AZ
$ openstack availability zone list --volume
+------
| Zone Name | Zone Status |
+------
| az1 | available |
| nova | not available |
| az2 | available |
+------
- Each Cinder storage back-ends is tied to a unique volume type
$ openstack volume type list --long
+------
| ID | Name | Is Public | Description | Properties |
+------
| 84acc1d5-
| 332299a5-
| 07fc3552-
+------
$ openstack volume service list --long | grep -v disabled
+------
| Binary | Host | Zone | Status | State | Updated At | Disabled Reason |
+------
| cinder-backup | cinder | nova | enabled | up | 2022-12-
| cinder-volume | cinder@
| cinder-scheduler | cinder | nova | enabled | up | 2022-12-
| cinder-volume | cinder@
+------
Nova Cloud Controller has been configured to disallow volume cross-az-attach, otherwise volumes will be created in an inaccessible availability zone
$ juju config nova-cloud-
Cinder should be able to calculate respective volume types when a respective AZ is specified, however it fails to create volumes:
$ openstack volume create --availability-zone az2 --size 10 az2-volume-test
Availability zone 'az2' is invalid. (HTTP 400) (Request-ID: req-4a4ce41d-
Setting these juju configurations does not make a difference:
$ juju config cinder-ceph-ssd backend-
$ juju config cinder-ceph-nvme backend-
Tracing the process shows that the issue is related to _get_volume_type() call in the _extract_
Looking into _get_volume_type(), it appears to be missing the logic to calculate proper volume types matching avalability zones defined with RESKEY:
I made a small patch that addresses that issue (attached).
Once the patch is applied, volumes are properly created mapping correctly to correct volume types:
$ openstack volume create --availability-zone az2 --size 10 az2-volume-test
+------
| Field | Value |
+------
| attachments | [] |
| availability_zone | az2 |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2022-12-
| description | None |
| encrypted | False |
| id | 0d78adb5-
| migration_status | None |
| multiattach | False |
| name | az2-volume-test |
| properties | |
| replication_status | None |
| size | 10 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| type | ssd |
| updated_at | None |
| user_id | e40ba17bc77c462
+------
tags: | added: sts |
tags: | added: az |
Changed in cinder: | |
importance: | Undecided → High |
Changed in cinder: | |
status: | New → In Progress |
Adding the trace log. This was tested on cinder-* 2:19.1. 1-0ubuntu1~ cloud0