Cannot remove shared image from project.

Bug #1760528 reported by Gary
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
New
Undecided
Unassigned

Bug Description

I'm sharing out an image to a project. (TEST-PROJECT)
When I remove the image from the project it still shows up in the Horizon Dashboard under the TEST-PROJECT
and from the CLI, it is removed from the shared image list but is still listed in the images for the project.

Am I doing it wrong?
I've tested this with the same results in both Pike and Queens

Create the image:
openstack image create "test-cirros" --file /root/cirros-0.3.5-x86_64-disk.raw --disk-format raw --container-format bare --shared
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | 4bda4108d1a74dd73a6ae6d0ba369916 |
| container_format | bare |
| created_at | 2018-03-23T19:25:55Z |
| disk_format | raw |
| file | /v2/images/6cab246b-decd-45d0-9989-a513392ed63d/file |
| id | 6cab246b-decd-45d0-9989-a513392ed63d |
| min_disk | 0 |
| min_ram | 0 |
| name | test-cirros |
| owner | 165e500d43ca4d998aeb9abdecf223f4 |
| protected | False |
| schema | /v2/schemas/image |
| size | 41126400 |
| status | active |
| tags | |
| updated_at | 2018-03-23T19:26:01Z |
| virtual_size | None |
| visibility | shared |
+------------------+------------------------------------------------------+

Share the image:
os image add project "test-cirros" TEST-PROJECT
+------------+--------------------------------------+
| Field | Value |
+------------+--------------------------------------+
| created_at | 2018-03-23T19:27:03Z |
| image_id | 6cab246b-decd-45d0-9989-a513392ed63d |
| member_id | b755f30bf7a248f184b3a1ee228c746b |
| schema | /v2/schemas/member |
| status | pending |
| updated_at | 2018-03-23T19:27:03Z |
+------------+--------------------------------------+

Accept the image:
os image set --project TEST-PROJECT --accept test-cirros

List the member projects:
glance member-list --image-id 6cab246b-decd-45d0-9989-a513392ed63d
+--------------------------------------+----------------------------------+----------+
| Image ID | Member ID | Status |
+--------------------------------------+----------------------------------+----------+
| 6cab246b-decd-45d0-9989-a513392ed63d | b755f30bf7a248f184b3a1ee228c746b | accepted |
+--------------------------------------+----------------------------------+----------+

Remove the image from the project:
os image remove project "test-cirros" TEST-PROJECT

tail -90 /var/log/glance/api.log | grep -A4 -B4 DELETE
2018-03-23 14:29:14.224 163251 INFO eventlet.wsgi.server [req-e1217726-8f11-4111-a6d5-aced2ee60a78 71274b3073804c6982a277b33db5d2bc 165e500d43ca4d998aeb9abdecf223f4 - default default] 172.19.220.234 - - [23/Mar/2018 14:29:14] "GET /v2/images/test-cirros HTTP/1.1" 404 370 1.129382
2018-03-23 14:29:14.293 163251 INFO eventlet.wsgi.server [req-ab40d709-296b-4726-a0ee-9daa590baba2 71274b3073804c6982a277b33db5d2bc 165e500d43ca4d998aeb9abdecf223f4 - default default] 172.19.220.234 - - [23/Mar/2018 14:29:14] "GET /v2/images?limit=20 HTTP/1.1" 200 15715 0.064829
2018-03-23 14:29:14.303 163251 INFO eventlet.wsgi.server [req-9d325b9f-a183-4a41-a4ef-a3454dffb979 71274b3073804c6982a277b33db5d2bc 165e500d43ca4d998aeb9abdecf223f4 - default default] 172.19.220.234 - - [23/Mar/2018 14:29:14] "GET /v2/schemas/image HTTP/1.1" 200 4357 0.004630
2018-03-23 14:29:14.365 163251 INFO eventlet.wsgi.server [req-ab40d709-296b-4726-a0ee-9daa590baba2 71274b3073804c6982a277b33db5d2bc 165e500d43ca4d998aeb9abdecf223f4 - default default] 172.19.220.234 - - [23/Mar/2018 14:29:14] "GET /v2/images?marker=7a87d698-1901-4281-82f0-184ed6bd7624&limit=20 HTTP/1.1" 200 6144 0.054091
2018-03-23 14:29:14.452 163251 INFO eventlet.wsgi.server [req-436937a4-3658-4b86-9ede-463b32ace831 71274b3073804c6982a277b33db5d2bc 165e500d43ca4d998aeb9abdecf223f4 - default default] 172.19.220.234 - - [23/Mar/2018 14:29:14] "DELETE /v2/images/6cab246b-decd-45d0-9989-a513392ed63d/members/b755f30bf7a248f184b3a1ee228c746b HTTP/1.1" 204 173 0.081709

It is no longer shared:
glance member-list --image-id 6cab246b-decd-45d0-9989-a513392ed63d
+----------+-----------+--------+
| Image ID | Member ID | Status |
+----------+-----------+--------+
+----------+-----------+--------+

os image show test-cirros
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | 4bda4108d1a74dd73a6ae6d0ba369916 |
| container_format | bare |
| created_at | 2018-03-23T19:25:55Z |
| disk_format | raw |
| file | /v2/images/6cab246b-decd-45d0-9989-a513392ed63d/file |
| id | 6cab246b-decd-45d0-9989-a513392ed63d |
| min_disk | 0 |
| min_ram | 0 |
| name | test-cirros |
| owner | b755f30bf7a248f184b3a1ee228c746b |
| protected | False |
| schema | /v2/schemas/image |
| size | 41126400 |
| status | active |
| tags | |
| updated_at | 2018-03-23T19:29:11Z |
| virtual_size | None |
| visibility | shared |
+------------------+------------------------------------------------------+

Become the Test Project
source TEST-PROJECT.rc

os image list | grep test-cirros
| 6cab246b-decd-45d0-9989-a513392ed63d | test-cirros | active |

I can still create an instance:
os server create --flavor m1.medium --image test-cirros --nic net-id=20311e5e-8c33-4125-9f24-25842fa8be38 test-cirr-inst
+-----------------------------+------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | |
| OS-EXT-STS:power_state | NOSTATE |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | None |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| adminPass | WGkia5JgkY27 |
| config_drive | |
| created | 2018-03-23T21:40:26Z |
| flavor | m1.medium (a45f62df-47a1-47e6-893f-1c3df41dfab4) |
| hostId | |
| id | d81c851f-533b-4c3d-8717-8c36c36e8cc0 |
| image | test-cirros (6cab246b-decd-45d0-9989-a513392ed63d) |
| key_name | None |
| name | test-cirr-inst |
| progress | 0 |
| project_id | b755f30bf7a248f184b3a1ee228c746b |
| properties | |
| security_groups | name='default' |
| status | BUILD |
| updated | 2018-03-23T21:40:26Z |
| user_id | 42afd8026b521a836275c849849228ad8f03257443087cf7dc600dcabffc4a05 |
| volumes_attached | |
+-----------------------------+------------------------------------------------------------------+

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.