[one-users] PUT GET base64 encoded string contextualization mechanism

Daniel Molina Aranda danmolin at fdi.ucm.es
Mon Feb 28 02:14:04 PST 2011


Hi,

The method that OpenNebula provides to give configuration parameters
to a new virtual machine is using an ISO image (OVF recommendation).
The OCCI and EC2 servers also use this kind of contextualization.
Therefore, if you want to get this information you will have to use
the context scripts that are explained here [1]

* In the EC2 case, you can define a value:
$ ./econe-run-instance -d Myvalue ami-00000023
And this value will be base64 encoded and accesible inside the context
script of the virtual machine, in a variable called EC2_USER_DATA.

* In the OCCI case, you can define the following template:
$ cat ./template.occi
<COMPUTE>
  <NAME>vmtest</NAME>
  <INSTACE_TYPE>small</INSTANCE_TYPE>
  <CONTEXT>
    <IP>192.168.0.5</IP>
    <DNS>192.168.4.9</DNS>
  </CONTEXT>
</COMPUTE>

$ ./occi-compute create template.occi
or
$ curl -u oneuser:sha1_pass http://localhost:4567/compute -d
"<COMPUTE><NAME>vmtest</NAME>...<INSTANCE_TYPE>small</INSTANCE_TYPE></COMPUTE>"
In this case you will find two variables inside the context.sh script
called IP and DNS.

OpenNebula does not implement the EC2 user data system, where you can
get your variables from a server using GET HTTP from curl. As
explained before all the contextualization in OpenNebula is made using
an ISO image.

[1] http://www.opennebula.org/documentation:rel2.0:cong

Hope this helps.

On 23 February 2011 12:12, Mihajlo Mudrinic <Mihajlo.Mudrinic at cern.ch> wrote:
>
>
> Hello
>
> I have working installation of OpenNebula small private cloud IaaS. Currently I am using
>
> an ISO image as contextualization mechanism. OCCI-server and ECONE-server are working and
>
> I have been testing occi-compute, occi-storage, occi-network and OpenNebula EC2 API.
>
> I would like to use base64 encoded string contextualization mechanisms for user-data
>
> 1.) Could you post one example how to use flag -d in
>
> econe-run-instances
>
> --user-data, -d
>
> Specifies Base64-encoded MIME user data to be made
>
> available to the instance
>
> 2.) If I understood correctly the only way to access user data defined by econe-run-instances is over ISO context made by OpenNebula VM template?
>
> 3.) What I am looking for is to get Base64-encoded MIME user data from within VM using GET HTTP from sinatra (for example curl/PERL) and avoid using  ISO image as contextualization mechanism.
>
> 4.) I am looking now at OCCI Specification
>
> http://opennebula.org/documentation:rel2.0:occidd
>
> context block in XMLSchema/occi contain
>
> <CONTEXT>
>
> <ATT>value</ATT>
>
> <ANOTHER_ATT>another value</ANOTHER_ATT>
>
> <ID>abc</ID>
>
> </CONTEXT>
>
> Could you post one example how to to create a compute using curl with a few simple attribute in context block and one liner curl how to read the same attribute from sinatra?
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



--
Daniel Molina, Cloud Technology Engineer/Researcher
DSA Research Group: web http://dsa-research.org and blog
http://blog.dsa-research.org
OpenNebula Open Source Toolkit for Cloud Computing: http://www.OpenNebula.org



More information about the Users mailing list