Skip to content

Commit

Permalink
B #2474 Network model is not working in vCenter (#2519)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d7bdc1)
  • Loading branch information
joseangelgm authored and Tino Vazquez committed Oct 17, 2018
1 parent 4e8984d commit 696fd2c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,17 @@ def calculate_add_nic_spec(nic)

mac = nic["MAC"]
pg_name = nic["BRIDGE"]
model = one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL") || nic["VCENTER_NET_MODEL"] || VCenterDriver::VIHelper.get_default("VM/TEMPLATE/NIC/MODEL")
mode = ''
if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? &&
!one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty?
model = one_item['TEMPLATE/NIC_DEFAULT/MODEL']
elsif (model.nil? || model.empty?) &&
!nic['MODEL'].nil? &&
!nic['MODEL'].empty?
model = nic['MODEL']
else
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
end
vnet_ref = nic["VCENTER_NET_REF"]
backing = nil

Expand Down Expand Up @@ -1998,7 +2008,17 @@ def calculate_add_nic_spec(nic)
def calculate_add_nic_spec_autogenerate_mac(nic)

pg_name = nic["BRIDGE"]
model = one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL") || nic["VCENTER_NET_MODEL"] || VCenterDriver::VIHelper.get_default("VM/TEMPLATE/NIC/MODEL")
mode = ''
if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? &&
!one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty?
model = one_item['TEMPLATE/NIC_DEFAULT/MODEL']
elsif (model.nil? || model.empty?) &&
!nic['MODEL'].nil? &&
!nic['MODEL'].empty?
model = nic['MODEL']
else
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
end
vnet_ref = nic["VCENTER_NET_REF"]
backing = nil

Expand Down

0 comments on commit 696fd2c

Please sign in to comment.