mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
* B #3567: add switch name in DPG Signed-off-by: Carlos J. Herrera Matos <cherrera@opennebula.systems> * B #3567: fix typo Signed-off-by: Carlos J. Herrera Matos <cherrera@opennebula.systems>
This commit is contained in:
1 parent
5d3e4485eb
commit
9a275b49e4
2 files changed
+7
-2
No files matched your search
@@ -441,6 +441,7 @@ class DatacenterFolder
|
||||
|
||||
networks[s.portgroupKey][:uplink] = s.uplinkPortgroup
|
||||
networks[s.portgroupKey][:processed] = true
|
||||
networks[s.portgroupKey][:sw_name] = s.switchName
|
||||
end
|
||||
end
|
||||
clusters[r.obj._ref] = r.to_hash if r.obj.is_a?(RbVmomi::VIM::ClusterComputeResource)
|
||||
@@ -491,6 +492,7 @@ class DatacenterFolder
|
||||
opts[:network_name] = networks[network_ref]['name']
|
||||
opts[:network_ref] = network_ref
|
||||
opts[:network_type] = networks[network_ref][:network_type]
|
||||
opts[:sw_name] = networks[network_ref][:sw_name]
|
||||
|
||||
networks[network_ref] = networks[network_ref].merge(VCenterDriver::Network.to_one_template(opts))
|
||||
else
|
||||
|
||||
@@ -139,6 +139,7 @@ class Network
|
||||
network_name = opts[:network_name]
|
||||
network_ref = opts[:network_ref]
|
||||
network_type = opts[:network_type]
|
||||
sw_name = opts[:sw_name]
|
||||
|
||||
vcenter_uuid = opts[:vcenter_uuid]
|
||||
vcenter_instance_name = opts[:vcenter_instance_name]
|
||||
@@ -164,12 +165,12 @@ class Network
|
||||
one_tmp[:ref] = network_ref
|
||||
|
||||
one_tmp[:one] = to_one(network_import_name, bridge_name, network_ref, network_type,
|
||||
vcenter_uuid, unmanaged, template_ref, dc_ref, template_id)
|
||||
vcenter_uuid, unmanaged, template_ref, dc_ref, template_id, sw_name)
|
||||
return one_tmp
|
||||
end
|
||||
|
||||
def self.to_one(network_import_name, network_name, network_ref, network_type,
|
||||
vcenter_uuid, unmanaged, template_ref, dc_ref, template_id)
|
||||
vcenter_uuid, unmanaged, template_ref, dc_ref, template_id, sw_name)
|
||||
|
||||
template = "NAME=\"#{network_import_name}\"\n"\
|
||||
"BRIDGE=\"#{network_name}\"\n"\
|
||||
@@ -185,6 +186,8 @@ class Network
|
||||
|
||||
template += "VCENTER_TEMPLATE_REF=\"#{template_ref}\"\n" if template_ref
|
||||
|
||||
template += "VCENTER_SWITCH_NAME=\"#{sw_name}\"\n" if sw_name
|
||||
|
||||
return template
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user