Hi Hutson Thanks for sharing!!! :)
Cheers On Thu, Dec 22, 2011 at 11:07 PM, Hutson Betts <[email protected]> wrote: > For those who are interested in Host-based VLAN for OpenNebula v3.0, > through the OCCI interface, here is the patch included at the bottom of > this e-mail. This is only a temporary patch meant for those who are, > like me, stuck with v3.0 for a while, but still need that specific > feature. Also, don't forget to include the network.erb file in your OCCI > templates folder. That file can be found at: > > http://dev.opennebula.org/projects/opennebula/repository/revisions/master/changes/src/cloud/occi/etc/templates/network.erb > > Patch: > > diff -u original/OCCIServer.rb modified/OCCIServer.rb > --- original/OCCIServer.rb 2011-12-22 15:54:08.545139919 -0600 > +++ modified/OCCIServer.rb 2011-12-22 14:01:15.000000000 -0600 > @@ -299,7 +299,7 @@ > VirtualNetwork.build_xml, > self.client, > request.body, > - @config[:bridge]) > + @config[:template_location]) > > # --- Generate the template and Allocate the new Instance --- > template = network.to_one_template > diff -u original/VirtualNetworkOCCI.rb modified/VirtualNetworkOCCI.rb > --- original/VirtualNetworkOCCI.rb 2011-12-22 15:54:20.765139120 -0600 > +++ modified/VirtualNetworkOCCI.rb 2011-12-22 14:01:54.000000000 -0600 > @@ -51,10 +51,10 @@ > }.gsub(/^ /, '') > > # Class constructor > - def initialize(xml, client, xml_info=nil, bridge=nil) > + def initialize(xml, client, xml_info=nil, base=nil) > super(xml, client) > - @bridge = bridge > @vnet_info = nil > + @common_template = base + '/network.erb' if base > > if xml_info != nil > xmldoc = XMLElement.build_xml(xml_info, 'NETWORK') > @@ -82,7 +82,13 @@ > return error > end > > - one = ERB.new(ONE_NETWORK) > - return one.result(binding) > + begin > + template = > ERB.new(File.read(@common_template)).result(binding) > + rescue Exception => e > + error = OpenNebula::Error.new(e.message) > + return error > + end > + > + return template > end > end > -- > Hutson Betts > Computer Science and Engineering > Texas A&M University > > > > _______________________________________________ > Users mailing list > [email protected] > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org > > -- Ruben S. Montero, PhD Project co-Lead and Chief Architect OpenNebula - The Open Source Toolkit for Data Center Virtualization www.OpenNebula.org | [email protected] | @OpenNebula
_______________________________________________ Users mailing list [email protected] http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
