[one-users] m1.small.erb

Daniel Molina dmolina at opennebula.org
Tue May 10 03:30:49 PDT 2011


Hi,

You should try using:

<% if erb_vm_info[:img_id] == 1 %>
CONTEXT = [
      VAR1="foo",
      VAR2="bar"
<% elsif erb_vm_info[:img_id] == 2 %>
CONTEXT = [
      VAR1="toto",
      VAR2="titi"
<% end %>

You can use variables defined in the Network template like this [1]:
DNS = "$NETWORK[DNS, NAME=\"Public\"]"

However, this functionality is not available for the Image template,
but maybe if the community is interested we can open a ticket to
consider its implementation.

[1] http://www.opennebula.org/documentation:rel2.2:template#context_section

On 9 May 2011 18:17, sebastien goasguen <runseb at gmail.com> wrote:
> Hi,
>
> I would like my instance type template (m1.small.erb) to have
> conditions based on image_id coming from the repository.
> Something like:
>
> <% if erb_vm_info[:img_id] = 1 %>
> CONTEXT = [
>       VAR1="foo",
>       VAR2="bar"
> <% end %>
> <% if erb_vm_info[:img_id] = 2 %>
> CONTEXT = [
>       VAR1="toto",
>       VAR2="titi"
> <% end %>
>
> Where 1 and 2 are the image id returned by oneimage list.
>
> What is the proper syntax/way to do this ?
>
> 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
>



-- 
Daniel Molina, Cloud Technology Engineer/Researcher
Major Contributor
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org | dmolina at opennebula.org



More information about the Users mailing list