Bug 1023996 - glance api: using --location in swift backend will cause image to be created locally
glance api: using --location in swift backend will cause image to be created ...
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance (Show other bugs)
x86_64 Linux
unspecified Severity high
: ---
: 5.0 (RHEL 7)
Assigned To: Jon Bernard
Tzach Shefi
Depends On:
  Show dependency treegraph
Reported: 2013-10-28 10:33 EDT by Dafna Ron
Modified: 2016-04-26 15:59 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-13 04:58:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
logs (4.29 KB, application/x-gzip)
2013-10-28 10:33 EDT, Dafna Ron
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1245514 None None None Never

  None (edit)
Description Dafna Ron 2013-10-28 10:33:05 EDT
Created attachment 816821 [details]

Description of problem:

I configured swift as my glance backend and my data servers do not have enough disk space. 
when I try to create an image from horizon we fail on not enough disk space. 
when I use the following command in api we succeed to create the image because its created locally. 

 glance image-create --name test --disk-format qcow2 --container-format bare --location http:XXXXX

However, we will not be able to launch an instance from it and instance will be stuck in scheduling. 

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


How reproducible:


Steps to Reproduce:
1. create a setup with swift as glance backend and make sure swift data servers do not have enough disk space
2. create an image from horizon
3. create an image from cli
4. try to boot an instance from image

Actual results:

we succeed in creating the image in cli when using --location

Expected results:

if we change configuration files to work with swift (or any remote backend for that matter) we should either fail --location or re-direct to --copy-from. 

Additional info:
Comment 1 Jakub Ruzicka 2013-10-29 11:41:17 EDT
This doesn't look like glanceclient problem to me. Client doesn't know/care about glance backend, it just sends a command as instructed. If this special case should be handled in any way, it should be done in glance.

Linked upstream bug is filed about glance as well.

Also, I don't think this is a high priority bug, but I'll let the future assignee decide that.
Comment 2 Flavio Percoco 2014-01-03 09:39:41 EST
If you don't want to use the HTTP store, you need to remove it from the `known_stores` config parameter. That will disable the store and fail if `--location http://` is used. Unfortunately, this will also make `--copy-from http://` fail.

I don't think redirection to `--copy-from` is the right thing to do. Glance is designed to use multiple stores and it's up to the user to specify into which location an image should be uploaded.

As for the issue you hit, I can't replicate it. I installed glance + swift and used `--location http://` and it just worked.

One more thing, I couldn't find in the API logs the creation of the image using `--location`, I think the log level was not low enough. Could you please use `debug = True` and `verbose = True` ?
Comment 5 Tzach Shefi 2014-01-12 03:57:33 EST
Also unable to replicate error. 

Glance+swift (backend full), uploaded new image via --location http. 
Image created ok, instance booted up ok from image.

Comment 6 Flavio Percoco 2014-01-13 04:58:40 EST
Ok, that sounds like the right behavior! Closing as won't fix since the expected result is not compliant with how glance works.

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