<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<br><br>I've done somethings like this with OCCI.<br>I put all the IP stuff in the network template and added the following in "common.erb" :<br><br>CONTEXT=[<br> TARGET=xvdb<br><br> <% devnum = 0 %><br> <% @vm_info.each('NIC') do |nic| %><br> <% if nic.attr('NETWORK','href') %><br> ,CTX_ETH<%= devnum %> = "$NETWORK[TEMPLATE, NETWORK_ID = <%= nic.attr('NETWORK','href').split('/').last %> ]"<br> <% devnum += 1 %><br> <% end %><br> <% end %><br>]<br><br><br>And I get all networks templates in the context file.<br><br>Cheers,<br>Nicolas
AGIUS<br><br>--- En date de : <b>Lun 18.2.13, Oriol Martí <i><omarti@cesca.cat></i></b> a écrit :<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Oriol Martí <omarti@cesca.cat><br>Objet: [one-users] Add network context variables automatically<br>À: "Users OpenNebula" <users@lists.opennebula.org><br>Date: Lundi 18 février 2013, 15h20<br><br><div class="plainMail">Hello,<br>after looking the mechanism of the contextualization variables to set the network configuration, my idea is to pass the network parameters with contextualization, my idea is to add to the context variables the IP, netmask, DNS,... of the related NICs.<br><br>I've been thinking to add a hook on create a VM, but I don't know if I can modify the context variables at this point, does anybody know if is possible?<br>Maybe another solution could be launching the hook on the physical node and
modifying directly the cdrom image that opennebula creates, but I'm not sure if this procedure it will be good because maybe the cdrom image is not created when the hook is launched and can fail easily.<br><br>Does anybody know if is possible to do? Maybe the only solution is modifying source code? Where can I start?<br><br>Thank you all,<br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.opennebula.org" href="/mc/compose?to=Users@lists.opennebula.org">Users@lists.opennebula.org</a><br><a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br></div></blockquote></td></tr></table>