Bug 1649679 - Glance doesn't clean up the staging area with default config
Summary: Glance doesn't clean up the staging area with default config
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Abhishek Kekane
QA Contact: Mike Abrams
Kim Nylander
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-14 08:28 UTC by Thomas Hervé
Modified: 2020-05-05 09:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Release Note
Doc Text:
When you use the web-download feature, the staging area - defined in the configuration using the `node_staging_uri` option - is not cleaned up properly. Ensure that `file` is part of the `stores` configuration option in the `glance_store` section of the glance-api.conf file.
Clone Of:
Environment:
Last Closed: 2020-05-05 09:38:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1803498 0 None None None 2018-11-15 07:47:54 UTC
OpenStack gerrit 618468 0 None MERGED Data remains in staging area if 'file' store is not enabled 2020-06-22 09:08:56 UTC

Description Thomas Hervé 2018-11-14 08:28:08 UTC
I tested the web-download import with glance on containers, and saw the following error in the glance logs:

 Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
     result = task.execute(**arguments)
   File "/usr/lib/python2.7/site-packages/glance/async_/flows/api_image_import.py", line 92, in execute
     store_api.delete_from_backend(file_path)
   File "/usr/lib/python2.7/site-packages/glance_store/backend.py", line 409, in delete_from_backend
     loc = location.get_location_from_uri(uri, conf=CONF)
   File "/usr/lib/python2.7/site-packages/glance_store/location.py", line 75, in get_location_from_uri
     raise exceptions.UnknownScheme(scheme=pieces.scheme)
 UnknownScheme: Unknown scheme 'file' found in URI

The import worked though, and the image seems active.

I have the following defined the config:

node_staging_uri=file:///var/lib/glance/staging

It seems this area doesn't get cleaned up, and will get clutter over time.

I used glance in the undercloud with containers, but I don't think it would work in the overcloud either.

Comment 1 Thomas Hervé 2018-11-14 08:32:32 UTC
It looks like it was present since the beginning, too:

https://bugzilla.redhat.com/show_bug.cgi?id=1418436#c8

Comment 2 Cyril Roelandt 2018-11-14 16:16:44 UTC
So, I talked to Thomas. If he adds "file" to the list of stores in glance-api.conf, everything works as expected. I do not think that this is especially user-friendly, though. Shouldn't we automagically load the "file" store? This could be done in the _DeleteFromFS class:

https://github.com/openstack/glance/blob/master/glance/async_/flows/api_image_import.py#L78

We already use this workaround here:

https://github.com/openstack/glance/blob/master/glance/async_/flows/api_image_import.py#L149

@Abhishek: do you think upstream would be ok with this?

Comment 4 Thomas Hervé 2018-11-15 07:47:42 UTC
Opened https://bugs.launchpad.net/glance/+bug/1803498.

Comment 5 Abhishek Kekane 2018-11-16 05:37:02 UTC
Hi Cyril, Thomas,

I have proposed a upstream fix for this issue.
Please refer, https://review.openstack.org/618468


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