1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-25 06:03:36 +03:00

Fix B#4928 import vcenter networks with same name in different clusters

This commit is contained in:
mcabrerizo 2016-11-18 18:03:24 +01:00
parent 4d95cb449a
commit 10b7bd74e2

View File

@ -517,21 +517,24 @@ class VIClient
next if !n[:host][0]
# Networks can be in several cluster, create one per cluster
net_names = []
Array(n[:host]).each{ |host_system|
net_name = "#{n.name} - #{host_system.parent.name}"
if !vnpool["VNET[BRIDGE=\"#{n[:name]}\"]/\
TEMPLATE[VCENTER_TYPE=\"Port Group\"]"]
one_nets << {
:name => net_name,
:bridge => n.name,
:cluster => host_system.parent.name,
:type => "Port Group",
:one => "NAME = \"#{net_name}\"\n" \
"BRIDGE = \"#{n[:name]}\"\n" \
"VN_MAD = \"dummy\"\n" \
"VCENTER_TYPE = \"Port Group\""
}
if !net_names.include?(net_name)
if !vnpool["VNET[BRIDGE=\"#{n[:name]}\"]/\
TEMPLATE[VCENTER_TYPE=\"Port Group\"]"]
one_nets << {
:name => net_name,
:bridge => n.name,
:cluster => host_system.parent.name,
:type => "Port Group",
:one => "NAME = \"#{net_name}\"\n" \
"BRIDGE = \"#{n[:name]}\"\n" \
"VN_MAD = \"dummy\"\n" \
"VCENTER_TYPE = \"Port Group\""
}
net_names << net_name
end
end
}
}