Ask Your Question
0

Using Swift as a Glance backend

asked 2011-04-26 02:07:25 -0600

everett-toews gravatar image

I'm trying to use Swift as a Glance backend but I'm running into errors when I try to add an image with glance add.

root@i-00000c7f:~# glance add --verbose name="ubuntu-10-10-server" is_public="True" < ubuntu-10.10-server-uec-amd64.tar.gz 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: Auth GET failed: https://127.0.0.1:8080/auth/v1.0/ 401 Unauthorized
Completed in 2.0094 sec.

I'm using Glance version: 2011.2-0ubuntu1

My relevant config in glance.conf

default_store = swift swift_store_auth_address = https://127.0.0.1:8080/auth/v1.0/ swift_store_user = root swift_store_key = testpass swift_store_container = glance swift_store_create_container_on_put = True

I'm fairly confident Swift is up and running as it should be since I can do the following.

swauth-prep -A https://127.0.0.1:8080/auth/ -K admin_key swauth-add-user -A https://127.0.0.1:8080/auth/ -K admin_key -a system root testpass

root@i-00000c7f:~# st -A https://127.0.0.1:8080/auth/v1.0/ -U system:root -K testpass -v post glance

root@i-00000c7f:~# st -A https://127.0.0.1:8080/auth/v1.0/ -U system:root -K testpass -v upload glance ubuntu-10.10-server-uec-amd64.tar.gz ubuntu-10.10-server-uec-amd64.tar.gz

root@i-00000c7f:~# st -A https://127.0.0.1:8080/auth/v1.0/ -U system:root -K testpass -v list glance ubuntu-10.10-server-uec-amd64.tar.gz

root@i-00000c7f:~# st -A https://127.0.0.1:8080/auth/v1.0/ -U system:root -K testpass -v delete glance ubuntu-10.10-server-uec-amd64.tar.gz ubuntu-10.10-server-uec-amd64.tar.gz

root@i-00000c7f:~# st -A https://127.0.0.1:8080/auth/v1.0/ -U system:root -K testpass -v list glance

Anyone have any thoughts as to what the problem could be?

Thanks, Everett

edit retag flag offensive close merge delete

10 answers

Sort by » oldest newest most voted
0

answered 2011-04-27 08:46:16 -0600

ethuleau gravatar image

You're welcome.

Do you met problems to delete images in Glance repository with Swift backend ?

I opened a question : https://answers.launchpad.net/glance/+question/154323 (https://answers.launchpad.net/glance/...)

Édouard.

edit flag offensive delete link more
0

answered 2011-04-29 12:26:02 -0600

ethuleau gravatar image

Hi Jay,

I try to remove the 'https://' prefix in 'swift_store_auth_address' option but the bug persists.

Chears, Édouard.

edit flag offensive delete link more
0

answered 2011-04-28 15:52:03 -0600

everett-toews gravatar image

Hi Édouard,

Actually yes, I ran into that problem too. Thanks for posting another question about it. I'm tracking it now too.

Everett

On Wed, Apr 27, 2011 at 2:46 AM, Edouard Thuleau < question154253@answers.launchpad.net > wrote:

Your question #154253 on Glance changed: https://answers.launchpad.net/glance/+question/154253 (https://answers.launchpad.net/glance/...)

Edouard Thuleau posted a new comment: You're welcome.

Do you met problems to delete images in Glance repository with Swift backend ?

I opened a question : https://answers.launchpad.net/glance/+question/154323 (https://answers.launchpad.net/glance/...)

Édouard.


You received this question notification because you are a direct subscriber of the question.

edit flag offensive delete link more
0

answered 2011-04-28 16:11:57 -0600

jaypipes gravatar image

Everett and Edouard,

Hey, we're working on this. In the meantime, the fix would be to remove the https:// prefix from your swift_store_auth_address configuration option..

-jay

edit flag offensive delete link more
0

answered 2011-04-26 15:17:28 -0600

jaypipes gravatar image

Everett,

Barton just found me in the lobby... I haven't been getting any notifications about Glance Questions :( So, sorry about not responding until now.

I will work with a Swift dev to figure out what's going on here. AFAICT, your glance.conf is correct. Though, do you have logging enabled? Getting some log output with debug=True would be good...

-jay

edit flag offensive delete link more
0

answered 2011-04-26 15:50:13 -0600

everett-toews gravatar image

Hi Jay,

I just set debug=True and tried again

root@i-00000c7f:~# glance add --verbose name="ubuntu-10-10-server-glance-add" is_public="True" < ubuntu-10.10-server-uec-amd64.tar.gz

The results are here.

http://pastie.org/1835684

Thanks, Everett

edit flag offensive delete link more
0

answered 2011-04-26 15:55:45 -0600

ethuleau gravatar image

Hi,

The parameter 'swift_store_user' should not be set to 'system:root' instead of 'root' ?

Édouard.

edit flag offensive delete link more
0

answered 2011-04-26 20:26:39 -0600

everett-toews gravatar image

Yep. That was the secret sauce. Now I can see the file saved in Swift.

root@i-00000c7f:~# st -A https://127.0.0.1:8080/auth/v1.0/ -U system:root -K testpass -v list glance 10

To be totally paranoid I double checked that the Glance CLI and Swift st CLI are reporting the same size

root@i-00000c7f:~# st -A https://127.0.0.1:8080/auth/v1.0/ -U system:root -K testpass -v stat glance 10 Account: AUTH_07ee438a-0881-4ae0-91d1-85f9d7e0b29b Container: glance Object: 10 Content Type: application/octet-stream Content Length: 185416400 Last Modified: Tue, 26 Apr 2011 16:45:41 GMT ETag: 29c00454935fd1481496a9fb6c863670

root@i-00000c7f:~# glance show 10 URI: http://0.0.0.0/images/10 Id: 10 Public: Yes Name: ubuntu-10-10-server-glance-add Size: 185416400 Location: swift://system:root:testpass@https://127.0.0.1:8080/auth/v1.0//glance/10 Disk format: raw Container format: ovf

I've reported a bug regarding this issue at https://bugs.launchpad.net/glance/+bug/771465 (https://bugs.launchpad.net/glance/+bu...)

Thanks Édouard.

Everett

edit flag offensive delete link more
0

answered 2011-04-26 20:26:56 -0600

everett-toews gravatar image

Thanks Edouard Thuleau, that solved my question.

edit flag offensive delete link more
0

answered 2011-04-29 16:26:16 -0600

jaypipes gravatar image

Hi Edouard,

For the existing images in the registry database, you will want to execute the following:

UPDATE images SET location = REPLACE(location, "https://", "") WHERE location LIKE 'swift%';

The above should work for MySQL, SQLIte and PostgreSQL registry databases.

The eventual bug fix will include the above as a migration file, FYI...

Cheers, 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-04-26 02:07:25 -0600

Seen: 92 times

Last updated: Apr 29 '11