glance add failed

asked 2011-11-22 12:02:51 -0500

chnzzw gravatar image

help: keystone+glance, glance add failed, who can help me?

linux-rskn:/usr/lib64/python2.6/site-packages/glance-tools # glance add name=chnzzw is_public=true < /opt/ubuntu-11.10-server-cloudimg-amd64-disk1.img glance_endpoint = http://127.0.0.1:9292/v1.1/2 action=/v1.1/2/images headers={'content-length': 225443840, 'x-image-meta-container_format': u'ovf', 'x-image-meta-min_disk': u'0', 'x-auth-token': u'4750b0c1-8279-4b24-8af5-e4e65aae35d3', 'x-image-meta-size': 225443840, 'x-image-meta-is_public': u'True', 'x-image-meta-min_ram': u'0', 'content-type': 'application/octet-stream', 'x-image-meta-disk_format': u'raw', 'x-image-meta-name': u'chnzzw'} Failed to add image. Got error: image Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'. linux-rskn:/usr/lib64/python2.6/site-packages/glance-tools # glance --debug index params={'marker': None, 'sort_key': None, 'limit': 10, 'sort_dir': None} glance_endpoint = http://127.0.0.1:9292/v1.1/2 action=/v1.1/2/images?limit=10 headers={'x-auth-token': u'4750b0c1-8279-4b24-8af5-e4e65aae35d3'} res= Traceback (most recent call last): File "/usr/bin/glance", line 1207, in result = command(options, args) File "/usr/bin/glance", line 60, in wrapper ret = func(*args, kwargs) File "/usr/bin/glance", line 498, in images_index print_header=True) File "/usr/bin/glance", line 444, in _images_index images = client.get_images(parameters) File "/usr/lib64/python2.6/site-packages/glance/client.py", line 56, in get_images data = json.loads(res.read())['images'] KeyError: 'images'

edit retag flag offensive close merge delete

26 answers

Sort by » oldest newest most voted
0

answered 2011-11-22 16:43:45 -0500

jaypipes gravatar image

Would you mind paste-binning your glance-api log contents. Please remove any security credentials from the paste!

Thanks! -jay

edit flag offensive delete link more
0

answered 2011-11-23 04:28:59 -0500

chnzzw gravatar image

1.OK,the glance-api log and glance --debug index result as follow. 2.I fix the bugs of the glance but still have the error.
3.please help me solve the error,thanks all.

2011-11-23 12:24:03 DEBUG [glance-api] ************************* 2011-11-23 12:24:03 DEBUG [glance-api] Configuration options gathered from config file: 2011-11-23 12:24:03 DEBUG [glance-api] /etc/glance/glance-api.conf 2011-11-23 12:24:03 DEBUG [glance-api] ================================================ 2011-11-23 12:24:03 DEBUG [glance-api] bind_host 0.0.0.0 2011-11-23 12:24:03 DEBUG [glance-api] bind_port 9292 2011-11-23 12:24:03 DEBUG [glance-api] debug True 2011-11-23 12:24:03 DEBUG [glance-api] default_store file 2011-11-23 12:24:03 DEBUG [glance-api] delayed_delete False 2011-11-23 12:24:03 DEBUG [glance-api] filesystem_store_datadir /var/lib/glance/images/ 2011-11-23 12:24:03 DEBUG [glance-api] image_cache_datadir /var/lib/glance/image-cache/ 2011-11-23 12:24:03 DEBUG [glance-api] image_cache_enabled False 2011-11-23 12:24:03 DEBUG [glance-api] image_cache_stall_timeout 86400 2011-11-23 12:24:03 DEBUG [glance-api] log_file /var/log/glance/api.log 2011-11-23 12:24:03 DEBUG [glance-api] notifier_strategy noop 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_host localhost 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_notification_topic glance_notifications 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_password guest 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_port 5672 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_use_ssl false 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_userid guest 2011-11-23 12:24:03 DEBUG [glance-api] rabbit_virtual_host / 2011-11-23 12:24:03 DEBUG [glance-api] registry_host 0.0.0.0 2011-11-23 12:24:03 DEBUG [glance-api] registry_port 9191 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_access_key <20-char AWS access key> 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_bucket <lowercased 20-char="" aws="" access="" key="">glance 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_create_bucket_on_put False 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_host 127.0.0.1:8080/v1.0/ 2011-11-23 12:24:03 DEBUG [glance-api] s3_store_secret_key <40-char AWS secret key> 2011-11-23 12:24:03 DEBUG [glance-api] swift_enable_snet False 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_auth_address 127.0.0.1:8080/v1.0/ 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_container glance 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_create_container_on_put False 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_key a86850deb2742ec3cb41518e26aa2d89 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_large_object_chunk_size 200 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_large_object_size 5120 2011-11-23 12:24:03 DEBUG [glance-api] swift_store_user jdoe 2011-11-23 12:24:03 DEBUG [glance-api] use_syslog False 2011-11-23 12:24:03 DEBUG [glance-api] verbose True 2011-11-23 12:24:03 DEBUG [glance-api] ************************* 2011-11-23 12:24:03 DEBUG [routes.middleware] Initialized with method overriding = True, and path info altering = True 2011-11-23 12:24:03 DEBUG [eventlet.wsgi.server] (15053) wsgi starting up on http://0.0.0.0:9292/ 2011-11-23 12:24:26 DEBUG [glance.api.middleware.version_negotiation] Processing request: POST /v1.1/2/images Accept: 2011-11-23 12:24:26 DEBUG [glance.api.middleware.version_negotiation] Unknown version in versioned URI: 1.1. Returning version choices. 2011-11-23 12:24:27 DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [23/Nov/2011 12:24:27] "POST /v1.1/2/images HTTP/1.1" 300 339 0.883178

linux-rskn:/usr/lib64/python2.6/site-packages ... (more)

edit flag offensive delete link more
0

answered 2011-11-23 16:47:00 -0500

jaypipes gravatar image

Hi! You need to update your glance client Python library I believe... which version do you have installed?

edit flag offensive delete link more
0

answered 2011-11-24 03:27:39 -0500

chnzzw gravatar image
  1. glance version: glance-2011.3.tar.gz GLANCE_VERSION = ['2011', '3']

2.keystone: keystone-1.0-py2.6.egg-info

I use the diablo version of the openstack including the nova,glance and the keystone. . I think that the glance is the newest version. what is the reason?

please give the way to solve the error.

Thanks.

edit flag offensive delete link more
0

answered 2011-11-25 17:24:17 -0500

jaypipes gravatar image

The URI that your client is attempting to hit is this:

/v1.1/2/images

That is not a valid Glance images URL. That looks like a Compute API URL (it includes the tenant "2" after a /v1.1/ version identifier.

I have a suspicion that your application pipeline is not set correctly. Could you please pastebin your glance-api.conf and glance-registry.conf please?

Thanks! -jay

edit flag offensive delete link more
0

answered 2011-11-26 08:32:13 -0500

chnzzw gravatar image
  1. I use the keystone, so I modify the glance-api.conf and glance-registry.conf as follows:

glance-api.conf : [DEFAULT]

Show more verbose log output (sets INFO log level output)

verbose = True

Show debugging output in logs (sets DEBUG log level output)

debug = True

Which backend store should Glance use by default is not specified

in a request to add a new image to Glance? Default: 'file'

Available choices are 'file', 'swift', and 's3'

default_store = file

Address to bind the API server

bind_host = 0.0.0.0

Port the bind the API server to

bind_port = 9292

Address to find the registry server

registry_host = 0.0.0.0

Port the registry server is listening on

registry_port = 9191

Log to this file. Make sure you do not set the same log

file for both the API and registry servers!

log_file = /var/log/glance/api.log

Send logs to syslog (/dev/log) instead of to file specified by log_file

use_syslog = False

============ Notification System Options =====================

Notifications can be sent when images are create, updated or deleted.

There are three methods of sending notifications, logging (via the

log_file directive), rabbit (via a rabbitmq queue) or noop (no

notifications sent, the default)

notifier_strategy = noop

Configuration options if sending notifications via rabbitmq (these are

the defaults)

rabbit_host = localhost rabbit_port = 5672 rabbit_use_ssl = false rabbit_userid = guest rabbit_password = guest rabbit_virtual_host = / rabbit_notification_topic = glance_notifications

============ Filesystem Store Options ========================

Directory that the Filesystem backend store

writes image data to

filesystem_store_datadir = /var/lib/glance/images/

============ Swift Store Options =============================

Address where the Swift authentication service lives

swift_store_auth_address = 127.0.0.1:8080/v1.0/

User to authenticate against the Swift authentication service

swift_store_user = jdoe

Auth key for the user authenticating against the

Swift authentication service

swift_store_key = a86850deb2742ec3cb41518e26aa2d89

Container within the account that the account should use

for storing images in Swift

swift_store_container = glance

Do we create the container if it does not exist?

swift_store_create_container_on_put = False

What size, in MB, should Glance start chunking image files

and do a large object manifest in Swift? By default, this is

the maximum object size in Swift, which is 5GB

swift_store_large_object_size = 5120

When doing a large object manifest, what size, in MB, should

Glance write chunks to Swift? This amount of data is written

to a temporary disk buffer during the process of chunking

the image file, and the default is 200MB

swift_store_large_object_chunk_size = 200

Whether to use ServiceNET to communicate with the Swift storage servers.

(If you aren't RACKSPACE, leave this False!)

#

To use ServiceNET for authentication, prefix hostname of

swift_store_auth_address with 'snet-'.

Ex. https://example.com/v1.0/ -> https://snet-example.com/v1.0/

swift_enable_snet = False

============ S3 Store Options =============================

Address where the S3 authentication service lives

s3_store_host = 127.0.0.1:8080/v1.0/

User to authenticate against the S3 authentication service

s3_store_access_key = <20-char AWS access key>

Auth key for the user authenticating against the

S3 authentication service

s3_store_secret_key = <40-char AWS secret key>

Container within the account that the account should use

for storing images in S3. Note that S3 has a flat namespace,

so you need a unique bucket name ...

(more)
edit flag offensive delete link more
0

answered 2011-11-26 08:33:53 -0500

chnzzw gravatar image

linux-iop5:~ # keystone-manage user list

id enabled tenant

1 1 None 2 1 None linux-iop5:~ # keystone-manage role list

id name

1 Admin 2 Member 3 KeystoneAdmin 4 KeystoneServiceAdmin linux-iop5:~ # keystone-manage tenant list

id name enabled

1 admin 1 2 demo 1 linux-iop5:~ # keystone-manage service list

id name type

1 nova compute 2 glance image 3 keystone identity linux-iop5:~ # keystone-manage endpointTemplates list All EndpointTemplates

service region Public URL

nova RegionOne http://127.0.0.1:8774/v1.1/%25tenant_id%25 (http://127.0.0.1:8774/v1.1/%tenant_id%) glance RegionOne http://127.0.0.1:9292/v1.1/%25tenant_id%25 (http://127.0.0.1:9292/v1.1/%tenant_id%) keystone RegionOne http://127.0.0.1:5000/v2.0 linux-iop5:~ #

edit flag offensive delete link more
0

answered 2011-11-26 08:48:11 -0500

chnzzw gravatar image

sqlite> select * from endpoint_templates; 1|RegionOne|1|http://127.0.0.1:8774/v1.1/%tenant_id%|http://127.0.0.1:8774/v1.1/%tenant_id%|http://127.0.0.1:8774/v1.1/%tenant_id%|1|1 2|RegionOne|2|http://127.0.0.1:9292/v1.1/%tenant_id%|http://127.0.0.1:9292/v1.1/%tenant_id%|http://127.0.0.1:9292/v1.1/%tenant_id%|1|1 3|RegionOne|3|http://127.0.0.1:5000/v2.0|http://127.0.0.1:35357/v2.0|http://127.0.0.1:5000/v2.0|1|1

edit flag offensive delete link more
0

answered 2011-11-26 09:03:13 -0500

chnzzw gravatar image

sqlite> .table credentials roles token endpoint_templates services user_roles endpoints tenants users sqlite> select * from credentials; 1|1|1|EC2|admin|openstack 2|2|2|EC2|demo|openstack sqlite> select * from roles; 1|Admin|| 2|Member|| 3|KeystoneAdmin|| 4|KeystoneServiceAdmin|| sqlite> select * from token; 999888777666|1|1|2015-02-05 00:00:00.000000 8b623dc5-343d-4414-9b77-5e89e63bb4c4|1||2011-11-27 10:08:24.166254 7758bee8-5354-4f1d-877f-28d784d2dfb5|1|2|2011-11-27 12:29:46.543959 sqlite> select * from endpoint_templates; 1|RegionOne|1|http://127.0.0.1:8774/v1.1/%tenant_id%|http://127.0.0.1:8774/v1.1/ %tenant_id%|http://127.0.0.1:8774/v1.1/%tenant_id%|1|1 2|RegionOne|2|http://127.0.0.1:9292/v1.1/%tenant_id%|http://127.0.0.1:9292/v1.1/ %tenant_id%|http://127.0.0.1:9292/v1.1/%tenant_id%|1|1 3|RegionOne|3|http://127.0.0.1:5000/v2.0|http://127.0.0.1:35357/v2.0|http://127. 0.0.1:5000/v2.0|1|1 sqlite> select * from services; 1|nova|compute|Nova Compute Service 2|glance|image|Glance Image Service 3|keystone|identity|Keystone Identity Service sqlite> select * from user_roles; 1|1|1|1 2|2|2|2 3|1|1|2 4|1|1| 5|1|3| 6|1|4| sqlite> select * from endpoints; sqlite> select * from tenants; 1|admin||1 2|demo||1 sqlite> select * from users; 1|admin|$6$rounds=40000$6YHUpERc8O1PcOb1$CrWoGumpt9P6JDiJs12SRkaldxWFBuldqu4rss2 /25YQfG0qDG2yX3rFTDEJVjWX3ap6aXPLlDHDDMZG4meFj.||1| 2|demo|$6$rounds=40000$jaI4J/RNEVZvPtyW$vAaT4sUp418JJXd.dhhAJeG/dQqdQHKcYETY3OO6 E.UAAmR.IaCVySRaIwpUerMasqT/p7tk5xHtjYNqBHDpe.||1| sqlite>

edit flag offensive delete link more
0

answered 2011-11-28 16:30:29 -0500

I suspect your problem is the %tenant_id% in your glance endpoint template. Try updating the template to remove that. (It should be there for nova, but not for glance.)

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-11-22 12:02:51 -0500

Seen: 696 times

Last updated: Dec 21 '11