[Openstack] novaclient + keystone (HTTP 404, The resource could not be found.)

Dong-In David Kang dkang at isi.edu
Fri Dec 16 15:46:22 UTC 2011


>
>
> > On Thu, Dec 15, 2011 at 2:29 PM, Dong-In David Kang <dkang at isi.edu>
> > wrote:
> > >
> > >  I'm trying to make novaclient work with keystone.
> > > It looks like authentication is working, but actual interaction
> > > between novaclient and nova does not work.
> > > Here is what I get (with added debugging messages I added in
> > > novaclient)
> > >
> > >  I'll appreciate any help.
> > >
> > >  David.
> > >
> > > $ nova list
> > > initial auth_url: http://10.0.10.1:5000/v2.0/
> > > POST with body = {'auth': {'tenantName': 'demo',
> > > 'passwordCredentials': {'username': 'demo', 'password':
> > > 'guest'}}}
> > > request: args = ('http://10.0.10.1:5000/v2.0/tokens', 'POST')
> > > request: kwargs = {'body': '{"auth": {"tenantName": "demo",
> > > "passwordCredentials": {"username": "demo", "password":
> > > "guest"}}}', 'headers': {'Content-Type': 'application/json',
> > > 'User-Agent': 'python-novaclient'}}
> > > request: resp = {'date': 'Thu, 15 Dec 2011 19:20:10 GMT',
> > > 'status':
> > > '200', 'content-length': '993', 'content-type':
> > > 'application/json;
> > > charset=UTF-8'}
> > > request: body = {"access": {"token": {"expires":
> > > "2011-12-16T11:30:09.098995", "id":
> > > "6ad85291-8d26-4bd5-a667-525322fd66a8", "tenant": {"id": "2",
> > > "name": "demo"}}, "serviceCatalog": [{"endpoints": [{"region":
> > > "RegionOne", "internalURL": "http://10.0.10.1:8774/v1.1/",
> > > "publicURL": "http://10.0.10.1:8774/v1.1/"}], "type": "compute",
> > > "name": "nova"}, {"endpoints": [{"region": "RegionOne",
> > > "internalURL": "http://10.0.11.1:9292/v1.1/", "publicURL":
> > > "http://10.0.11.1:9292/v1.1/"}, {"region": "RegionOne",
> > > "internalURL": "http://10.0.1.3:9292/v1.1/", "publicURL":
> > > "http://10.0.1.3:9292/v1.1/"}, {"region": "RegionOne",
> > > "internalURL": "http://10.0.11.1:9292/v1/", "publicURL":
> > > "http://10.0.11.1:9292/v1/"}], "type": "image", "name":
> > > "glance"},
> > > {"endpoints": [{"region": "RegionOne", "internalURL":
> > > "http://10.0.10.1:5000/v2.0", "publicURL":
> > > "http://10.0.10.1:5000/v2.0"}], "type": "identity", "name":
> > > "keystone"}], "user": {"id": "2", "roles": [{"tenantId": "2",
> > > "id": "4", "name": "Member"}], "name": "demo"}}}
> > > resp of POST = {'date': 'Thu, 15 Dec 2011 19:20:10 GMT',
> > > 'status':
> > > '200', 'content-length': '993', 'content-type':
> > > 'application/json;
> > > charset=UTF-8'}
> > >
> > > service_catalog = <module 'novaclient.service_catalog' from
> > > '/home/dkang/venv/lib/python2.6/site-packages/novaclient/service_catalog.pyc'>
> > > auth_token = 6ad85291-8d26-4bd5-a667-525322fd66a8
> > > management_url = http://10.0.10.1:8774/v1.1/
> > > v2_auth is done
> > > request: args =
> > > (u'http://10.0.10.1:8774/v1.1//servers/detail?fresh=1323976810.06',
> > > 'GET')
> >
> > Unless I'm mistaken, shouldn't the above URI include the TenantId
> > between /v1.1/ and /servers?
> >
> > -jay
> >
>
>  Thank you for the catch.
> I've modified the keystone db, and rerun $nova list.
> Now I have HTTP 500 error.
>
> $ nova list
>
> REQ: curl -i http://10.0.10.1:5000/v2.0/tokens -X POST -H
> "Content-Type: application/json" -H "User-Agent: python-novaclient"
>
> REQ BODY: {"auth": {"tenantName": "demo", "passwordCredentials":
> {"username": "demo", "password": "guest"}}}
>
> RESP:{'date': 'Thu, 15 Dec 2011 22:54:31 GMT', 'status': '200',
> 'content-length': '1229', 'content-type': 'application/json;
> charset=UTF-8'} {"access": {"token": {"expires":
> "2011-12-16T11:30:09.098995", "id":
> "6ad85291-8d26-4bd5-a667-525322fd6
> 6a8", "tenant": {"id": "2", "name": "demo"}}, "serviceCatalog":
> [{"endpoints": [{"region": "RegionOne", "internalURL":
> "http://10.0.10.1:8774/v1.1/1", "publicURL":
> "http://10.0.10.1:8774/v1.1/1"}, {"region": "RegionOne",
> "internalURL": "http://
> 10.0.10.1:8774/v1.1/2", "publicURL": "http://10.0.10.1:8774/v1.1/2"},
> {"region": "RegionOne", "internalURL":
> "http://10.0.10.1:8774/v1.1/3", "publicURL":
> "http://10.0.10.1:8774/v1.1/3"}], "type": "compute", "name":
> "nova"}, {"endpoints": [{"reg
> ion": "RegionOne", "internalURL": "http://10.0.11.1:9292/v1.1/",
> "publicURL": "http://10.0.11.1:9292/v1.1/"}, {"region": "RegionOne",
> "internalURL": "http://10.0.1.3:9292/v1.1/", "publicURL":
> "http://10.0.1.3:9292/v1.1/"}, {"region": "RegionOne
> ", "internalURL": "http://10.0.11.1:9292/v1/", "publicURL":
> "http://10.0.11.1:9292/v1/"}], "type": "image", "name": "glance"},
> {"endpoints": [{"region": "RegionOne", "internalURL":
> "http://10.0.10.1:5000/v2.0", "publicURL": "http://10.0.10.1:50
> 00/v2.0"}], "type": "identity", "name": "keystone"}], "user": {"id":
> "2", "roles": [{"tenantId": "2", "id": "4", "name": "Member"}],
> "name": "demo"}}}
>
> REQ: curl -i
> http://10.0.10.1:8774/v1.1/1/servers/detail?fresh=1323989671.41 -X
> GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient"
> -H "X-Auth-Token: 6ad85291-8d26-4bd5-a667-525322fd66a8"
>
> REQ: curl -i
> http://10.0.10.1:8774/v1.1/1/servers/detail?fresh=1323989671.41 -X
> GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient"
> -H "X-Auth-Token: 6ad85291-8d26-4bd5-a667-525322fd66a8"
>
> RESP:{'date': 'Thu, 15 Dec 2011 22:54:31 GMT', 'status': '500',
> 'content-length': '128', 'content-type': 'application/json;
> charset=UTF-8'} {"computeFault": {"message": "The server has either
> erred or is incapable of performing the requested op
> eration.", "code": 500}}
>
> RESP:{'date': 'Thu, 15 Dec 2011 22:54:31 GMT', 'status': '500',
> 'content-length': '128', 'content-type': 'application/json;
> charset=UTF-8'} {"computeFault": {"message": "The server has either
> erred or is incapable of performing the requested op
> eration.", "code": 500}}
>
> The server has either erred or is incapable of performing the
> requested operation. (HTTP 500)
>
>
> == Here is my environment setting
> # env | grep -e NOVA -e OS
> HOSTNAME=maestro
> NOVA_PASSWORD=guest
> NOVA_PROJECT_ID=demo
> NOVACLIENT_DEBUG=1
> NOVA_REGION_NAME=RegionOne
> NOVA_VERSION=1.1
> NOVA_USERNAME=demo
> OS_AUTH_USER=demo
> OS_AUTH_STRATEGY=keystone
> OS_AUTH_URL=http://10.0.10.1:5000/v2.0/
> NOVA_API_KEY=guest
> NOVA_URL=http://10.0.10.1:5000/v2.0/
> OS_AUTH_TENANT=demo
> OS_AUTH_KEY=guest
> NOVA_AUTH_URL=http://10.0.10.1:5000/v2.0/
>

 It was due to the version of webob.
The installed version was 1.2b.
After reverting it to 1.1.1, it works fine.

 Thanks,

 David.




More information about the Openstack mailing list