Bug 1806811 - Creating image for volume does not honour protected and private flag [NEEDINFO]
Summary: Creating image for volume does not honour protected and private flag
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-openstackclient
Version: 13.0 (Queens)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ga
: 17.1
Assignee: Rajat Dhasmana
QA Contact: msava
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-25 04:50 UTC by David Sedgmen
Modified: 2023-08-16 01:10 UTC (History)
10 users (show)

Fixed In Version: python-openstackclient-5.5.2-1.20230204060905.42d9b6e.el9ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-16 01:09:23 UTC
Target Upstream Version:
Embargoed:
astillma: needinfo? (rdhasman)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack Storyboard 2008882 0 None None None 2021-05-05 00:48:58 UTC
OpenStack gerrit 789649 0 None master: MERGED python-openstackclient: openstack image create: honor protection/visibility flags (Id5c05ef7d7bb0a04b9d7a9d821e544e1ff7b... 2022-07-05 13:51:41 UTC
OpenStack gerrit 844268 0 None master: MERGED python-openstackclient: Fix: create image from volume command (I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc) 2022-07-05 13:51:47 UTC
OpenStack gerrit 848448 0 None stable/wallaby: MERGED python-openstackclient: openstack image create: honor protection/visibility flags (Id5c05ef7d7bb0a04b9d7a9d821e544e1ff7b... 2022-07-05 13:51:53 UTC
OpenStack gerrit 848449 0 None stable/wallaby: MERGED python-openstackclient: Fix: create image from volume command (I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc) 2022-07-05 13:51:59 UTC
Red Hat Issue Tracker OSP-2206 0 None None None 2022-06-17 15:54:32 UTC
Red Hat Product Errata RHEA-2023:4577 0 None None None 2023-08-16 01:10:32 UTC

Description David Sedgmen 2020-02-25 04:50:29 UTC
Description of problem:

When creating an image for a volume and specifying the protected flag (--protected) or the the private flag (--private)

The resulting image created does not have the protected flag or the  visibility set to private

#######################################
(overcloud) [stack@undercloud-0 ~]$ openstack image create --disk-format raw --protected  --private --volume test-vol test-vol-image
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| container_format    | bare                                 |
| disk_format         | raw                                  |
| display_description | None                                 |
| id                  | c6e2ed3b-cdaa-4438-ab06-4146fe28706d |
| image_id            | 19c369a7-649d-464a-bf07-3eebd0eca9eb |
| image_name          | test-vol-image                       |
| protected           | False                                |
| size                | 4                                    |
| status              | uploading                            |
| updated_at          | 2020-02-25T04:44:11.000000           |
| visibility          | shared                               |
| volume_type         | tripleo                              |
+---------------------+--------------------------------------+


(overcloud) [stack@undercloud-0 ~]$ openstack image show test-vol-image
+------------------+------------------------------------------------------------------------------+
| Field            | Value                                                                        |
+------------------+------------------------------------------------------------------------------+
| checksum         | 5f13a2485c669bdfc5a0e061b6cb29e7                                             |
| container_format | bare                                                                         |
| created_at       | 2020-02-25T04:44:25Z                                                         |
| disk_format      | raw                                                                          |
| file             | /v2/images/19c369a7-649d-464a-bf07-3eebd0eca9eb/file                         |
| id               | 19c369a7-649d-464a-bf07-3eebd0eca9eb                                         |
| min_disk         | 0                                                                            |
| min_ram          | 0                                                                            |
| name             | test-vol-image                                                               |
| owner            | eb7c6ce254f44553b950c375fbd9d81a                                             |
| properties       | direct_url='swift+config://ref1/glance/19c369a7-649d-464a-bf07-3eebd0eca9eb' |
| protected        | False                                                                        |
| schema           | /v2/schemas/image                                                            |
| size             | 4294967296                                                                   |
| status           | active                                                                       |
| tags             |                                                                              |
| updated_at       | 2020-02-25T04:44:54Z                                                         |
| virtual_size     | None                                                                         |
| visibility       | shared                                                                       |
+------------------+------------------------------------------------------------------------------+
#######################################

Version-Release number of selected component (if applicable):


How reproducible:

Everytime

Steps to Reproduce:

1. Create volume
2. Create image from volume with protected or private flag 


Actual results:

Image created from volume is neither protected or private

Expected results:

Image created from volume is protected and private

Additional info:

These can be set after the fact 

###################################
(overcloud) [stack@undercloud-0 ~]$ openstack image set --protected  --private test-vol-image
(overcloud) [stack@undercloud-0 ~]$ openstack image show test-vol-image
+------------------+------------------------------------------------------------------------------+
| Field            | Value                                                                        |
+------------------+------------------------------------------------------------------------------+
| checksum         | 5f13a2485c669bdfc5a0e061b6cb29e7                                             |
| container_format | bare                                                                         |
| created_at       | 2020-02-25T04:44:25Z                                                         |
| disk_format      | raw                                                                          |
| file             | /v2/images/19c369a7-649d-464a-bf07-3eebd0eca9eb/file                         |
| id               | 19c369a7-649d-464a-bf07-3eebd0eca9eb                                         |
| min_disk         | 0                                                                            |
| min_ram          | 0                                                                            |
| name             | test-vol-image                                                               |
| owner            | eb7c6ce254f44553b950c375fbd9d81a                                             |
| properties       | direct_url='swift+config://ref1/glance/19c369a7-649d-464a-bf07-3eebd0eca9eb' |
| protected        | True                                                                         |
| schema           | /v2/schemas/image                                                            |
| size             | 4294967296                                                                   |
| status           | active                                                                       |
| tags             |                                                                              |
| updated_at       | 2020-02-25T04:46:31Z                                                         |
| virtual_size     | None                                                                         |
| visibility       | private                                                                      |
+------------------+------------------------------------------------------------------------------+
###################################

Comment 4 Cyril Roelandt 2020-03-04 21:36:31 UTC
Hello David,

I think you might be on to something :)

Can you try to use the glanceclient and see whether it works as expected?

I think this might be a python-openstackclient issue that should be reported upstream, I'll take a closer look ASAP.

Comment 5 David Sedgmen 2020-03-05 00:29:30 UTC
Hi Cyril

I there does not seem to be an option to create image from volume for the "glance" cli command.

Comment 7 Cyril Roelandt 2021-06-25 01:24:10 UTC
There is an upstream patch with a +2 and a story. I'm moving this to python-openstackclient.

Comment 9 Cyril Roelandt 2022-06-30 15:09:27 UTC
Downstream, we also want https://review.opendev.org/c/openstack/python-openstackclient/+/844268 to prevent introducing a new bug.

Comment 10 Cyril Roelandt 2022-07-05 22:24:18 UTC
Both patches have been merged upstream in stable/wallaby, but too late for 17.0ga. Pushing this to 17.1.

Comment 23 errata-xmlrpc 2023-08-16 01:09:23 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 (Release of components for Red Hat OpenStack Platform 17.1 (Wallaby)), 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/RHEA-2023:4577


Note You need to log in before you can comment on or make changes to this bug.