You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@libcloud.apache.org by Jay Doane <ja...@almery.com> on 2012/03/28 23:09:36 UTC
Re: Anyone using OpenStack driver to access devstack deployment?
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 <to...@apache.org>
> 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 <ja...@almery.com> wrote:
>
> > 2012/2/20 Tomaž Muraus <to...@apache.org>
> >
> > >
> > > 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:
> >
>
Re: Anyone using OpenStack driver to access devstack deployment?
Posted by Jay Doane <ja...@almery.com>.
2012/3/28 Tomaž Muraus <to...@apache.org>
>
> Like you have noticed, version 0.9.0 which should be
> released in the upcoming days makes the default OpenStack driver work with
> trystack.org without needing to change the service_name attribute.
>
Hi Tomaž,
In that case, there's a comment on line 130 of
libcloud/compute/drivers/openstack.py that says
# default config for http://devstack.org/
which is somewhat misleading.
Which version of devstack are you using?
It's a very recent version, maybe a couple days old now.
stack@devstack-2:~/devstack/tools$ ./info.sh
git|devstack|master[17ff976]
...
It would be great if you could
> provide a reference to the docs which says that the new compute endpoint is
> now called "Compute Service".
I can't really speak to the documentation of devstack, but file you want to
look at is devstack/files/default_catalog.templates, line 12
> I think that the default endpoint in the
> current release is still named "nova" and that is why I will wait with
> merging your patch.
>
I may have been "nova" until commit [a96a418] on February 2, where
the above mentioned file was first added to devstack.
In any case, I will add your example to the documentation -
> http://libcloud.apache.org/docs/compute-examples.html.
>
Thanks!
Jay
> On Wed, Mar 28, 2012 at 2:09 PM, Jay Doane <ja...@almery.com> wrote:
>
> > 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 <to...@apache.org>
> >
> > > 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 <ja...@almery.com> wrote:
> > >
> > > > 2012/2/20 Tomaž Muraus <to...@apache.org>
> > > >
> > > > >
> > > > > 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:
> > > >
> > >
> >
>
Re: Anyone using OpenStack driver to access devstack deployment?
Posted by Tomaž Muraus <to...@apache.org>.
Hi Jay,
Thanks for the update. Like you have noticed, version 0.9.0 which should be
released in the upcoming days makes the default OpenStack driver work with
trystack.org without needing to change the service_name attribute.
Which version of devstack are you using? It would be great if you could
provide a reference to the docs which says that the new compute endpoint is
now called "Compute Service". I think that the default endpoint in the
current release is still named "nova" and that is why I will wait with
merging your patch.
In any case, I will add your example to the documentation -
http://libcloud.apache.org/docs/compute-examples.html.
On Wed, Mar 28, 2012 at 2:09 PM, Jay Doane <ja...@almery.com> wrote:
> 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 <to...@apache.org>
>
> > 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 <ja...@almery.com> wrote:
> >
> > > 2012/2/20 Tomaž Muraus <to...@apache.org>
> > >
> > > >
> > > > 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:
> > >
> >
>