mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
B #2474 Network model is not working in vCenter
This commit is contained in:
parent
39b49c7790
commit
5c24ab70b5
@ -1896,13 +1896,17 @@ class VirtualMachine < Template
|
||||
|
||||
# Returns an array of actions to be included in :deviceChange
|
||||
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")
|
||||
if !one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL").nil? && !one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL").empty?
|
||||
model = one_item.retrieve_xmlelements("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
|
||||
|
||||
limit_in = nic["INBOUND_PEAK_BW"] || VCenterDriver::VIHelper.get_default("VM/TEMPLATE/NIC/INBOUND_PEAK_BW")
|
||||
limit_out = nic["OUTBOUND_PEAK_BW"] || VCenterDriver::VIHelper.get_default("VM/TEMPLATE/NIC/OUTBOUND_PEAK_BW")
|
||||
limit = nil
|
||||
@ -1996,9 +2000,14 @@ class VirtualMachine < Template
|
||||
|
||||
# Returns an array of actions to be included in :deviceChange
|
||||
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")
|
||||
if !one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL").nil? && !one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL").empty?
|
||||
model = one_item.retrieve_xmlelements("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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user