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

Bug 1204259

Summary: openstack-glance: fail to run "glance image-create" with the --copy-from argument.
Product: Red Hat OpenStack Reporter: Alexander Chuzhoy <sasha>
Component: rhosp-directorAssignee: Hugh Brock <hbrock>
Status: CLOSED WONTFIX QA Contact: Shai Revivo <srevivo>
Severity: medium Docs Contact:
Priority: urgent    
Version: DirectorCC: dmacpher, egafford, eglynn, fpercoco, hbrock, jcoufal, jguiditt, mburns, nbarcet, rhel-osp-director-maint, rhos-maint, sasha, sclewis, scohen, srevivo
Target Milestone: gaKeywords: Regression, TestOnly
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
Glance is not configured with glance.store.http.Store as a known_store in /etc/glance/glance.conf. This means the glance client can not create images with the --copy-from argument. These commands fail with a "400 Bad Request" error. As a workaround, edit /etc/glance/glance-api.conf, add glance.store.http.Store to the list in the "stores" configuration option, then restart the openstack-glance-api server. This enables successful creation of glance images with the --copy-from argument.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-12 15:28:42 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:

Description Alexander Chuzhoy 2015-03-20 17:38:00 UTC
openstack-glance:  fail to run "glance image-create" with the --copy-from argument.


Environment:
openstack-glance-2014.2.2-1.el7ost.noarch
python-glance-store-0.1.10-2.el7ost.noarch
python-glanceclient-0.14.2-2.el7ost.noarch
python-glance-2014.2.2-1.el7ost.noarch


Steps to reproduce:
1. Deploy rhos.
2. Login to the controller and source the file with all the required variables to be able to run the api commands.
3. Run:  glance image-create --name cirros7 --disk-format qcow2 --container-format bare --is-public 1 --copy-from https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img



Result:
<html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  External source are not supported: 'https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img'<br /><br />

 </body>
</html> (HTTP 400)


Expected result:
The image should be added.

Workaround: Download the image and add it with:
glance image-create --name cirros7 --disk-format qcow2 --container-format bare --is-public 1 --file <path to the image>

Comment 4 Flavio Percoco 2015-03-21 14:53:00 UTC
There are a couple of things that could be going wrong here. It could be the encoding format - `gzip` in this case - the redirect/Location link. This is the output of a HEAD request on that URL:

phantom ~ $ http head https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
HTTP/1.1 302 Moved Temporarily
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 20
Content-Type: text/plain;charset=utf-8
Date: Sat, 21 Mar 2015 14:49:59 GMT
Keep-Alive: timeout=60, max=100
Location: https://launchpadlibrarian.net/83305348/cirros-0.3.0-x86_64-disk.img
Server: zope.server.http (HTTP)
Strict-Transport-Security: max-age=15552000
Vary: Cookie,Authorization,Accept-Encoding
Via: 1.0 banana.canonical.com:3128 (squid/2.7.STABLE7)
X-Cache: MISS from banana.canonical.com
X-Cache-Lookup: MISS from banana.canonical.com:3128
X-Content-Type-Options: nosniff
X-Content-Type-Warning: guessed from content
X-Frame-Options: SAMEORIGIN
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
X-Xss-Protection: 1; mode=block


I'll take a deeper look.

Comment 18 Jason Guiditta 2015-03-24 13:06:03 UTC
Sasha, was this openstack environment deployed via staypuft?  If so, then I am confident it is the same configuration issue Flavio mentions and we can close one of these 2 as a duplicate.

Comment 21 Mike Burns 2015-03-24 16:22:04 UTC
Moving to instack, temporarily.  Eventually this needs to move to puppet-heat, but that component doesn't exist yet.

Comment 22 Alexander Chuzhoy 2015-06-02 18:19:00 UTC
Verified: failedQA.

Environment:
openstack-glance-2015.1.0-6.el7ost.noarch

The same error appears on attempt to use external source for image

Comment 28 Sean Cohen 2016-09-12 15:28:42 UTC
Closing old bugs.
Feel free to reopen if resurface in current release.
Sean