Bug 1947415

Summary: [RHOSP16.1]: Unable to delete __DEFAULT__ volume type
Product: Red Hat OpenStack Reporter: Shravan Kumar Tiwari <shtiwari>
Component: openstack-cinderAssignee: Rajat Dhasmana <rdhasman>
Status: CLOSED ERRATA QA Contact: Tzach Shefi <tshefi>
Severity: medium Docs Contact: RHOS Documentation Team <rhos-docs>
Priority: medium    
Version: 16.1 (Train)CC: gregraka, ltoscano, ndeevy, rdhasman
Target Milestone: z7Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-15.4.0-1.20210709072758.58f0e73.el8ost Doc Type: Bug Fix
Doc Text:
Before this update, a failure occurred when users wanted to delete the `__DEFAULT__` volume type. + With this update, you can delete the `__DEFAULT__` volume type when it is not set as the value of the `default_volume_type` parameter in the `cinder.conf` file. The default value of the `default_volume_type` parameter is `__DEFAULT__` so you must set it to an appropriate volume type, for example 'tripleo', so that you can delete the `__DEFAULT__` volume type.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-09 20:18:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shravan Kumar Tiwari 2021-04-08 12:41:34 UTC
Description of problem:
In order to prevent confusion, customer want to get rid of volume types that are not to be used. So they want to delete the __DEFAULT__ volume type.

They have the default_volume_type defined as 'nvme' (in this case).


Version-Release number of selected component (if applicable):
RHOSP16.1 Z3

Additional Information:

There is an upstream bug: https://bugs.launchpad.net/cinder/+bug/1886632 that is supposed to be fixed in Train release.


Following are the details from current env.

-- $ openstack volume type list --long
+--------------------------------------+-------------+-----------+---------------------+------------+
| ID                                   | Name        | Is Public | Description         | Properties |
+--------------------------------------+-------------+-----------+---------------------+------------+
| 929a6d82-ec95-4438-9896-200684fd6afa | nvme        | True      | None                |            |
| 91835972-c228-4fd9-8d08-861e7f619ad5 | __DEFAULT__ | True      | Default Volume Type |            |
+--------------------------------------+-------------+-----------+---------------------+------------+

-- $ openstack volume type list --default
+--------------------------------------+------+-----------+
| ID                                   | Name | Is Public |
+--------------------------------------+------+-----------+
| 929a6d82-ec95-4438-9896-200684fd6afa | nvme | True      |
+--------------------------------------+------+-----------+

-- openstack volume type delete __DEFAULT__

It fails with error "Failed to delete volume type with name or ID '__DEFAULT__': Target volume type is default and cannot be deleted. (HTTP 400"

Comment 13 Tzach Shefi 2021-08-01 12:40:39 UTC
Verified on:
openstack-cinder-15.4.0-1.20210713144324.58f0e73.el8ost.noarch

Types that we currently have:

(overcloud) [stack@undercloud-0 ~]$ openstack volume type list --long
+--------------------------------------+-------------+-----------+---------------------+------------+
| ID                                   | Name        | Is Public | Description         | Properties |
+--------------------------------------+-------------+-----------+---------------------+------------+
| d9c999f3-58d9-44ff-9a61-390bd5439af1 | tripleo     | True      | None                |            |
| daa51200-aaf5-4031-abb4-646bbf9493b3 | __DEFAULT__ | True      | Default Volume Type |            |
+--------------------------------------+-------------+-----------+---------------------+------------+

The default type is set to tripleo
(overcloud) [stack@undercloud-0 ~]$ openstack volume type list --default
+--------------------------------------+---------+-----------+
| ID                                   | Name    | Is Public |
+--------------------------------------+---------+-----------+
| d9c999f3-58d9-44ff-9a61-390bd5439af1 | tripleo | True      |
+--------------------------------------+---------+-----------+


Lets try to delete "__DEFAULT__"
(overcloud) [stack@undercloud-0 ~]$ openstack volume type delete __DEFAULT__

Looks good, this time we're able to delete __DEFAULT__ and are left with only the tripleo volume type:
(overcloud) [stack@undercloud-0 ~]$ openstack volume type list --long
+--------------------------------------+---------+-----------+-------------+------------+
| ID                                   | Name    | Is Public | Description | Properties |
+--------------------------------------+---------+-----------+-------------+------------+
| d9c999f3-58d9-44ff-9a61-390bd5439af1 | tripleo | True      | None        |            |
+--------------------------------------+---------+-----------+-------------+------------+

Good to verify.

Comment 29 errata-xmlrpc 2021-12-09 20:18:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.1.7 (Train) bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:3762