1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

B #2324 vCenter networks are imported with VCENTER_IMPORTED att (#2381)

This commit is contained in:
Sergio Semedi Barranco 2018-09-05 16:49:47 +02:00 committed by Tino Vázquez
parent 243bc11d90
commit 052a06d5f7
2 changed files with 5 additions and 4 deletions

View File

@ -37,12 +37,13 @@ require 'base64'
base64_temp = ARGV[1]
template = OpenNebula::XMLElement.new
template.initialize_xml(Base64.decode64(base64_temp), 'VNET')
managed = template["TEMPLATE/OPENNEBULA_MANAGED"] != "NO"
error = template["TEMPLATE/VCENTER_NET_STATE"] == "ERROR"
managed = template["TEMPLATE/OPENNEBULA_MANAGED"] != "NO"
imported = template["TEMPLATE/VCENTER_IMPORTED"]
error = template["TEMPLATE/VCENTER_NET_STATE"] == "ERROR"
begin
# Step 0. Only execute for vcenter network driver
if template["VN_MAD"] == "vcenter" && managed && !error
if template["VN_MAD"] == "vcenter" && managed && !error && imported.nil?
# Step 1. Extract vnet settings
host_id = template["TEMPLATE/VCENTER_ONE_HOST_ID"]
raise "We require the ID of the OpenNebula host representing a vCenter cluster" if !host_id

View File

@ -164,7 +164,7 @@ class Network
"VCENTER_PORTGROUP_TYPE=\"#{network_type}\"\n"\
"VCENTER_NET_REF=\"#{network_ref}\"\n"\
"VCENTER_INSTANCE_ID=\"#{vcenter_uuid}\"\n"\
"OPENNEBULA_MANAGED=\"NO\"\n"
"VCENTER_IMPORTED=\"YES\"\n"
if unmanaged == "wild"
template += "VCENTER_FROM_WILD=\"#{template_id}\"\n"