Bug 2026092

Summary: Attempting to delete an image from Glance that is in use breaks subsequent usage of that image
Product: Red Hat OpenStack Reporter: Giulio Fidente <gfidente>
Component: openstack-tripleo-heat-templatesAssignee: Giulio Fidente <gfidente>
Status: CLOSED ERRATA QA Contact: Tzach Shefi <tshefi>
Severity: high Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: akekane, apavlovs, astupnik, athomas, bkopilov, cyril, eglynn, eharney, ekuvaja, fpantano, gcharot, gfidente, jhakimra, ltoscano, mburns, mgarciac, rdhasman, senrique, spower, tshefi
Target Milestone: z7Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-11.3.2-1.20210720153316.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2019776 Environment:
Last Closed: 2021-12-09 20:20:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2019776    
Bug Blocks: 2026739    

Comment 8 Tzach Shefi 2021-11-30 14:55:17 UTC
verified on:
openstack-tripleo-heat-templates-11.3.2-1.20210720153316.el8ost.noarch

On a deployment with ceph, lets retry reproduce steps:

1. Upload image to glance:
(overcloud) [stack@undercloud-0 ~]$ glance image-create-via-import --disk-format qcow2 --container-format bare --name testimage --visibility public --import-method web-download --uri http://...internal url...rhel-atomic-host-image__x86_64/ISOS/rhel-atomic-cloud-7.6.6-6.x86_64.qcow2 --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scs
+-------------------------------+--------------------------------------+
| Property                      | Value                                |
+-------------------------------+--------------------------------------+
| checksum                      | None                                 |
| container_format              | bare                                 |
| created_at                    | 2021-11-30T14:20:51Z                 |
| disk_format                   | qcow2                                |
| hw_disk_bus                   | scs                                  |
| hw_scsi_model                 | virtio-scsi                          |
| id                            | 592e19b0-2d11-4813-ac9e-f60054eea188 |
| locations                     | []                                   |
| min_disk                      | 0                                    |
| min_ram                       | 0                                    |
| name                          | testimage                            |
| os_glance_failed_import       |                                      |
| os_glance_importing_to_stores | default_backend                      |
| os_hash_algo                  | None                                 |
| os_hash_value                 | None                                 |
| os_hidden                     | False                                |
| owner                         | a18be0bde1e04769b45a65d4287821e1     |
| protected                     | False                                |
| size                          | None                                 |
| status                        | importing                            |
| tags                          | []                                   |
| updated_at                    | 2021-11-30T14:20:52Z                 |
| virtual_size                  | Not available                        |
| visibility                    | public                               |
+-------------------------------+--------------------------------------+

(overcloud) [stack@undercloud-0 ~]$ glance image-show 592e19b0-2d11-4813-ac9e-f60054eea188
+-------------------------------+----------------------------------------------------------------------------------+
| Property                      | Value                                                                            |
+-------------------------------+----------------------------------------------------------------------------------+
| checksum                      | ad9cff50aa1aa38f47605bc1a5911e2f                                                 |
| container_format              | bare                                                                             |
| created_at                    | 2021-11-30T14:20:51Z                                                             |
| direct_url                    | rbd://c17fa447-1002-41e8-a4ac-f906289ce6fc/images/592e19b0-2d11-4813-ac9e-f60054 |
|                               | eea188/snap                                                                      |
| disk_format                   | raw                                                                              |
| hw_disk_bus                   | scs                                                                              |
| hw_scsi_model                 | virtio-scsi                                                                      |
| id                            | 592e19b0-2d11-4813-ac9e-f60054eea188                                             |
| locations                     | [{"url": "rbd://c17fa447-1002-41e8-a4ac-f906289ce6fc/images/592e19b0-2d11-4813-a |
|                               | c9e-f60054eea188/snap", "metadata": {"store": "default_backend"}}]               |
| min_disk                      | 0                                                                                |
| min_ram                       | 0                                                                                |
| name                          | testimage                                                                        |
| os_glance_failed_import       |                                                                                  |
| os_glance_importing_to_stores |                                                                                  |
| os_hash_algo                  | sha512                                                                           |
| os_hash_value                 | 4644fe92214d630b1f96eb8e4b6dd318b23e8113c9571695c9cd67fb904df628b46331fc3431e192 |
|                               | 446e0414e1e8364f6dc946559361d6f187779b9f94aaeeeb                                 |
| os_hidden                     | False                                                                            |
| owner                         | a18be0bde1e04769b45a65d4287821e1                                                 |
| protected                     | False                                                                            |
| size                          | 10737418240                                                                      |
| status                        | active                                                                           |
| stores                        | default_backend                                                                  |
| tags                          | []                                                                               |
| updated_at                    | 2021-11-30T14:39:49Z                                                             |
| virtual_size                  | 10737418240                                                                      |
| visibility                    | public                                                                           |
+-------------------------------+----------------------------------------------------------------------------------+


2. Create a volume from image:
(overcloud) [stack@undercloud-0 ~]$ openstack volume create --image testimage --size 10 --type tripleo testvolume
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attachments         | []                                   |
| availability_zone   | nova                                 |
| bootable            | false                                |
| consistencygroup_id | None                                 |
| created_at          | 2021-11-30T14:44:25.000000           |
| description         | None                                 |
| encrypted           | False                                |
| id                  | acc86d28-d8cc-4bac-a495-18270449b1fc |
| migration_status    | None                                 |
| multiattach         | False                                |
| name                | testvolume                           |
| properties          |                                      |
| replication_status  | None                                 |
| size                | 10                                   |
| snapshot_id         | None                                 |
| source_volid        | None                                 |
| status              | creating                             |
| type                | tripleo                              |
| updated_at          | None                                 |
| user_id             | 8104e35b9a6048948904b7f7d66e67a7     |
+---------------------+--------------------------------------+


3. Try to delete the image during vol creation:
(overcloud) [stack@undercloud-0 ~]$ openstack image delete testimage
Failed to delete image with name or ID 'testimage': HTTP 409 Conflict: Image 592e19b0-2d11-4813-ac9e-f60054eea188 could not be deleted because it is in use: The image cannot be deleted because it is in use through the backend store outside of Glance.
Failed to delete 1 of 1 images.

(overcloud) [stack@undercloud-0 ~]$ openstack image list
+--------------------------------------+-----------+--------+
| ID                                   | Name      | Status |
+--------------------------------------+-----------+--------+
| 592e19b0-2d11-4813-ac9e-f60054eea188 | testimage | active |
+--------------------------------------+-----------+--------+

4. Try to create a second volume from image
(overcloud) [stack@undercloud-0 ~]$ openstack volume create --image testimage --size 10 --type tripleo testvolumeB
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attachments         | []                                   |
| availability_zone   | nova                                 |
| bootable            | false                                |
| consistencygroup_id | None                                 |
| created_at          | 2021-11-30T14:51:35.000000           |
| description         | None                                 |
| encrypted           | False                                |
| id                  | 119d0398-b37e-4c3d-ab59-7b83b6499f4d |
| migration_status    | None                                 |
| multiattach         | False                                |
| name                | testvolumeB                          |
| properties          |                                      |
| replication_status  | None                                 |
| size                | 10                                   |
| snapshot_id         | None                                 |
| source_volid        | None                                 |
| status              | creating                             |
| type                | tripleo                              |
| updated_at          | None                                 |
| user_id             | 8104e35b9a6048948904b7f7d66e67a7     |
+---------------------+--------------------------------------+

(overcloud) [stack@undercloud-0 ~]$ openstack volume list
+--------------------------------------+-------------+-----------+------+-------------+                                                                                                                                                      
| ID                                   | Name        | Status    | Size | Attached to |                                                                                                                                                      
+--------------------------------------+-------------+-----------+------+-------------+                                                                                                                                                      
| 119d0398-b37e-4c3d-ab59-7b83b6499f4d | testvolumeB | available |   10 |             |
| acc86d28-d8cc-4bac-a495-18270449b1fc | testvolume  | available |   10 |             |
+--------------------------------------+-------------+-----------+------+-------------+

As can be seen above both volumes are available,
before the fix the second volume would fail to create, reach error state,
Good to verify.

Comment 16 errata-xmlrpc 2021-12-09 20:20:55 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