Ask Your Question
1

glance + swift : cannot retrieve image (Juno)

asked 2016-02-07 15:16:36 -0500

pirlouit32 gravatar image

Hello

Following the Openstack installation guide for Ubuntu, I have setup a 4 nodes (controller, Network, Compute, Object Storage) environment. Now I have configured Swift as default repository for Glance to store images. Images are created fine, but I cannot launch any instances from these images. It looks like they cannot be retrieved from Swift, even if they appear to have been uploaded just fine.

Some logs below:

openstack@controller:/var/log$ cd ~
openstack@controller:~$ source admin-openrc.sh 
openstack@controller:~$ !1840
glance image-create --name "cirros-swift" --file ~/cirros.img --disk-format qcow2 --container-format bare --is-public True --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 133eae9fb1c98f45894a4e60d8736619     |
| container_format | bare                                 |
| created_at       | 2016-01-31T21:33:03                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | ed2f6bb5-08d6-48c3-ae87-f7971578c936 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros-swift                         |
| owner            | 10450e8bc02f47cd9fe5fe4db1d6a469     |
| protected        | False                                |
| size             | 13200896                             |
| status           | active                               |
| updated_at       | 2016-01-31T21:33:04                  |
| virtual_size     | None                                 |
+------------------+--------------------------------------+
openstack@controller:~$ source glance-openrc.sh 
openstack@controller:~$ swift list glance
brr2.txt
ed2f6bb5-08d6-48c3-ae87-f7971578c936
openstack@controller:~$ glance image-list
+--------------------------------------+---------------------+-------------+------------------+----------+--------+
| ID                                   | Name                | Disk Format | Container Format | Size     | Status |
+--------------------------------------+---------------------+-------------+------------------+----------+--------+
| 3642f82a-5201-48da-80ca-68ff2e1ab6af | cirros-0.3.3-x86_64 | qcow2       | bare             | 13200896 | active |
| ed2f6bb5-08d6-48c3-ae87-f7971578c936 | cirros-swift        | qcow2       | bare             | 13200896 | active |
+--------------------------------------+---------------------+-------------+------------------+----------+--------+
openstack@controller:~$ source admin-openrc.sh 
openstack@controller:~$ glance image-download cirros-swift
Request returned failure status 404.
<html>
 <head>
  <title>404 Not Found</title>
 </head>
 <body>
  <h1>404 Not Found</h1>
  Swift could not find object ed2f6bb5-08d6-48c3-ae87-f7971578c936.<br /><br />

 </body>
</html> (HTTP 404)
openstack@controller:~$ source glance-openrc.sh 
openstack@controller:~$ swift download glance ed2f6bb5-08d6-48c3-ae87-f7971578c936
Object 'glance/ed2f6bb5-08d6-48c3-ae87-f7971578c936' not found

openstack@controller:~$ swift stat glance dcbf8ed7-9d49-46db-991d-74007437495e
       Account: AUTH_87689a6b397240aa81000795c7cdb562
     Container: glance
        Object: dcbf8ed7-9d49-46db-991d-74007437495e
  Content Type: application/octet-stream
Content Length: 13200896
 Last Modified: Sun, 31 Jan 2016 19:50:22 GMT
          ETag: 133eae9fb1c98f45894a4e60d8736619
 Accept-Ranges: bytes
   X-Timestamp: 1454269821.55908
    X-Trans-Id: txb68b1fa3868e48f98c7b0-0056ae7187

I have found a similar issue, explained by a bug (silent auth failed while uploading the image), correctly in older versions of Glance. see: http://www.gossamer-threads.com/lists/openstack/dev/12854 (http://www.gossamer-threads.com/lists...)

openstack@controller:~$ !dpk
dpkg --list | grep glance
ii  glance                               1:2014.2.2-0ubuntu1~cloud0            all          OpenStack Image Registry and Delivery Service - Daemons
ii  glance-api                           1:2014.2.2-0ubuntu1~cloud0            all          OpenStack Image Registry and Delivery Service - API
ii  glance-common                        1:2014.2.2-0ubuntu1~cloud0            all          OpenStack Image Registry and Delivery Service - Common
ii  glance-registry                      1:2014.2.2-0ubuntu1~cloud0            all          OpenStack Image Registry and Delivery Service - Registry
ii  python-glance                        1:2014.2.2-0ubuntu1~cloud0            all          OpenStack Image Registry and Delivery Service - Python library
ii  python-glance-store                  0.1.8-1ubuntu2~cloud0                 all          OpenStack Image Service store library - Python 2.x
ii  python-glanceclient                  1:0.14.0-0ubuntu1~cloud0              all          Client library for Openstack glance server.

openstack@controller:~$ more glance-openrc.sh 
export OS_TENANT_NAME=service
export OS_USERNAME=glance
export OS_PASSWORD=glancekeypass
export OS_AUTH_URL=http://controller:5000/v2.0


openstack@controller:~$ sudo grep -i swift /etc/glance/glance-api.conf
default_store = swift 

stores = glance.store.swift.Store

swift_store_auth_version = 2

swift_store_auth_address = http://172.26.0.11:35357/v2.0/
swift_store_user = service:glance
swift_store_key = glancekeypass 
swift_store_container = glance
swift_store_create_container_on_put = True 
swift_store_large_object_size = 5120
swift_store_large_object_chunk_size = 200
swift_enable_snet = False

With filesystem as default storage for Glance, image and instance creation are working fine. Any help would ... (more)

edit retag flag offensive close merge delete

Comments

Are you sure you restarted glance-api service? Check if files are not created in /var/lib/glance/images/ anyway (ls -la /var/lib/glance/images/ed2f6bb5-08d6-48c3-ae87-f7971578c936).

rozie gravatar imagerozie ( 2016-02-09 09:26:17 -0500 )edit

I have indeed restarted the glance-api service.The dir /var/lib/glance/images/ does not contains the images created since I have configured swift as storage for glance. Actually, in the above output, you can see the "swift list" command shows Glance have created (or tried to) the images in swift

pirlouit32 gravatar imagepirlouit32 ( 2016-02-09 11:01:11 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-02-12 03:56:19 -0500

pirlouit32 gravatar image

Any clue, someone? Thanks.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2016-02-07 15:16:36 -0500

Seen: 604 times

Last updated: Feb 12 '16