diff --git a/IM/InfrastructureInfo.py b/IM/InfrastructureInfo.py index 45f594c9..2ebe2204 100644 --- a/IM/InfrastructureInfo.py +++ b/IM/InfrastructureInfo.py @@ -600,7 +600,7 @@ def Contextualize(self, auth, vm_list=None): ctxt_task.append((-2, 0, self, ['check_vm_ips'])) ctxt_task.append((-1, 0, self, ['wait_all_vm_ips'])) - self.cont_out = "Contextualization disabled by the RADL.\n\n" + self.cont_out = "Contextualization disabled by the RADL/TOSCA template.\n\n" for vm in self.get_vm_list(): vm.configured = True else: diff --git a/IM/connectors/Kubernetes.py b/IM/connectors/Kubernetes.py index 0c95915d..59faa74c 100644 --- a/IM/connectors/Kubernetes.py +++ b/IM/connectors/Kubernetes.py @@ -62,7 +62,7 @@ def create_request(self, method, url, auth_data, headers=None, body=None): data = json.dumps(body) else: data = body - url = "%s://%s:%d%s%s" % (self.cloud.protocol, self.cloud.server, self.cloud.port, self.cloud.path, url) + url = "%s://%s:%d%s%s" % (self.cloud.protocol, self.cloud.server, self.cloud.get_port(), self.cloud.path, url) resp = requests.request(method, url, verify=self.verify_ssl, headers=headers, data=data) return resp diff --git a/IM/connectors/OpenStack.py b/IM/connectors/OpenStack.py index c2e73882..1b62c311 100644 --- a/IM/connectors/OpenStack.py +++ b/IM/connectors/OpenStack.py @@ -1287,6 +1287,10 @@ def launch(self, inf, radl, requested_radl, num_vm, auth_data): blockdevicemappings = self.get_volumes(driver, image, volume, radl) + if not self.get_private_nets(driver): + self.log_info("No private networks found. Force the creation.") + self.set_nets_to_create(radl) + with inf._lock: self.create_networks(driver, radl, inf) @@ -1382,6 +1386,31 @@ def launch(self, inf, radl, requested_radl, num_vm, auth_data): return res + def get_private_nets(self, driver): + """ + Return the list of private networks + """ + res = [] + pool_names = [pool.name for pool in driver.ex_list_floating_ip_pools()] + _, ost_nets = self.get_ost_network_info(driver, pool_names) + for net in ost_nets: + if net.name not in pool_names: + res.append(net) + return res + + @staticmethod + def set_nets_to_create(radl): + """ + Set the private networks to be created + """ + i = 0 + while radl.systems[0].getValue("net_interface." + str(i) + ".connection"): + net_name = radl.systems[0].getValue("net_interface." + str(i) + ".connection") + network = radl.get_network_by_id(net_name) + if not network.isPublic(): + network.setValue('create', 'yes') + i += 1 + @staticmethod def get_ip_pool(driver, pool_name=None): """