[one-users] boto with opennebula 2.2

sebastien goasguen sebgoa at clemson.edu
Thu Apr 28 09:18:45 PDT 2011


Actually I just got it to work with ONE 2.2 and latest boto on Ubuntu.
In your $HOME put a .boto file with your opennebula credentials:

sebgoa at belmiro:~$ cat .boto
[Credentials]
aws_access_key_id = <opennebula userid>
aws_secret_access_key = <hash of user passwd>
[Boto]
debug = 0
num_retries = 2

then launch python

sebgoa at belmiro:~$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto
>>> import boto.ec2
>>> conn=boto.connect_ec2(region=boto.ec2.regioninfo.RegionInfo(name="opennebula",endpoint='<your opennebul>'),port=8443)
>>> myimages=conn.get_all_images()
>>> print myimages
[Image:ami-00000000, Image:ami-00000001]
>>> myimages[0].run()
Reservation:r-47a5402e
>>> myimages[0].run()
Reservation:r-47a5402e
>>> print conn.get_all_instances()
[Reservation:default]

>>> print conn.get_all_instances()[0].instances
[Instance:i-75, Instance:i-76, Instance:i-77, Instance:i-78, Instance:i-79]

(obviously I had other machines running)

>>> for instance in conn.get_all_instances()[0].instances:
...    instance.state
...
u'running'
u'running'
u'running'
u'running'
u'running'

The trick was the regioninfo instance.
Note that in my case the host:port I put in the regioninfo is an SSL
Proxy to Opennebula.

-sebastien


On Thu, Apr 28, 2011 at 11:56 AM,  <sriedel at ekp.uni-karlsruhe.de> wrote:
> Hi,
>
> I tried it once, but had no luck in configuring it right.
> But if you try to control OpenNebula via python in general, I can recommend
> the xmlrpc interface. It's pretty easy to set up and works fine for me.
>
> http://opennebula.org/documentation:rel2.2:api
>
> Greetings,
> Stephan
>
>
> Quoting sebastien goasguen <runseb at gmail.com>:
>
>> Hi,
>>
>> Yes I am referring to:
>> http://code.google.com/p/boto/
>>
>> The ecua2ools are based on it, so it should work. But I was wondering
>> if someone ever wrote a Python script using boto to start instances
>> with opennebula 2.2
>>
>> -sebastien
>>
>> On Thu, Apr 28, 2011 at 11:15 AM, Tino Vazquez <tinova79 at gmail.com> wrote:
>>>
>>> Dear Sebastian,
>>>
>>> Are you referring to the boto library as a client for OpenNebula EC2
>>> implementation? If so, no directly, but I believe the elasticfox
>>> extension (which we've tried) is based on such library.
>>>
>>> Regards,
>>>
>>> -Tino
>>>
>>> --
>>> Constantino Vázquez Blanco | dsa-research.org/tinova
>>> Virtualization Technology Engineer / Researcher
>>> OpenNebula Toolkit | opennebula.org
>>>
>>>
>>>
>>> On Thu, Apr 28, 2011 at 4:55 PM, sebastien goasguen <runseb at gmail.com>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Has anyone used the python boto module with ONE 2.2 ?
>>>> Can you share your config or changes to the code that you made.
>>>>
>>>> thanks,
>>>>
>>>> -sebastien
>>>>
>>>> --
>>>> ---
>>>> Sebastien Goasguen, Associate Professor
>>>> School of Computing
>>>> Clemson University
>>>> 864-553-4734.
>>>> Google Voice: (864)-869-8683
>>>> http://sites.google.com/site/runseb/
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opennebula.org
>>>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>>>
>>>
>>
>>
>>
>> --
>> ---
>> Sebastien Goasguen, Associate Professor
>> School of Computing
>> Clemson University
>> 864-553-4734.
>> Google Voice: (864)-869-8683
>> http://sites.google.com/site/runseb/
>> _______________________________________________
>> Users mailing list
>> Users at lists.opennebula.org
>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
---
Sebastien Goasguen, Associate Professor
School of Computing
Clemson University
864-553-4734.
Google Voice: (864)-869-8683
http://sites.google.com/site/runseb/



More information about the Users mailing list