Glance index/image-list returns no results

Asked by Syed Ali

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 _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/images/818d1c8b-9ed5-4cc0-a577-b1084f7fd0cc | 2013-03-04 06:41:52 | 2013-03-04 06:52:02 | 2013-03-04 06:52:02 | 1 | ari | ari | 644cf7d6d9e7b41d527e30e8e8c685a4 | NULL | 0 | 0 | 0 |
| c5c9a367-2e27-4cfe-81cc-dd63afc050d6 | tty-linux | 25165824 | active | 0 | file:///var/lib/glance/images/c5c9a367-2e27-4cfe-81cc-dd63afc050d6 | 2013-03-04 06:58:10 | 2013-03-04 06:58:11 | NULL | 0 | ami | ami | 10047a119149e08fb206eea89832eee0 | NULL | 0 | 0 | 0 |
| cfb26019-33b7-4906-883a-ddc466d0b4d2 | tty-linux-ramdiskl | 96629 | deleted | 0 | file:///var/lib/glance/images/cfb26019-33b7-4906-883a-ddc466d0b4d2 | 2013-03-04 06:41:24 | 2013-03-04 06:44:38 | 2013-03-04 06:44:38 | 1 | ari | ari | 644cf7d6d9e7b41d527e30e8e8c685a4 | NULL | 0 | 0 | 0 |
| d0e0450d-01fb-48ce-ad74-353475507cbd | tty-linux-kernel | 4404752 | deleted | 0 | file:///var/lib/glance/images/d0e0450d-01fb-48ce-ad74-353475507cbd | 2013-03-04 06:23:39 | 2013-03-04 06:52:12 | 2013-03-04 06:52:12 | 1 | aki | aki | 3ed2965d3f8d877a3ee3e061fd648e9a | NULL | 0 | 0 | 0 |
+--------------------------------------+--------------------+----------+---------+-----------+--------------------------------------------------------------------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+-------+----------+---------+-----------+
6 rows in set (0.00 sec)

Initially I had created 3 images without the --is-public IS_PUBLIC, and then I deleted the 3. I created 3 news ones with --is-public IS_PUBLIC.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Syed Ali
Solved:
Last query:
Last reply:
Revision history for this message
Brian Waldon (bcwaldon) said :
#1

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.

Revision history for this message
Syed Ali (syedaali) said :
#2

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.