You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by Mohammad Nour El-Din <mn...@apache.org> on 2010/06/06 18:39:26 UTC

[libcloud] Using Libcloud with UEC

Hi All...

   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 ?

-- 
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

Re: [libcloud] Using Libcloud with UEC

Posted by Jerry Chen <je...@apache.org>.
Hi Mohammad,

The relevant portion seems to be the following:

>> error: [Errno 111] Connection refused

Are you able to connect to the host (192.168.96.109) on the default port with another utility such as telnet or netcat? Have you tried specifying the port?

I've not yet played with Eucalyptus (I can barely spell it correctly), nor do I currently have access to a sandbox for testing purposes, so I am just going by your output.

Cheers,
Jerry


Re: [libcloud] Using Libcloud with UEC

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi Libcloud'ers...

   Any help ???

On Tue, Jun 8, 2010 at 11:56 PM, Mohammad Nour El-Din
<no...@gmail.com> wrote:
> 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 <je...@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
>



-- 
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

Re: [libcloud] Using Libcloud with UEC

Posted by Sidnei da Silva <si...@gmail.com>.
On Tue, Jun 8, 2010 at 5:56 PM, Mohammad Nour El-Din
<no...@gmail.com> wrote:
> error: [Errno 111] Connection refused

The default endpoint for Eucalyptus is on port 8773 without SSL
(IIRC). Either you didn't specify the port, or it's blocked on the
firewall?

-- Sidnei

Re: [libcloud] Using Libcloud with UEC

Posted by Mohammad Nour El-Din <no...@gmail.com>.
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 <je...@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

Re: [libcloud] Using Libcloud with UEC

Posted by Jerry Chen <je...@apache.org>.
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