Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1150066

Summary: RFE: expose an API to get the image upload state
Product: Red Hat OpenStack Reporter: Matthias Runge <mrunge>
Component: openstack-glanceAssignee: Flavio Percoco <fpercoco>
Status: CLOSED UPSTREAM QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.0 (RHEL 7)CC: eglynn, fpercoco, mrunge, scohen, yeylon
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-12 15:17:03 UTC Type: Bug
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:    
Bug Blocks: 1036505    

Description Matthias Runge 2014-10-07 11:38:13 UTC
Description of problem:

we, for horizon would like to show the progress of image uploads.

glanceclient is able to show the state, but only for local uploads.

Currently, we can not know the state of an upload. It would be nice, if we could poll for a state, or get notified, once a notifier mechanism is in place.

Comment 2 Flavio Percoco 2014-11-25 08:04:11 UTC
Currently, Glance supports 3 types of image upload. One is direct upload, another one is using a copy mechanism and the third one is to simply point to a remote location.

For all of the above, Glance will show the image in `queue` state if no image data has been uploaded, `saving` is the image data is being gathered and `active` once that process ends.

For which of the 3 types of uploads do you need this and why isn't the current mechanism enough?

It'll be really hard - close to impossible - to provide a reliable mechanism to show a progress status for these operations due to the fact that we almost never know what the actual size of the image is until we've uploaded/downloaded it completely.

Comment 3 Matthias Runge 2014-11-25 08:56:59 UTC
Flavio, we want to upload to glance most probably by proxying through horizon.

The current mechanism in glanceclient is not enough, because it's console hack and we can't know, what was already transferred to glance, i.e. what portion of data already reached the storage. We have a feature request to display a progress bar for uploads.

Comment 4 Flavio Percoco 2014-11-25 10:32:37 UTC
The current progress bar is a console hack because that's the only way we can make it work. As I mentioned in the previous comment, we don't know the actual size of the image until it's been fully downloaded/uploaded, therefore we can't implement a progress status reliably.

The status thing, however, is part of the image and it'd be the only thing that can express, reliably, the status of the image.

Just for the sake of clarity, my point is that the receiver of the data can't know how much data has yet to be sent unless it's told in advance how much data will be sent. Since this is not the case and there's no way - and probably won't be - to do this, I think this can't be implemented.

Hopefully, I understood correctly what you need, otherwise, lets talk about this a bit more.

Comment 5 Matthias Runge 2014-11-25 13:47:05 UTC
Flavio, when saying, it's not possible to know the size of a file to be uploaded, then I'd assume, it's not possible to implement this feature at all, right?

Would it be possible to return the amount of data already transferred?
That way, we'd had something to show to the user.

Comment 6 Flavio Percoco 2015-06-12 14:45:12 UTC
Matthias, that's correct.

Can we move this upstream?

TBH, this could also be implemented in horizon directly with a cooperative reader (or similar implementations). If we implement it in Glance, it'll be part of the client's CLI, which will be of no use to Horizon. :/

Comment 7 Matthias Runge 2015-06-12 15:17:03 UTC
Sure, let's discuss this upstream.

The issue with implementing this in horizon is: while proxying, you still have no clue, how much has been transferred.

I agree, it'd be silly to make an api call to query glance, how much data for an image was received :/