1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

Feature #3156: Add support for BRIDGE_OVS in LibvirtDriverKVM and in the

ovswitch drivers.
This commit is contained in:
Jaime Melis 2014-10-03 16:23:22 +02:00
parent 57be62d978
commit 8442064b41
3 changed files with 30 additions and 12 deletions

View File

@ -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

View File

@ -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<interface type='bridge'>" << endl;
file << "\t\t\t<source bridge='" << bridge << "'/>" << endl;
}
if ( vm->get_vnm_mad() == "ovswitch" )
{
file << "\t\t\t<virtualport type='openvswitch'/>" << endl;
string * the_bridge = &bridge;
if ( vm->get_vnm_mad() == "ovswitch" )
{
if ( !bridge_ovs.empty() )
{
the_bridge = &bridge_ovs;
}
file << "\t\t\t<virtualport type='openvswitch'/>" << endl;
}
file << "\t\t\t<source bridge='" << *the_bridge << "'/>" << endl;
}
if( !mac.empty() )

View File

@ -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