1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

B #2835: [vCenter] unmanaged dportgroups are working

This commit is contained in:
sergio semedi 2019-01-22 10:54:40 +01:00 committed by Tino Vázquez
parent 9f3b38b086
commit 5c59ff5894

View File

@ -1217,10 +1217,17 @@ class VirtualMachine < VCenterDriver::Template
if !unmanaged_nics.empty?
nics = get_vcenter_nics
select = ->(name){
select_net =->(ref){
device = nil
nics.each do |nic|
next unless nic.deviceInfo.summary == name
type = nic.backing.class
if type == NET_CARD
nref = nic.backing.network._ref
else
nref = nic.backing.port.portgroupKey
end
next unless nref == ref
device = nic
break
end
@ -1231,7 +1238,7 @@ class VirtualMachine < VCenterDriver::Template
}
unmanaged_nics.each do |unic|
vnic = select.call(unic['BRIDGE'])
vnic = select_net.call(unic['VCENTER_NET_REF'])
vcenter_nic_class = vnic.class
new_model = unic['MODEL'] && !unic['MODEL'].empty? && !unic['MODEL'].nil?
opennebula_nic_class = nic_model_class(unic['MODEL']) if new_model