Ask Your Question
0

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-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-12-10 19:55:08 -0500

jaypipes gravatar image

Hi! You need to have --host=192.168.106.191 before your redirect....

edit flag offensive delete link more
0

answered 2011-11-29 16:17:51 -0500

Again, the problem is likely that you have "%tenant_id%" in the URLs you're adding to the endpointTemplate for glance. You should omit "%tenant_id%" from the URLs when adding the endpointTemplate for glance.

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
0

answered 2011-11-29 13:24:01 -0500

chnzzw gravatar image

I delete the date from the table endpoint_templates.

excute this command: keystone-manage $* endpointTemplates add RegionOne glance http://127.0.0.1:9292/v1.1/%25tenant_id%25 (http://127.0.0.1:9292/v1.1/%tenant_id%) http://127.0.0.1:9292/v1.1/%25tenant_id%25 (http://127.0.0.1:9292/v1.1/%tenant_id%) http://127.0.0.1:9292/v1.1/%25tenant_id%25 (http://127.0.0.1:9292/v1.1/%tenant_id%) 1 1

But can resolve the problem.

please tell me how to update or removed. which files or tables must be updated or removed.

thanks a lot.

edit flag offensive delete link more
0

answered 2011-11-30 05:30:31 -0500

chnzzw gravatar image

I find the problem: Add -A $TOKEN to the glance add command, excute success.

glance -A $TOKEN add name=haha is_public=true < /opt/natty-server-cloudimg-amd64-disk1.img

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-12-10 22:30:41 -0500

jaypipes gravatar image

Very odd... I'm a little stumped on this one. Usually this happens when there is an old Glance client lib installed. Let me do some investigating and I will get back to you.

edit flag offensive delete link more
0

answered 2011-12-14 16:51:38 -0500

jaypipes gravatar image

Hi Mikyung!

I'm going to add this as a bug report and try to get a repeatable test case together. I have a suspicion that it is the endpoint template for the image service that Keystone is returning that is the culprit here.

I'll update you when I have more information.

Thanks! -jay

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: 2011-11-22 12:02:51 -0500

Seen: 555 times

Last updated: Dec 21 '11