Ask Your Question
3

Swift and Keystone not playing well together [closed]

asked 2013-09-24 09:02:59 -0500

OldParrothead gravatar image

updated 2013-09-27 18:02:50 -0500

smaffulli gravatar image

I have been reading other posts, and feel good that I am not the only person having issues. Also glad to have plenty of suggestions to try. Sad that none have worked so far.

I am in a testbed environment to date, and this is my last piece before buttoning up. We have the following environment working:

  • Server 1 - Controller with Keystone, Quantum (OVS), Glance, nova (non-compute) services, Cinder, and Horizon
    • IP Address - 192.168.1.222
  • Servers 2,3 - nova compute, Quantum (OVS) client services
    • IP Address - 192.168.1.221,225
  • Server 4 - Standalone Cinder Node
    • IP Address - 192.168.1.220
  • Server 5 - Swift Node - including swift-proxy, account, container, and object servers
    • IP Address - 192.168.1.217

When we run the following command, we wait a VERY long time, and nothing happens after I get a reponse from keystone listing all services and their endpoints:

 swift --debug -v -V 2 -A http://192.168.1.222:5000/v2.0 -U services:swift -K swift_pass stat

I tried this with a slight variation:

 swift --debug -v -V 2 -A http://192.168.1.222:5000/v2.0 -U services:swift -K swift_pass -q stat

and get the same result. Now, since I was not sure of these results, but now I definitely I am corresponding with keystone, I figured I would try some other stuff (based on my readings on this board)

SO, I decided to try the curl commands directly, and use the following:

root@amrwobl217:/etc/swift# curl -k -v -H 'X-Storage-User: services:swift' -H 'X-Storage-Pass: swift_pass' http://192.168.1.222:5000/v2.0
* About to connect() to 192.168.1.222 port 5000 (#0)
*   Trying 192.168.1.222... connected
> GET /v2.0 HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: 192.168.1.222:5000
> Accept: */*
> X-Storage-User: services:swift
> X-Storage-Pass: swift_pass
>
< HTTP/1.1 200 OK
< Vary: X-Auth-Token
< Content-Type: application/json
< Content-Length: 612
< Date: Tue, 24 Sep 2013 13:17:24 GMT
<
* Connection #0 to host 192.168.1.222 left intact
* Closing connection #0
{"version": {"status": "stable", "updated": "2013-03-06T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}, {"base": "application/xml", "type": "application/vnd.openstack.identity-v2.0+xml"}], "id": "v2.0", "links": [{"href": "http://localhost:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/", "type": "text/html", "rel": "describedby"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf", "type": "application/pdf", "rel": "describedby"}]}}

As you can see, I make the connection fine, but...the token and URLs are not coming back properly. Looking through logs, I see nothing that sparks any interest. When I set keystone to debug level, I simply get the call from swift. I have pasted that here: http://paste.openstack.org/show/47424/

Any help would be appreciated, thanks to all who have ... (more)

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by koolhead17
close date 2013-11-19 19:49:01.059849

Comments

thaks for all the details. It's not clear to me what the error really is: can you be more specific? I've read your post but can't understand exactly what the problem is? Just a slowness issue? How "slow" are we talking about?

smaffulli gravatar imagesmaffulli ( 2013-09-27 18:04:26 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-11-14 07:47:51 -0500

OldParrothead gravatar image

Due to other issues, I have rebuilt everything and started from scratch. Once everything was rebuilt, I noticed that Swift has been working. Haven't got a clue why, have been comparing notes and answers and it appears that the only difference is that when I built the service the first time, the Region was set AFTER the original build. This time, I remembered to put it in the first time.

If someone who can close this, would please close this, I would appreciate it, as for whatever reason, things are working for now....

Thanks, all

edit flag offensive delete link more
3

answered 2013-09-29 11:29:52 -0500

rahmu gravatar image

updated 2013-09-29 14:55:11 -0500

Thank you for including all these details. It's a good reflex to have.

The curl command

You're sending a v1 formatted query to Keystone. That's not going to work. The Keystone API is different. You need to POST a JSON to the endpoint and it will return a JSON you'll need to parse to extract the token.

In your case, here's the request you want to try:

$  curl -s -d '{"auth": {"tenantName": "services", "passwordCredentials": {"username": "swift", "password": "swift_pass"}}}' -H 'Content-type: application/json' http://192.168.1.122:5000/v2.0/tokens

If you want to retrieve the token in a variable easily, you can use the Python json module to parse the response body and retrieve the token using this trick:

$  token=$(curl -s -d '{"auth": {"tenantName": "services", "passwordCredentials": {"username": "swift", "password": "swift_pass"}}}' -H 'Content-type: application/json' http://192.168.1.122:5000/v2.0/tokens | python -c 'import json,sys;print json.load(sys.stdin)["access"]["token"]["id"]')

Swift client

Can you try these command line options?

  • --os-auth-url: the address of Keystone + v2.0. In your case: http://192.168.1.222:5000/v2.0.
  • --os-username: the username, in your case swift.
  • --os-password: the password, in your case swift_pass.
  • --os-tenant-name: the name of the tenant, in your case services.

So your command becomes:

$ swift --debug --os-auth-url=http://192.168.1.222:5000/v2.0 --os-username=swift --os-password=swift_pass --os-tenant-name=services stat

Env variables

These options can be a pain to repeat for each subsequent command you run. You can solve this issue by holding these values in environment variables. Write the following file:

$ cat swiftrc
export OS_AUTH_URL=http://192.168.1.222:5000/v2.0
export OS_USERNAME=swift
export OS_PASSWORD=swift_pass
export OS_TENANT_NAME=services

Then running any command becomes easy:

$ . swiftrc     # you can replace `.` by `source`
$ swift stat
...
$ swift list
...
edit flag offensive delete link more

Comments

I rebuilt my node, duplicating everything. When completed, I went through all of the above, and now I get an error "Endpoint for object-store not found: Have you specified a region?" Regions all seem to be in place? Any ideas?

OldParrothead gravatar imageOldParrothead ( 2013-10-01 09:53:21 -0500 )edit

Doing dbl node now, as single node not working. With stat, I get nothing. Proxy config is here http://paste.openstack.org/show/47795/ User info is here http://paste.openstack.org/show/47796/ command results from above http://paste.openstack.org/show/47797/

OldParrothead gravatar imageOldParrothead ( 2013-10-01 16:28:33 -0500 )edit

I'm able to setup the keystone and swift on ubuntu. Do let me know if you need any help. -Dheerendra

dheeru gravatar imagedheeru ( 2013-10-24 02:36:00 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-09-24 09:02:59 -0500

Seen: 2,346 times

Last updated: Nov 14 '13