Ask Your Question
0

Glance index/image-list returns no results

asked 2013-03-05 08:00:32 -0600

syedaali gravatar image

Hi,

glance index & glance image-list are not returning any results. This is a new setup and below is the output of the commands:

-bash-4.1$ glance -d index ID Name Disk Format Container Format Size


curl -i -X GET -H 'X-Auth-Token: 915f00c49141411e8baa25d738df696e' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://myhost.com om:9292/v1/images/detail?limit=10

HTTP/1.1 200 OK date: Tue, 05 Mar 2013 07:43:11 GMT content-length: 14 content-type: application/json; charset=UTF-8 x-openstack-request-id: req-43326997-8c9a-489a-9d56-8985e21ba111

{"images": []}

Same problem with glance image-list:

-bash-4.1$ glance -d image-list curl -i -X GET -H 'X-Auth-Token: 1ea130a6f46242c98f59094c93c89824' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://XX:9292/v1/images/detail?limit=20

HTTP/1.1 200 OK date: Tue, 05 Mar 2013 07:56:36 GMT content-length: 14 content-type: application/json; charset=UTF-8 x-openstack-request-id: req-10f45c23-9b89-436f-88d7-87bfd576a72d

{"images": []}

On the Glance server, api.log shows the following when the request is received:

2013-03-05 07:43:11 15461 DEBUG glance.api.middleware.version_negotiation [-] Determining version of request: GET /v1/images/detail Accept: process_request /usr/lib/python2.6/site-packages/glance/api/middleware/version_negotiation.py:45 2013-03-05 07:43:11 15461 DEBUG glance.api.middleware.version_negotiation [-] Using url versioning process_request /usr/lib/python2.6/site-packages/glance/api/middleware/version_negotiation.py:58 2013-03-05 07:43:11 15461 DEBUG glance.api.middleware.version_negotiation [-] Matched version: v1 process_request /usr/lib/python2.6/site-packages/glance/api/middleware/version_negotiation.py:70 2013-03-05 07:43:11 15461 DEBUG glance.api.middleware.version_negotiation [-] new uri /v1/images/detail process_request /usr/lib/python2.6/site-packages/glance/api/middleware/version_negotiation.py:71 2013-03-05 07:43:11 DEBUG glance.api.policy [43326997-8c9a-489a-9d56-8985e21ba111 6539a4da5ba24453a252aa6d3d727f3a c1c6abaed2d84b3992df9a032d324c42] Loaded policy rules: {u'default': [], u'manage_image_cache': [[u'role:admin']]} load_rules /usr/lib/python2.6/site-packages/glance/api/policy.py:63 2013-03-05 07:43:11 DEBUG glance.common.client [43326997-8c9a-489a-9d56-8985e21ba111 6539a4da5ba24453a252aa6d3d727f3a c1c6abaed2d84b3992df9a032d324c42] Constructed URL: http://0.0.0.0:9191/images/detail?limit=10 (http://0.0.0.0:9191/images/detail?lim...) _construct_url /usr/lib/python2.6/site-packages/glance/common/client.py:464 2013-03-05 07:43:11 DEBUG glance.registry.client [43326997-8c9a-489a-9d56-8985e21ba111 6539a4da5ba24453a252aa6d3d727f3a c1c6abaed2d84b3992df9a032d324c42] Registry request GET /images/detail HTTP 200 request id req-7bb88841-2602-4c80-bd14-6fd1ea718cd7 do_request /usr/lib/python2.6/site-packages/glance/registry/client.py:94

I have my env variables set as:

OS_TENANT_ID=c1c6abaed2d84b3992df9a032d324c42 OS_PASSWORD=XX OS_AUTH_URL=http://XX:5000/v2.0/ OS_USERNAME=admin

I can see the images in the image dir:

-bash-4.1$ sudo ls /var/lib/glance/images 3c73311b-7401-440f-a768-6cd2440a0f7b 54f93bc9-703c-4104-9ecb-8c6572423f79 c5c9a367-2e27-4cfe-81cc-dd63afc050d6

Also, I see them in the database:

mysql> select * from images; +--------------------------------------+--------------------+----------+---------+-----------+--------------------------------------------------------------------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+-------+----------+---------+-----------+ | id | name | size | status | is_public | location | created_at | updated_at | deleted_at | deleted | disk_format | container_format | checksum | owner | min_disk | min_ram | protected | +--------------------------------------+--------------------+----------+---------+-----------+--------------------------------------------------------------------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+-------+----------+---------+-----------+ | 3c73311b-7401-440f-a768-6cd2440a0f7b | tty-linux-kernel | 4404752 | active | 0 | file:///var/lib/glance/images/3c73311b-7401-440f-a768-6cd2440a0f7b | 2013-03-04 06:53:47 | 2013-03-04 06:53:47 | NULL | 0 | aki | aki | 3ed2965d3f8d877a3ee3e061fd648e9a | NULL | 0 | 0 | 0 | | 54f93bc9-703c-4104-9ecb-8c6572423f79 | tty-linux-ramdisk | 96629 | active | 0 | file:///var/lib/glance/images/54f93bc9-703c-4104-9ecb-8c6572423f79 | 2013-03-04 06:54:45 | 2013-03-04 06:54:45 | NULL | 0 | ari | ari | 644cf7d6d9e7b41d527e30e8e8c685a4 | NULL | 0 | 0 | 0 | | 818d1c8b-9ed5-4cc0-a577-b1084f7fd0cc | tty-linux-ramdisk | 96629 | deleted | 0 | file:///var/lib/glance ...

(more)
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-03-05 14:55:44 -0600

Did you create the images with the value 'IS_PUBLIC' for the --is-public flag? If so, you should try again with 'True', as --is-public is a boolean field.

edit flag offensive delete link more
0

answered 2013-03-05 18:10:50 -0600

syedaali gravatar image

I figured out the problem, I was using --is-public IS_PUBLIC where upload the imaging, this however did not make the image public, I had to change the image attributes as follows: glance image-update c5c9a367-2e27-4cfe-81cc-dd63afc050d6 --is-public=true. I can now view the images when I run glance index.

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

1 follower

Stats

Asked: 2013-03-05 08:00:32 -0600

Seen: 122 times

Last updated: Mar 05 '13