Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

glance does not work when working with swift

My swift server is working well, and also glance server also works well when using file "default_store = file", but when I change to "default_store = swift", "glance add" will not work, can any of you help check why?

Thanks in advance!

root@glance-node:/tmp# glance add name="swift2" is_public=true < /tmp/test.iso Failed to add image. Got error: 400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

Error uploading image: global name 'swift_client' is not defined
Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'. root@glance-node:/tmp# cat /etc/glance/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 = False

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 = swift

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

============ 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 = 172.17.1.125:443/v1.0/

User to authenticate against the Swift authentication service

swift_store_user = tester

Auth key for the user authenticating against the

Swift authentication service

swift_store_key = tk361dc384f1214cae898e8271109dad3f

Container within the account that the account should use

for storing images in Swift

swift_store_container = CONTAINER

Do we create the container if it does not exist?

swift_store_create_container_on_put = True

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 for your glance images. An

easy way to do this is append your AWS access key to "glance".

S3 buckets in AWS must be lowercased, so remember to lowercase

your AWS access key if you use it in your bucket name below!

s3_store_bucket = <lowercased 20-char="" aws="" access="" key="">glance

Do we create the bucket if it does not exist?

s3_store_create_bucket_on_put = False

============ Image Cache Options ========================

image_cache_enabled = False

Directory that the Image Cache writes data to

Make sure this is also set in glance-pruner.conf

image_cache_datadir = /var/lib/glance/image-cache/

Number of seconds after which we should consider an incomplete image to be

stalled and eligible for reaping

image_cache_stall_timeout = 86400

============ Delayed Delete Options =============================

Turn on/off delayed delete

delayed_delete = False

[pipeline:glance-api] pipeline = versionnegotiation context apiv1app

To enable Image Cache Management API replace pipeline with below:

pipeline = versionnegotiation imagecache apiv1app

[pipeline:versions] pipeline = versionsapp

[app:versionsapp] paste.app_factory = glance.api.versions:app_factory

[app:apiv1app] paste.app_factory = glance.api.v1:app_factory

[filter:versionnegotiation] paste.filter_factory = glance.api.middleware.version_negotiation:filter_factory

[filter:imagecache] paste.filter_factory = glance.api.middleware.image_cache:filter_factory

[filter:context] paste.filter_factory = glance.common.context:filter_factory root@glance-node:/tmp#