Ask Your Question
0

Glance does not see images when use api v1

asked 2015-11-03 00:57:45 -0500

Aidaho gravatar image

updated 2015-11-04 22:48:45 -0500

Hi! I have problem with Glance when I'm using api v1. Example:

glance -v --os-image-api-version 1 image-list

> +----+------+-------------+------------------+------+--------+ | ID | Name | Disk Format | Container
> Format | Size | Status |
> +----+------+-------------+------------------+------+--------+
> +----+------+-------------+------------------+------+--------+

Or just: glance image-list

+----+------+-------------+------------------+------+--------+ | ID | Name | Disk Format | Container Format | Size | Status |
+----+------+-------------+------------------+------+--------+
+----+------+-------------+------------------+------+--------+

But, when i use: glance -v --os-image-api-version 2 image-list or nova image-list I see:

+--------------------------------------+-------------+
| ID | Name |
+--------------------------------------+-------------+
| 0d10cf8d-e254-4bb1-8fb5-9ff9e10df1ff | 123 |
| f9904cec-98d0-4350-bbc8-3e51d2a1fdb2 | 213 |

And in dashbord in "Project" I not see my images, in "Admin" panel images have.

What problem mb? Please help me :).

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-11-05 05:17:48 -0500

Aidaho gravatar image

updated 2015-11-05 05:19:21 -0500

For glance i have 1 endpoint:

keystone endpoint-list

/usr/lib/python2.7/site-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
  'python-keystoneclient.', DeprecationWarning)
+----------------------------------+-----------+-------------------------------------------------+-------------------------------------------------+--------------------------------------------+----------------------------------+
|                id                |   region  |                    publicurl                    |                   internalurl                   |                  adminurl                  |            service_id            |
+----------------------------------+-----------+-------------------------------------------------+-------------------------------------------------+--------------------------------------------+----------------------------------+
| 32ef7d81873d449a9aedc141a639a48e | RegionOne |    http://172.28.83.182:8776/v1/$(tenant_id)s   |    http://172.28.83.182:8776/v1/$(tenant_id)s   | http://172.28.83.182:8776/v1/$(tenant_id)s | 8633fe5427e345e0bbca45112a2ac4e9 |
| 57f990a1ec5d43a5be772de33c50a475 | RegionOne |          http://172.28.83.182:5000/v2.0         |          http://172.28.83.182:5000/v2.0         |      http://172.28.83.182:35357/v2.0       | 2028bdc15ddc495eb9b6193d239e5aa1 |
| 6e99e60bda2145718df7756c339cfec3 | RegionOne |    http://172.28.83.182:8776/v2/$(tenant_id)s   |    http://172.28.83.182:8776/v2/$(tenant_id)s   | http://172.28.83.182:8776/v2/$(tenant_id)s | 8fa310440a2f4a8cbb450b0dc47ea938 |
| 81e165ef2fa849d68c6dfd4c7cc5790f | RegionOne |    http://172.28.83.182:8774/v2/$(tenant_id)s   |    http://172.28.83.182:8774/v2/$(tenant_id)s   | http://172.28.83.182:8774/v2/$(tenant_id)s | 6e1b0c849a5a45868dbc24bb6c545342 |
| 84edb48cd8814e87a09a7bc8122e6ff4 | RegionOne |            http://172.28.83.182:9696/           |            http://172.28.83.182:9696/           |         http://172.28.83.182:9696/         | 7c77fc2acdb94365b515bb128cd32a11 |
| a1ecc0899b89441cb470836d661e6836 | RegionOne |            http://172.28.83.182:9292            |            http://172.28.83.182:9292            |         http://172.28.83.182:9292          | 2d2d6e6484784b2fb9d6ba2152085810 |
| b91bd621d610450698b434d8aabd2251 | RegionOne |    http://172.28.83.182:8004/v1/%(tenant_id)s   |    http://172.28.83.182:8004/v1/%(tenant_id)s   | http://172.28.83.182:8004/v1/%(tenant_id)s | dee41ff8d2804c8795b9cf8ad40f0888 |
| b95a9ce32fc54efd86338f3a5260aab5 | RegionOne | http://172.28.83.182:8080/v1/AUTH_%(tenant_id)s | http://172.28.83.182:8080/v1/AUTH_%(tenant_id)s |         http://172.28.83.182:8080          | c949520500f34c02875d4e8469527f72 |
| bab695d57ce04691873dff4cdeda580e | RegionOne |            http://controller:8000/v1            |            http://controller:8000/v1            |         http://controller:8000/v1          | 5370af3847af4508a5ac9d59229cf2d4 |
+----------------------------------+-----------+-------------------------------------------------+-------------------------------------------------+--------------------------------------------+----------------------------------+

This output from debug:

glance --debug image-list

curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}bad12623bcb06ab72499160d77a4639ddafeb02a' -H 'Content-Type: application/octet-stream' http://172.28.83.182:9292/v1/images/detail?sort_key=name&sort_dir=asc&limit=20

HTTP/1.1 200 OK
date: Thu, 05 Nov 2015 11:14:43 GMT
content-length: 14
content-type: application/json; charset=UTF-8
x-openstack-request-id: req-req-762243f5-e130-4ac9-ab5f-24e87b0713de

{"images": []}

+----+------+-------------+------------------+------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+----+------+-------------+------------------+------+--------+
+----+------+-------------+------------------+------+--------+

# glance --debug --os-image-api-version 2 image-list
curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}f8d18dccc39d6bdabe430020c39af46f40601e5d' -H 'Content-Type: application/octet-stream' http://172.28.83.182:9292/v2/schemas/image

HTTP/1.1 200 OK
date: Thu, 05 Nov 2015 11:15:16 GMT
content-length: 3867
content-type: application/json; charset=UTF-8
x-openstack-request-id: req-req-7eeb3722-2702-4cb4-9ac7-3b21d013a59a

{"additionalProperties": {"type": "string"}, "name": "image", "links": [{"href": "{self}", "rel": "self"}, {"href": "{file}", "rel": "enclosure"}, {"href": "{schema}", "rel": "describedby"}], "properties": {"status": {"enum": ["queued", "saving", "active", "killed", "deleted", "pending_delete"], "type": "string", "description": "Status of the image (READ-ONLY)"}, "tags": {"items": {"type": "string", "maxLength": 255}, "type": "array", "description": "List of strings related to the image"}, "kernel_id": {"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", "type": "string", "description": "ID of image stored in Glance that should be used as the kernel when booting an AMI-style image ...
(more)
edit flag offensive delete link more

Comments

as you can see you have 2 different endpoints for every api version /v1 and /v2 . You can disable v1 api for glance in glance-api.conf or add to openrc.sh file this line export OS_IMAGE_API_VERSION=2 so when you call a glance image-list it will use v2 api by default!

capsali gravatar imagecapsali ( 2015-11-05 08:52:33 -0500 )edit

Thx, from CLI i now see images, but in dashbord stell not

Aidaho gravatar imageAidaho ( 2015-11-18 01:17:10 -0500 )edit
0

answered 2015-11-05 04:53:03 -0500

capsali gravatar image

Because v1 and v2 api have different endpoints. I don't think they are backward compatible.

So when you upload an image in glance v2, the endpoint is something la http://host:9292/v2/images. So when you make a GET request on api v2 to list images it will look in the same url.

But if you want to list images with v1 API it will look for images in http://host:9292/v1/images. Being a different API, the images won't be present at that endpoint.

There are no advantages for using v1 API.

You can try issuing those 2 commands in OP with --debug option to see exactly what request are made on what endpoints!

edit flag offensive delete link more

Comments

Well, if different for different versions of endpoint api, why do I only see images of the second version and I do not see in dashboards? Output -commands with --debug above.

Aidaho gravatar imageAidaho ( 2015-11-05 05:18:04 -0500 )edit

you must have v1 api set in dashboard settings. Modify local_settings.py to mach v2 api for glance!

capsali gravatar imagecapsali ( 2015-11-05 08:54:52 -0500 )edit

The config file is already corrected, but did not help:

OPENSTACK_API_VERSIONS = {
#    "data-processing": 1.1,
#    "identity": 3,
#    "volume": 2,
     "image": 2,
}

But it did not help in dashboards still no images

Aidaho gravatar imageAidaho ( 2015-11-05 20:28:05 -0500 )edit

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: 2015-11-03 00:57:45 -0500

Seen: 990 times

Last updated: Nov 05 '15