diff --git a/share/etc/oned.conf b/share/etc/oned.conf index 9c4bef7c4f..aacd7ac279 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -799,6 +799,7 @@ INHERIT_DATASTORE_ATTR = "GLUSTER_HOST" INHERIT_DATASTORE_ATTR = "GLUSTER_VOLUME" INHERIT_VNET_ATTR = "VLAN_TAGGED_ID" +INHERIT_VNET_ATTR = "BRIDGE_OVS" #******************************************************************************* # Transfer Manager Driver Behavior Configuration diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 2a95a0e971..9722b6ddde 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -142,6 +142,7 @@ int LibVirtDriver::deployment_description_kvm( string mac = ""; string bridge = ""; + string bridge_ovs = ""; string script = ""; string model = ""; string ip = ""; @@ -721,13 +722,14 @@ int LibVirtDriver::deployment_description_kvm( continue; } - bridge = nic->vector_value("BRIDGE"); - mac = nic->vector_value("MAC"); - target = nic->vector_value("TARGET"); - script = nic->vector_value("SCRIPT"); - model = nic->vector_value("MODEL"); - ip = nic->vector_value("IP"); - filter = nic->vector_value("FILTER"); + bridge = nic->vector_value("BRIDGE"); + bridge_ovs = nic->vector_value("BRIDGE_OVS"); + mac = nic->vector_value("MAC"); + target = nic->vector_value("TARGET"); + script = nic->vector_value("SCRIPT"); + model = nic->vector_value("MODEL"); + ip = nic->vector_value("IP"); + filter = nic->vector_value("FILTER"); if ( bridge.empty() ) { @@ -736,12 +738,21 @@ int LibVirtDriver::deployment_description_kvm( else { file << "\t\t" << endl; - file << "\t\t\t" << endl; - } - if ( vm->get_vnm_mad() == "ovswitch" ) - { - file << "\t\t\t" << endl; + string * the_bridge = &bridge; + + if ( vm->get_vnm_mad() == "ovswitch" ) + { + + if ( !bridge_ovs.empty() ) + { + the_bridge = &bridge_ovs; + } + + file << "\t\t\t" << endl; + } + + file << "\t\t\t" << endl; } if( !mac.empty() ) diff --git a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb index 28cb962f58..ee7463f259 100644 --- a/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb +++ b/src/vnm_mad/remotes/ovswitch/OpenvSwitch.rb @@ -28,6 +28,12 @@ class OpenvSwitchVLAN < OpenNebulaNetwork def initialize(vm, deploy_id = nil, hypervisor = nil) super(vm,XPATH_FILTER,deploy_id,hypervisor) @locking = false + + @vm.nics.each do |nic| + if nic[:bridge_ovs] && !nic[:bridge_ovs].empty? + nic[:bridge] = nic[:bridge_ovs] + end + end end def activate