[one-users] Host-based VLAN Through OCCI, OpenNebula v3.0

Ruben S. Montero rsmontero at opennebula.org
Fri Dec 23 02:11:22 PST 2011


Hi Hutson

Thanks for sharing!!!  :)

Cheers

On Thu, Dec 22, 2011 at 11:07 PM, Hutson Betts <hut101 at tamu.edu> 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
> Users at lists.opennebula.org
> 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 | rsmontero at opennebula.org | @OpenNebula
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20111223/3a8cfdaf/attachment-0003.htm>


More information about the Users mailing list