Hey Sinat,

The error message suggests that you have volumes that use the volume type you're modifying. If yes, with cinder API, since the Rocky release [1], you cannot modify volume types that are currently in use. The original design for cinder volume types was that they were always mutable - and changes to existing volume types didn't affect pre-existing volumes. However, this behavior was modified in the Ocata release [2], and finally removed in the Rocky release.

One of your options is to also rename the existing volume type and create a new one if you'd like, with the original name. 


On Thu, Nov 7, 2019 at 12:33 AM Sinan Polat <sinan@turka.nl> wrote:

Hi,

I am using Ceph as the backend for Cinder. Within Ceph we have defined 2 RBD pools (ssdvolumes, sasvolumes).
In OpenStack I created 2 Volume Types (ssd, sas). Each Volume Type has property "volume_backend_name='tripleo_ceph_<ssd|sas>'".

In the Cinder configuration I have the following backends configured:

[tripleo_ceph_ssd]
backend_host=hostgroup
volume_backend_name=tripleo_ceph_ssd
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=openstack
rbd_pool=ssdvolumes

[tripleo_ceph_sas]
backend_host=hostgroup
volume_backend_name=tripleo_ceph_sas
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=openstack
rbd_pool=sasvolumes

As you might have noticed, the backend name (tripleo_ceph_ssd) and the RBD pool name (ssdvolumes, not ssd) does not match. So far, we do not have any problems. But I want to correct the names and I do not want to have the mismatch anymore.

So I want to change the value of key volume_backend_name for both Volume Types (tripleo_ceph_ssd => tripleo_ceph_ssdvolumes).

I tried the following:
$ openstack volume type show 80cb25ff-376a-4483-b4f7-d8c75839e0ce
+--------------------+----------------------------------------+
| Field | Value |
+--------------------+----------------------------------------+
| access_project_ids | None |
| description | |
| id | 80cb25ff-376a-4483-b4f7-d8c75839e0ce |
| is_public | True |
| name | ssd |
| properties | volume_backend_name='tripleo_ceph_ssd' |
| qos_specs_id | None |
+--------------------+----------------------------------------+
$


$ openstack volume type set --property volume_backend_name='tripleo_ceph_ssdvolumes' 80cb25ff-376a-4483-b4f7-d8c75839e0ce
Failed to set volume type property: Volume Type is currently in use. (HTTP 400) (Request-ID: req-5efaa5b7-910f-4802-8494-3115cfc4ab93)
Command Failed: One or more of the operations failed
$

How to solve my problem?

Thanks!

Sinan