Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1921735

Summary: Block Storage (cinder) service always assigns the default volume_type even the volume is created from another source
Product: Red Hat OpenStack Reporter: Fabrizio Soppelsa <fsoppels>
Component: openstack-cinderAssignee: Pablo Caruana <pcaruana>
Status: CLOSED ERRATA QA Contact: Tzach Shefi <tshefi>
Severity: medium Docs Contact: Chuck Copello <ccopello>
Priority: medium    
Version: 16.1 (Train)CC: abishop, pcaruana
Target Milestone: z4Keywords: Triaged, ZStream
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-15.3.1-6.el8ost Doc Type: Bug Fix
Doc Text:
Before this update, the Block Storage (cinder) service would always assign newly created volumes with the default volume type, even when the volume was created from another source, such as an image, snapshot or another volume. This resulted in volumes created from another source having a different volume type from the volume type of the source. With this update, the default volume type is assigned only after determining whether it should be assigned based on the volume type of the source. The volume type of volumes created from another source now match the volume type of the source.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-17 15:36:38 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 Fabrizio Soppelsa 2021-01-28 14:26:31 UTC
Description of problem:
Port this fix https://bugs.launchpad.net/cinder/+bug/1879578


Version-Release number of selected component (if applicable):
Reproduced on RHOSP 16.1.3


How reproducible:
Attempt to rollback after an upgrade: Attempts to rename snapshot volumes fail as part of the rollback.

Comment 2 Alan Bishop 2021-01-28 14:53:27 UTC
The stable/train patch has already been imported, and will ship with 16.1.4

Comment 7 Tzach Shefi 2021-02-14 09:55:32 UTC
Verified on:

openstack-cinder-15.3.1-6.el8ost.noarch

Lets create a volume:
(overcloud) [stack@undercloud-0 ~]$ cinder create 1 --volume-type netapp --name netapp1
+--------------------------------+---------------------------------------+
| Property                       | Value                                 |
+--------------------------------+---------------------------------------+
| attachments                    | []                                    |
| availability_zone              | nova                                  |
| bootable                       | false                                 |
| consistencygroup_id            | None                                  |
| created_at                     | 2021-02-14T09:42:45.000000            |
| description                    | None                                  |
| encrypted                      | False                                 |
| id                             | fb5ac7a8-cee3-499c-a5ac-7e47aa0cea09  |
| metadata                       | {}                                    |
| migration_status               | None                                  |
| multiattach                    | False                                 |
| name                           | netapp1                               |
| os-vol-host-attr:host          | hostgroup@tripleo_netapp2#rhos_cinder |
| os-vol-mig-status-attr:migstat | None                                  |
| os-vol-mig-status-attr:name_id | None                                  |
| os-vol-tenant-attr:tenant_id   | 85f44a372e6d49b489829bb6389c85fa      |
| replication_status             | None                                  |
| size                           | 1                                     |
| snapshot_id                    | None                                  |
| source_volid                   | None                                  |
| status                         | creating                              |
| updated_at                     | 2021-02-14T09:42:45.000000            |
| user_id                        | 45c2199f364d485f986b6d341c512819      |
| volume_type                    | netapp                                |
+--------------------------------+---------------------------------------+

(overcloud) [stack@undercloud-0 ~]$ cinder list
+--------------------------------------+-----------+--------------------+------+-------------+----------+--------------------------------------+
| ID                                   | Status    | Name               | Size | Volume Type | Bootable | Attached to                          |
+--------------------------------------+-----------+--------------------+------+-------------+----------+--------------------------------------+
| fb5ac7a8-cee3-499c-a5ac-7e47aa0cea09 | available | netapp1            | 1    | netapp      | false    |                                      |
+--------------------------------------+-----------+--------------------+------+-------------+----------+--------------------------------------+

Now lets clone this volume as source for a new volume, without stating which type this new clone should be create on
if things workout the new cloned volume should also netapp type.

where as before the fix volume would default to tripleo type. 

(overcloud) [stack@undercloud-0 ~]$ cinder create 1 --source-volid fb5ac7a8-cee3-499c-a5ac-7e47aa0cea09 --name ClonedVolShouldBeNetappBackedToo 
+--------------------------------+--------------------------------------+
| Property                       | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | nova                                 |
| bootable                       | false                                |
| consistencygroup_id            | None                                 |
| created_at                     | 2021-02-14T09:45:39.000000           |
| description                    | None                                 |
| encrypted                      | False                                |
| id                             | 8ee6d7fc-ed83-4cdf-aedc-5e83688bc29e |
| metadata                       | {}                                   |
| migration_status               | None                                 |
| multiattach                    | False                                |
| name                           | ClonedVolShouldBeNetappBackedToo     |
| os-vol-host-attr:host          | None                                 |
| os-vol-mig-status-attr:migstat | None                                 |
| os-vol-mig-status-attr:name_id | None                                 |
| os-vol-tenant-attr:tenant_id   | 85f44a372e6d49b489829bb6389c85fa     |
| replication_status             | None                                 |
| size                           | 1                                    |
| snapshot_id                    | None                                 |
| source_volid                   | fb5ac7a8-cee3-499c-a5ac-7e47aa0cea09 |
| status                         | creating                             |
| updated_at                     | None                                 |
| user_id                        | 45c2199f364d485f986b6d341c512819     |
| volume_type                    | netapp                               |
+--------------------------------+--------------------------------------+

(overcloud) [stack@undercloud-0 ~]$ cinder show 8ee6d7fc-ed83-4cdf-aedc-5e83688bc29e
+--------------------------------+---------------------------------------+
| Property                       | Value                                 |
+--------------------------------+---------------------------------------+
| attached_servers               | []                                    |
| attachment_ids                 | []                                    |
| availability_zone              | nova                                  |
| bootable                       | false                                 |
| consistencygroup_id            | None                                  |
| created_at                     | 2021-02-14T09:45:39.000000            |
| description                    | None                                  |
| encrypted                      | False                                 |
| id                             | 8ee6d7fc-ed83-4cdf-aedc-5e83688bc29e  |
| metadata                       |                                       |
| migration_status               | None                                  |
| multiattach                    | False                                 |
| name                           | ClonedVolShouldBeNetappBackedToo      |
| os-vol-host-attr:host          | hostgroup@tripleo_netapp2#rhos_cinder |
| os-vol-mig-status-attr:migstat | None                                  |
| os-vol-mig-status-attr:name_id | None                                  |
| os-vol-tenant-attr:tenant_id   | 85f44a372e6d49b489829bb6389c85fa      |
| replication_status             | None                                  |
| size                           | 1                                     |
| snapshot_id                    | None                                  |
| source_volid                   | fb5ac7a8-cee3-499c-a5ac-7e47aa0cea09  |
| status                         | available                             |
| updated_at                     | 2021-02-14T09:45:39.000000            |
| user_id                        | 45c2199f364d485f986b6d341c512819      |
| volume_type                    | netapp                                |
+--------------------------------+---------------------------------------+


Good to verify as both source and cloned from source volume, share the same volume type, without having to set it during clone create. 

(overcloud) [stack@undercloud-0 ~]$ cinder list
+--------------------------------------+-----------+----------------------------------+------+-------------+----------+--------------------------------------+
| ID                                   | Status    | Name                             | Size | Volume Type | Bootable | Attached to                          |
+--------------------------------------+-----------+----------------------------------+------+-------------+----------+--------------------------------------+
| 8ee6d7fc-ed83-4cdf-aedc-5e83688bc29e | available | ClonedVolShouldBeNetappBackedToo | 1    | netapp      | false    |                                      |
| fb5ac7a8-cee3-499c-a5ac-7e47aa0cea09 | available | netapp1                          | 1    | netapp      | false    |                                      |
+--------------------------------------+-----------+----------------------------------+------+-------------+----------+--------------------------------------+

Below we also show that a created volume without type, defaults to tripleo volume type,
proving that both desired behaviors has been restored, 
a case of cloning (cinder_img_volume_type) vs. a case of new volume without volume type which defaults to tripleo. 
 
(overcloud) [stack@undercloud-0 ~]$ cinder create 1
+--------------------------------+--------------------------------------+
| Property                       | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | nova                                 |
| bootable                       | false                                |
| consistencygroup_id            | None                                 |
| created_at                     | 2021-02-14T09:47:59.000000           |
| description                    | None                                 |
| encrypted                      | False                                |
| id                             | 6f8970f8-da77-4506-b3ac-ca5acd227396 |
| metadata                       | {}                                   |
| migration_status               | None                                 |
| multiattach                    | False                                |
| name                           | None                                 |
| os-vol-host-attr:host          | None                                 |
| os-vol-mig-status-attr:migstat | None                                 |
| os-vol-mig-status-attr:name_id | None                                 |
| os-vol-tenant-attr:tenant_id   | 85f44a372e6d49b489829bb6389c85fa     |
| replication_status             | None                                 |
| size                           | 1                                    |
| snapshot_id                    | None                                 |
| source_volid                   | None                                 |
| status                         | creating                             |
| updated_at                     | None                                 |
| user_id                        | 45c2199f364d485f986b6d341c512819     |
| volume_type                    | tripleo                              |
+--------------------------------+--------------------------------------+

(overcloud) [stack@undercloud-0 ~]$ cinder list
+--------------------------------------+-----------+----------------------------------+------+-------------+----------+--------------------------------------+
| ID                                   | Status    | Name                             | Size | Volume Type | Bootable | Attached to                          |
| 6f8970f8-da77-4506-b3ac-ca5acd227396 | available | -                                | 1    | tripleo     | false    |                                      |
| 8ee6d7fc-ed83-4cdf-aedc-5e83688bc29e | available | ClonedVolShouldBeNetappBackedToo | 1    | netapp      | false    |                                      |
| fb5ac7a8-cee3-499c-a5ac-7e47aa0cea09 | available | netapp1                          | 1    | netapp      | false    |                                      |
+--------------------------------------+-----------+----------------------------------+------+-------------+----------+--------------------------------------+

Comment 12 errata-xmlrpc 2021-03-17 15:36:38 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.4 director bug fix 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:0817