libcloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohammad Nour El-Din <nour.moham...@gmail.com>
Subject Re: [libcloud] Using Libcloud with UEC
Date Tue, 08 Jun 2010 20:56:46 GMT
Hi Jerry...

   The problem is that I IDK how to use it I am following the example
of EC2 on Libcloud's site so I think I am doing something wrong, I
need to know which params to use with Eucalyptus. In my case I am
using the Query ID and Secrete Key provided to me from the credentials
section, Query Interface Credentials, on my installed Eucalyptus
private cloud. More info below. Please help.


Notice: I am using iPython and

      Query ID : WKy3rMzOWPouVOxK1p3Ar1C2uRBwa2FBXnCw

      Secrete Key: NjaeqV9ovIPuNqv1yuu8bojUtPLbp00ZkmnmQ

# ipython
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: from libcloud.types import Provider

In [2]: from libcloud.providers import get_driver

In [3]: Driver = get_driver(Provider.EUCALYPTUS)

In [4]: Driver?
Type:        type
Base Class:    <type 'type'>
String Form:    <class 'libcloud.drivers.ec2.EucNodeDriver'>
Namespace:    Interactive
File:        /usr/local/lib/python2.6/dist-packages/libcloud/drivers/ec2.py
Docstring:
    Driver class for Eucalyptus

Constructor information:
Definition:    Driver(self, key, secret=None, secure=True, host=None,
path=None, port=None)


In [5]: conn = Drive('WKy3rMzOWPouVOxK1p3Ar1C2uRBwa2FBXnCw',
'NjaeqV9ovIPuNqv1yuu8bojUtPLbp00ZkmnmQ', host='192.168.96.109')
---------------------------------------------------------------------------
NameError                                 Traceback (most
recent call last)

/home/mnour/<ipython console> in <module>()

NameError: name 'Drive' is not defined

In [6]: conn = Driver('WKy3rMzOWPouVOxK1p3Ar1C2uRBwa2FBXnCw',
'NjaeqV9ovIPuNqv1yuu8bojUtPLbp00ZkmnmQ', host='192.168.96.109')

In [7]: conn.lis
conn.list_images     conn.list_locations  conn.list_nodes
conn.list_sizes

In [7]: conn.list_images()
---------------------------------------------------------------------------
error                                     Traceback (most
recent call last)

/home/mnour/<ipython console> in <module>()

/usr/local/lib/python2.6/dist-packages/libcloud/drivers/ec2.pyc in
list_images(self, location)
    336         params = {'Action': 'DescribeImages'}
    337         images = self._to_images(
--> 338             self.connection.request(self.path, params=params).object
    339         )
    340         return images

/usr/local/lib/python2.6/dist-packages/libcloud/base.pyc in
request(self, action, params, data, headers, method)
    453         self.connect()
    454         self.connection.request(method=method, url=url, body=data,
--> 455                                 headers=headers)
    456         response = self.responseCls(self.connection.getresponse())
    457         response.connection = self

/usr/lib/python2.6/httplib.pyc in request(self, method, url, body, headers)
    908
    909         try:
--> 910             self._send_request(method, url, body, headers)
    911         except socket.error, v:
    912             # trap 'Broken pipe' if we're allowed to
automatically reconnect


/usr/lib/python2.6/httplib.pyc in _send_request(self, method, url,
body, headers)
    945         for hdr, value in headers.iteritems():
    946             self.putheader(hdr, value)
--> 947         self.endheaders()
    948
    949         if body:

/usr/lib/python2.6/httplib.pyc in endheaders(self)
    902             raise CannotSendHeader()
    903
--> 904         self._send_output()
    905
    906     def request(self, method, url, body=None, headers={}):

/usr/lib/python2.6/httplib.pyc in _send_output(self)
    774         msg = "\r\n".join(self._buffer)
    775         del self._buffer[:]
--> 776         self.send(msg)
    777
    778     def putrequest(self, method, url, skip_host=0,
skip_accept_encoding=0):

/usr/lib/python2.6/httplib.pyc in send(self, str)
    733         if self.sock is None:
    734             if self.auto_open:
--> 735                 self.connect()
    736             else:
    737                 raise NotConnected()

/usr/lib/python2.6/httplib.pyc in connect(self)
   1106             "Connect to a host on a given (SSL) port."
   1107
-> 1108             sock = socket.create_connection((self.host,
self.port), self.timeout)
   1109             if self._tunnel_host:
   1110                 self.sock = sock

/usr/lib/python2.6/socket.pyc in create_connection(address, timeout)
    510         except error, msg:
    511             if sock is not None:
    512                 sock.close()
    513
--> 514     raise error, msg

error: [Errno 111] Connection refused

In [8]:




On Sun, Jun 6, 2010 at 7:53 PM, Jerry Chen <jerry@apache.org> wrote:
>
> On Jun 6, 2010, at 11:39 AM, Mohammad Nour El-Din wrote:
>
> >   I am trying to use Libcloud with Ubuntu Enterprise Cloud, which is a
> > private cloud based on Eucalyptus, but it seems it does not work for me.
> > Would someone please direct me to some hints ?
>
> What kind of errors are you receiving, or what kind of behavior are you seeing?
>
> A scrubbed tcpdump would probably be helpful.
>
> Cheers,
> Jerry
>



--
Thanks
- Mohammad Nour
- LinkedIn: http://www.linkedin.com/in/mnour
----
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

"Writing clean code is what you must do in order to call yourself a
professional. There is no reasonable excuse for doing anything less
than your best."
- Clean Code: A Handbook of Agile Software Craftsmanship

"Stay hungry, stay foolish."
- Steve Jobs

Mime
View raw message