I wanted to follow up this thread with a solution.
Thanks to the recently implemented updates in the openstack driver, I'm now
able to access a vanilla devstack deployment from libcloud. With debugging
on, it was useful to compare the requests and responses from the (working)
python-novaclient library to the (not working, for me at the time) libcloud
library.
One key issue I was having is that the default compute service names were
mismatched, with libcloud using the older "nova" instead of the more recent
"Compute Service". I've submitted a pull request which addresses that
issue.
Below is a short script showing how I am able to access host "devstack-2",
defined in my /etc/hosts file.
Cheers,
Jay
# List the nodes on a devstack installation
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
STACKHOST = 'devstack-2'
TENANTNAME = 'demo'
USERNAME = 'demo'
PASSWORD = 'password'
def devstack_driver():
Driver = get_driver(Provider.OPENSTACK)
driver = Driver(USERNAME, PASSWORD, host=STACKHOST, port=8774,
secure=False,
ex_tenant_name=TENANTNAME,
ex_force_auth_version='2.0_password',
ex_force_service_name='Compute Service',
ex_force_auth_url='http://%s:5000/v2.0/' % STACKHOST)
return driver
print devstack_driver().list_nodes()
2012/2/20 Tomaž Muraus <[email protected]>
> You need to re-run stack.sh after putting those lines in your localrc.
>
> On Mon, Feb 20, 2012 at 4:28 PM, Jay Doane <[email protected]> wrote:
>
> > 2012/2/20 Tomaž Muraus <[email protected]>
> >
> > >
> > > One thing I would still try is using a stable release instead of the
> > latest
> > > master - e.g. essex:
> > >
> > > : How do I run a specific OpenStack milestone?
> > > > A: OpenStack milestones have tags set in the git repo. Set the
> > > appropriate
> > > > tag in the *_BRANCH variables in localrc. Swift is on its own release
> > > > schedule so pick a tag in the Swift repo that is just before the
> > > milestone
> > > > release. For example:
> > > > GLANCE_BRANCH=essex-3
> > > > HORIZON_BRANCH=essex-3
> > > > KEYSTONE_BRANCH=essex-3
> > > > KEYSTONECLIENT_BRANCH=essex-3
> > > > NOVA_BRANCH=essex-3
> > > > NOVACLIENT_BRANCH=essex-3
> > > > QUANTUM_BRANCH=essex-3
> > > > QUANTUM_CLIENT_BRANCH=essex-3
> > > > SWIFT_BRANCH=1.4.5
> >
> >
> > Good idea. I added those lines to my localrc, but still got the same 500
> > error as before.
> >
> > Also, I'm seeing the following stack trace from the stack's n-api
> process:
> >
> > 2012-02-20 15:53:44 WARNING nova.api.ec2 [-] Configuration setting for
> > keystone_ec2_url needs to be updated to /tokens only. The /ec2 prefix is
> > being deprecated
> > 2012-02-20 15:53:44 ERROR nova.api.ec2 [-] FaultWrapper: Extra data:
> line 1
> > column 4 - line 5 column 4 (char 4 - 43)
> > (nova.api.ec2): TRACE: Traceback (most recent call last):
> > (nova.api.ec2): TRACE: File "/opt/stack/nova/nova/api/ec2/__init__.py",
> > line 89, in __call__
> > (nova.api.ec2): TRACE: return req.get_response(self.application)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in
> > get_response
> > (nova.api.ec2): TRACE: application, catch_exc_info=False)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in
> > call_application
> > (nova.api.ec2): TRACE: app_iter = application(self.environ,
> > start_response)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
> > (nova.api.ec2): TRACE: resp = self.call_func(req, *args,
> **self.kwargs)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
> > (nova.api.ec2): TRACE: return self.func(req, *args, **kwargs)
> > (nova.api.ec2): TRACE: File "/opt/stack/nova/nova/api/ec2/__init__.py",
> > line 101, in __call__
> > (nova.api.ec2): TRACE: rv = req.get_response(self.application)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in
> > get_response
> > (nova.api.ec2): TRACE: application, catch_exc_info=False)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in
> > call_application
> > (nova.api.ec2): TRACE: app_iter = application(self.environ,
> > start_response)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
> > (nova.api.ec2): TRACE: resp = self.call_func(req, *args,
> **self.kwargs)
> > (nova.api.ec2): TRACE: File
> > "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
> > (nova.api.ec2): TRACE: return self.func(req, *args, **kwargs)
> > (nova.api.ec2): TRACE: File "/opt/stack/nova/nova/api/ec2/__init__.py",
> > line 243, in __call__
> > (nova.api.ec2): TRACE: result = utils.loads(response)
> > (nova.api.ec2): TRACE: File "/opt/stack/nova/nova/utils.py", line 757,
> in
> > loads
> > (nova.api.ec2): TRACE: return json.loads(s)
> > (nova.api.ec2): TRACE: File "/usr/lib/python2.7/json/__init__.py", line
> > 326, in loads
> > (nova.api.ec2): TRACE: return _default_decoder.decode(s)
> > (nova.api.ec2): TRACE: File "/usr/lib/python2.7/json/decoder.py", line
> > 369, in decode
> > (nova.api.ec2): TRACE: raise ValueError(errmsg("Extra data", s, end,
> > len(s)))
> > (nova.api.ec2): TRACE: ValueError: Extra data: line 1 column 4 - line 5
> > column 4 (char 4 - 43)
> > (nova.api.ec2): TRACE:
> >
>