1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-25 02:50:08 +03:00

Bug #3858: inherit vlan_ids in reservations

This commit is contained in:
Jaime Melis 2016-03-16 18:28:58 +01:00
parent 6bf5fc2283
commit 56c6df5ab7
4 changed files with 28 additions and 4 deletions

View File

@ -605,6 +605,11 @@ int VirtualNetwork::nic_attribute(
nic->replace("VLAN_ID", vlan_id);
}
if (parent_vid != -1)
{
nic->replace("PARENT_NETWORK_ID", parent_vid);
}
if ( get_cluster_id() != ClusterPool::NONE_CLUSTER_ID )
{
nic->replace("CLUSTER_ID", get_cluster_id());

View File

@ -111,7 +111,13 @@ module VNMMAD
# Generate the name of the vlan device which will be added to the bridge.
def get_vlan_dev_name
if @nic[:vlan_id].nil?
@nic[:vlan_id] = CONF[:start_vlan] + @nic[:network_id].to_i
if @nic[:parent_network_id]
network_id = @nic[:parent_network_id].to_i
else
network_id = @nic[:network_id].to_i
end
@nic[:vlan_id] = CONF[:start_vlan] + network_id
end
@nic[:vlan_dev] = "#{@nic[:phydev]}.#{@nic[:vlan_id]}"

View File

@ -90,9 +90,15 @@ class OpenvSwitchVLAN < VNMMAD::VNMDriver
def vlan
if @nic[:vlan_id]
return @nic[:vlan_id]
@nic[:vlan_id]
else
return CONF[:start_vlan] + @nic[:network_id].to_i
if @nic[:parent_network_id]
network_id = @nic[:parent_network_id].to_i
else
network_id = @nic[:network_id].to_i
end
@nic[:vlan_id] = CONF[:start_vlan] + network_id
end
end

View File

@ -63,7 +63,14 @@ class OpenNebulaVMware < VNMMAD::VNMDriver
if nic[:vlan_id]
vlan = nic[:vlan_id]
else
vlan = CONF[:start_vlan] + nic[:network_id].to_i
if nic[:parent_network_id]
network_id = nic[:parent_network_id].to_i
else
network_id = nic[:network_id].to_i
end
vlan = CONF[:start_vlan] + network_id
end
else
vlan = nil