project purge deletes ALL images

Bug #1717130 reported by tom king on 2017-09-14
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
lihaijing

Bug Description

openstack project purge --project projectName
This command began to delete ALL images, including ones the project did not own.

Adding --dry-run showed it would have deleted every single public image.

Expected behavior would be purging only those images where the owner = project ID, even if an admin is running the command.

Thanks!
Tom King

tom king (kingttx) wrote :
Download full text (26.0 KiB)

(openstack) project purge --project somji
Deleting image : 97ac974f-aea5-4aa0-914c-ba8494614e99
Deleting image : 4e747c25-e614-4b3e-ad35-b9ab94ff0a5a
Deleting image : b0965d19-af4e-42e2-81e3-bd3271248875
^C(openstack) lab@Ubuntu-1404LTS:~$ ^C
lab@Ubuntu-1404LTS:~$ ^C
lab@Ubuntu-1404LTS:~$ ^C
lab@Ubuntu-1404LTS:~$ ^C
lab@Ubuntu-1404LTS:~$ ^C
lab@Ubuntu-1404LTS:~$ openstack role add --project somji --user tking _member_
lab@Ubuntu-1404LTS:~$ openstack project purge --dry-run --project somji
Deleting image : 1eb80977-1f68-43fc-921e-00426059c22a
Deleting image : b1720ddb-8dea-495b-a9ef-8271a52744a8
Deleting image : f67c9beb-d22f-48cc-8581-9a37a608801b
Deleting image : 2f214103-1e3d-4db9-8c78-e43a433b5b59
Deleting image : c573c145-f9a5-4573-8b9f-be5ce14cbef5
Deleting image : d0ca2fbe-c417-4b98-89de-cf2227d0089c
Deleting image : 7173854c-0c55-4874-a1da-240e363a713a
Deleting image : 1f8efc5d-1e8c-4ca1-834e-64c8dc9a7d9e
Deleting image : de1a37a6-2683-4268-943a-68eb88d3104b
Deleting image : b4c94ad7-dc34-4e63-ad80-10145ec68f87
Deleting image : 850cea74-3561-46a5-8e78-7585d504e665
Deleting image : a62be8ba-c3de-4b29-a2ac-add6bfb6f410
Deleting image : 1c3dcbf5-c649-4c34-9a84-857a737c3174
Deleting image : e6a2f34d-1626-40da-b84e-77ab689357e6
Deleting image : deb25ac4-04e0-4a2d-b9e3-63106a60b0d6
Deleting image : 28b30186-2519-4d02-b9f9-ef00d94ec211
Deleting image : cbbce4c2-3f2b-4818-bb59-e53d559e9638
Deleting image : cc48bbdf-7215-48a0-8f66-cf71e4318507
Deleting image : 4fd7abcf-8bea-4308-95e1-006cc619c84e
Deleting image : 1e78a9cc-ffed-4a61-82b3-189ca6463fd6
Deleting image : 19b298de-5676-4907-b861-e7d1f7679581
Deleting image : 2d8c0108-5098-4ac1-abea-c7531748cd43
Deleting image : 3b8bfce4-5618-483e-bb5a-0724ecc1ccb7
Deleting image : 0cf266df-a54a-4e5b-8c4a-6303599574ea
Deleting image : f03a39c2-4c68-4a05-989d-23ca10a778a4
Deleting image : 3e32c5bf-9085-4fec-a7c0-6b126b166856
Deleting image : aef7a883-6bf5-433c-9b5f-fca29ea774f9
Deleting image : 08b42f0d-5869-4a41-9501-e60345f0bb0e
Deleting image : 485ac33a-2442-4428-9f7b-3daf4f05d2f9
Deleting image : 27e7e9bb-5a01-4fc7-b9a1-e5ec24806498
Deleting image : f4cf92f2-96d1-48a1-baa4-f01e866b2b41
Deleting image : c5f29a32-71e9-4868-ad91-2ee69f682643
Deleting image : 8afeb2ca-c918-416d-8837-f376942fdc27
Deleting image : 10a94fde-b05d-44d8-b23d-265881345c06
Deleting image : 61a8e4da-88e0-4b00-b197-238ef0919c6f
Deleting image : b2ef4ad9-ae20-47f7-8fc5-ed32dfbc9b30
Deleting image : 802ebaa6-ea9a-4fe6-8592-8ca4ac853e39
Deleting image : ae74c1f3-56f4-4e64-8794-820c34436ec5
Deleting image : 6ab85b20-6ebe-4ef1-b178-1de70e2ec1e2
Deleting image : 6cf4c4e8-f03f-470b-b478-8b04ec2a6190
Deleting image : 35555809-93cd-4bc4-ad95-4d8a88fdc27d
Deleting image : 5338538f-f538-4500-9c63-779787e6b77b
Deleting image : 9fb0be2d-1fbe-4e8e-920b-e85946d4b0dd
Deleting image : 85c58186-8e24-4b3c-89cb-f9838512897b
Deleting image : eb1b2938-a37d-409a-b2d7-ab5340d4593a
Deleting image : 7f4e33ce-d44b-42b5-94e3-f7e47cc37209
Deleting image : c7a9c5f0-479f-4de2-ae40-934b90ecc009
Deleting image : d8f2d738-ce4b-4812-bd02-706806ad8bf1
Deleting image : c2c7b7de-e049-44f5-858f-f5e7d101e477
Deleting image : e4e7ead1-6e5c-4f60-8e64-998838b262f4
Deleti...

lihaijing (lihaijing) on 2017-09-21
Changed in python-openstackclient:
assignee: nobody → lihaijing (lihaijing)

Fix proposed to branch: master
Review: https://review.openstack.org/506024

Changed in python-openstackclient:
status: New → In Progress

Reviewed: https://review.openstack.org/506024
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=254dbf3294c0f1edc4a2a469f556b3c4b3123a00
Submitter: Jenkins
Branch: master

commit 254dbf3294c0f1edc4a2a469f556b3c4b3123a00
Author: lihaijing <email address hidden>
Date: Thu Sep 21 14:55:17 2017 +0800

    Fix 'project purge' deletes ALL images problem

    Closes-Bug: #1717130
    Change-Id: I33c6fc7897dfee85d1c197a1267bde4abfa5bbd9

Changed in python-openstackclient:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/517369
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=b9c5094ede503109955eb90fe0007e343f7bb903
Submitter: Zuul
Branch: stable/pike

commit b9c5094ede503109955eb90fe0007e343f7bb903
Author: lihaijing <email address hidden>
Date: Thu Sep 21 14:55:17 2017 +0800

    Fix 'project purge' deletes ALL images problem

    Closes-Bug: #1717130
    Change-Id: I33c6fc7897dfee85d1c197a1267bde4abfa5bbd9
    (cherry picked from commit 254dbf3294c0f1edc4a2a469f556b3c4b3123a00)

tags: added: in-stable-pike

This issue was fixed in the openstack/python-openstackclient 3.13.0 release.

David Collins (daveco) wrote :

i know i am running older release (due to a different bug in 3.13) but I noticed the fix only addresses the image issue. The purge will also delete _ALL_ servers in all projects. Below output is run on a project that has no servers or images:

openstack project purge --dry-run --keep-project --project test
Deleting server : 2c260a9c-34f4-469d-843e-5f13ec28fb2b
Deleting server : c3a96f5f-4448-4fb0-8805-f896befb364e
Deleting server : d3215ba2-dee1-4d31-ae76-057d7777ede6
Deleting server : c533b7c1-2460-4470-8c0c-20853dc5e3bd
Deleting server : 5b6be2f8-9200-4ed5-a150-d54fa28f9df2
Deleting server : 92dd3edc-7db1-4c0b-b86e-c5db365cf148
Deleting server : 0daa399b-85ba-490c-8aac-cec0abd7299c
Deleting server : fbf0a1e2-9b76-4b73-8ce8-858f8b480673
Deleting server : 8d4c53c6-aa9a-45fd-8a3a-cdbf42efaf39
Deleting server : 4d87b500-073d-4518-a78d-ed2d5f24db86
Deleting server : 56d70251-d745-4aeb-ab4b-5c650f018b9b
Deleting server : 62da3ba8-5962-4b2a-9305-3260005c5795
Deleting server : 57482f87-d46c-49fe-9af9-b7be57ef0dc7
Deleting server : 01014aec-2624-44b2-816b-c15d74486e5c
Deleting server : ec748420-ba90-4160-9798-f61e51b31f86
Deleting server : 01d54066-1965-4e60-bad2-c0781995452a
Deleting server : eca59933-649f-433b-8db3-1e45a6e2ff35
Deleting server : e79ea891-7ec8-40bf-ac9e-2a3fa03efbb8
Deleting server : 414ce446-2365-42b8-85a2-70a2213b01ae
Deleting server : f759e646-04f9-420b-ac91-24c9c2af8912
Deleting server : 189cfd53-6563-46ae-9f32-90d4f2696ac9
Deleting server : 10116273-99f6-4609-aa50-ec9bddda1f43
Deleting image : 9285def7-5c3d-45cf-9463-f8cd4481fc29
Deleting image : 35b8d86e-18ee-45a0-a3ae-8564666b71e8
Deleting image : 1c49b5ce-e53b-40de-b851-e89f0ec5120a
Deleting image : 8a4220d8-ad5b-4876-b95b-af523d0a5fa1
Deleting image : a4c742e2-d2af-4993-8f4c-4aebef8a9654
Deleting image : 6b1aa0b2-dad0-4673-9c69-370a3e83a0e8
Deleting image : 1c20af9d-a5a5-4fc3-902e-76f094c3f8f9
Deleting image : ff920088-20ae-4057-8bf5-29f30aea711c
Deleting image : 3d2a4313-c91a-4ed5-ab5a-d251fc01cb30
Deleting image : 67d730ca-3984-4cf4-aba8-3788d854585d
Deleting image : d3548087-9bca-41e4-99a1-7ed75ecb9ed1
Deleting image : 8e8c54dc-e0e8-450f-b827-cb144d8f1d04
Deleting image : 1550a2d7-669d-472a-bd93-78e2e96b8c42
Deleting image : 4c38e442-57e4-4aca-b9a0-fa29833dc375
Deleting image : 87efba0b-2734-4e35-ae29-57db179a15d9
Deleting image : 19e7e698-14cc-4f62-8024-9e4ca75253f6
Deleting image : e4a37d6f-5465-4ea7-9daf-77887a30e07c

This issue was fixed in the openstack/python-openstackclient 3.12.1 release.

Saputro Aryulianto (aryulianto) wrote :

Still bugs on OpenStack Queens! python2-openstackclient-3.14.1-1.el7.noarch
When i'am purge the project `foo` the instance on admin project also deleted.

[root@openstack ~(keystone_admin)]# openstack --version
openstack 3.14.1

root@openstack ~(keystone_admin)]# openstack project show foo
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | |
| domain_id | default |
| enabled | True |
| id | 5200e5bc4c87465182c5c8275afb007a |
| is_domain | False |
| name | foo |
| parent_id | default |
| tags | [] |
+-------------+----------------------------------+
[root@openstack ~(keystone_admin)]# openstack project purge --project foo
Deleting server : 12146c6d-b71d-4b9f-a727-d471c3c4c682
Deleting project: 5200e5bc4c87465182c5c8275afb007a

the project `foo` is properly deleted, but wrong instance. they delete instance on project admin, not instance on `foo` project.

Thanks You!
Ary

Alex Walender (awalende) wrote :

Can confirm this bug in python-openstackclient 3.16.0 (Ubuntu Queens).
This bug just took down 12 instances on a project which was not really desired.

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

Other bug subscribers