Ask Your Question
0

glance does not work when working with swift

asked 2011-08-09 15:36:16 -0500

gyliu gravatar image

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 ...

(more)
edit retag flag offensive close merge delete

13 answers

Sort by ยป oldest newest most voted
0

answered 2011-08-16 01:29:32 -0500

gyliu gravatar image

Thanks Everett for the comments, the problem have been resolved with the help of Jay ;-)

What I need do is install python-swift on my Glance Box.

edit flag offensive delete link more
0

answered 2011-08-15 20:54:39 -0500

everett-toews gravatar image

Perhaps you're running into this bug?

https://bugs.launchpad.net/glance/+bug/771849 (https://bugs.launchpad.net/glance/+bu...)

Everett

On Wed, Aug 10, 2011 at 3:06 AM, Guangya Liu < question167442@answers.launchpad.net > wrote:

Question #167442 on OpenStack Object Storage (swift) changed: https://answers.launchpad.net/swift/+question/167442 (https://answers.launchpad.net/swift/+...)

Guangya Liu gave more information on the question: Even if I set "swift_store_auth_address = https://172.17.1.125:443/auth/v1.0/%22 (https://172.17.1.125:443/auth/v1.0/") still does not work.


You received this question notification because you are an answer contact for OpenStack Object Storage (swift).

edit flag offensive delete link more
0

answered 2011-08-10 15:05:55 -0500

jaypipes gravatar image

Glad to hear you are all set! Don't hesitate to get in touch with us if you have any further questions or issues.

Cheers! jay

edit flag offensive delete link more
0

answered 2011-08-10 14:21:40 -0500

gyliu gravatar image

Thanaks Jay, after re-install a ubuntu OS and re-install glance, it works well with swift.

You are right, we need to install python-swift in Glance box to make this works.

Thanks for your great help!

root@glance-node2:~# glance show 2 URI: http://0.0.0.0/images/2 Id: 2 Public: Yes Name: swift1 Status: active Size: 0 Location: swift+https://test:tester:testing@172.17.1.125:443/auth/v1.0//glance/2 Disk format: raw Container format: ovf

edit flag offensive delete link more
0

answered 2011-08-10 13:07:44 -0500

gyliu gravatar image

Thanks Jay for the quick response ;-), the following are my ubuntu version. Any comments?

root@glance-node:~/test# cat /etc/*release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS" root@glance-node:~/test# apt-get install python-swift Reading package lists... Done Building dependency tree
Reading state information... Done E: Couldn't find package python-swift root@glance-node:~/test#

edit flag offensive delete link more
0

answered 2011-08-10 13:00:52 -0500

jaypipes gravatar image

jpipes@serialcoder:~/repos/glance$ dpkg -l | grep "swift" ii python-swift 1.3.0-0ubuntu1 A distributed virtual object store (python libraries) ii swift 1.3.0-0ubuntu1 A distributed virtual object store (common files)

What version of Debian or Ubuntu are you on?

-jay

edit flag offensive delete link more
0

answered 2011-08-10 12:32:31 -0500

gyliu gravatar image

Thanks Jay, may I ask how can I install python-swift?

I try the command "apt-get install python-swift", but failed.

Thanks.

edit flag offensive delete link more
0

answered 2011-08-10 11:48:09 -0500

jaypipes gravatar image

Hi! I think you may need to install python-swift on the Glance box :)

2011-08-10 16:45:34 ERROR [glance.api.v1.images] Error uploading image: global name 'swift_client' is not defined

means that there was an import error. I'll file a bug about the message not being clear...

Cheers! jay

edit flag offensive delete link more
0

answered 2011-08-10 02:17:58 -0500

  • Before you add new image by Glance, you should use Curl to check the operation in Swift Proxy Server. Check your Swift Store User and Pass in proxy-server.conf

  • I think you should consider about the link of swift_store_auth_address = 172.17.1.125:443/v1.0/ check http://172.17.1.125:443/auth/v1.0/ for your result

hope this help!

Dzung Vu Anh

edit flag offensive delete link more
0

answered 2011-08-10 09:04:39 -0500

gyliu gravatar image

Even if I set "swift_store_auth_address = https://172.17.1.125:443/auth/v1.0/%22 (https://172.17.1.125:443/auth/v1.0/") still does not work.

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-08-09 15:36:16 -0500

Seen: 276 times

Last updated: Aug 16 '11