Hi Eugen,

On Tue, Oct 20, 2020 at 6:12 PM Eugen Block <eblock@nde.ag> wrote:
Hi Rajat,

I retyped all remaining volumes of type "__DEFAULT__" but I still 
can't delete that type, apparently it's marked as default somewhere, 
but I can't find anything in the database referring to __DEFAULT__ 
except the cinder.volume_types table. I tried to delete it:

---snip---
controller02:~ # openstack volume type list
+--------------------------------------+-------------+-----------+
| ID                                   | Name        | Is Public |
+--------------------------------------+-------------+-----------+
| f27162b0-c3c4-4929-8a95-89b83875885f | __DEFAULT__ | True      |
[...]
+--------------------------------------+-------------+-----------+

controller02:~ # openstack volume type delete 
f27162b0-c3c4-4929-8a95-89b83875885f
Failed to delete volume type with name or ID 
'f27162b0-c3c4-4929-8a95-89b83875885f': Target volume type is default 
and cannot be deleted. (HTTP 400) (Request-ID: 
req-859c6546-a368-4f6f-ab02-80000c4404c1)
---snip---


This is probably because your cinder package version isn't updated to 15.4.0 (Train)
Your deployment should contain this patch[1] to make it work
To verify, you can run ``cinder-manage --version`` command
 

But according to cinder I have a different default-type:

---snip---
controller02:~ # cinder type-default
+--------------------------------------+------+-------------+-----------+
| ID                                   | Name | Description | Is_Public |
+--------------------------------------+------+-------------+-----------+
| 5f7f9e7f-a5b4-4061-b228-022d42139467 | hdd  |             | True      |
+--------------------------------------+------+-------------+-----------+
---snip---


How do I get rid of that type now?

Regards,
Eugen


Zitat von Rajat Dhasmana <rdhasman@redhat.com>:

> ---------- Forwarded message ---------
> From: Rajat Dhasmana <rdhasman@redhat.com>
> Date: Sat, Oct 17, 2020 at 12:31 AM
> Subject: Re: [ops] [cinder] __DEFAULT__ volume type
> To: Massimo Sgaravatto <massimo.sgaravatto@gmail.com>
>
>
> Hi Massimo,
>
>
>
> On Fri, Oct 16, 2020 at 7:42 PM Massimo Sgaravatto <
> massimo.sgaravatto@gmail.com> wrote:
>
>> I have recently updated my Cloud from Rocky to Train (I am running Cinder
>> v. 15.4.0)
>> I have a question concerning the __DEFAULT__ volume type, that I don't
>> remember to have seen before.
>>
>>
> Since Train, cinder has decided to discourage untyped volumes (volumes with
> None volume type) as it doesn't add any value to the volume attributes. To
> achieve this, we created the __DEFAULT__ type and migrated all untyped
> volumes to have the __DEFAULT__ type.
>
>
>> Since:
>> - I have no volumes using this volume type
>> - I defined in in the [DEFAULT] section of cinder.conf the attribute
>> "default_volume_type" to a value different than "__DEFAULT___"
>>
>> I assume that I can safely delete the __DEFAULT__ volume type
>>
>> Is this correct?
>>
>>
> Yes, as long as there are no volumes using it and there is a valid volume
> type defined with ``default_volume_type`` config in cinder.conf, you can
> safely delete it.
> NOTE: ``default_volume_type`` has a default value of ``__DEFAULT__`` to not
> allow users to further create untyped volumes, if you are deleting this,
> make sure there is always a valid volume type defined with
> ``default_volume_type`` in cinder.conf
>
>
>> Thanks, Massimo
>>
>
>
> Thanks and Regards
> Rajat Dhasmana


[1] https://github.com/openstack/cinder/commit/e62ac18085e1deef83c975558db3de2a183528e1