From: tierno Date: Mon, 7 May 2018 15:30:04 +0000 (+0200) Subject: LWB increase deployment timeout. Check vnf management ip is returned X-Git-Tag: v4.0.0~10 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=commitdiff_plain;h=61bee6e9151452e0798c7fab389ac4b7f7672b77 LWB increase deployment timeout. Check vnf management ip is returned Change-Id: I13f3e2d5cdac50e9f59052be615ba95d11739515 Signed-off-by: tierno --- diff --git a/lcm/osm_lcm/ROclient.py b/lcm/osm_lcm/ROclient.py index 8564bfd8..e0533c5a 100644 --- a/lcm/osm_lcm/ROclient.py +++ b/lcm/osm_lcm/ROclient.py @@ -305,13 +305,17 @@ class ROClient: """ ns_ip = {"vnf": {}, "vdu": {}} for vnf in ns_descriptor["vnfs"]: - ns_ip["vnf"][str(vnf["member_vnf_index"])] = vnf["ip_address"] + if not vnf.get("ip_address"): + raise ROClientException("No ip_address returned for ns member_vnf_index '{}'".format( + vnf["member_vnf_index"]), http_code=500) + ns_ip["vnf"][str(vnf["member_vnf_index"])] = vnf.get("ip_address") ns_ip["vdu"][str(vnf["member_vnf_index"])] = {} for vm in vnf["vms"]: if vm.get("ip_address"): ns_ip["vdu"][str(vnf["member_vnf_index"])][vm["vdu_osm_id"]] = vm["ip_address"] return ns_ip + async def _get_item_uuid(self, session, item, item_id_name, all_tenants=False): if all_tenants: tenant_text = "/any" diff --git a/lcm/osm_lcm/lcm.py b/lcm/osm_lcm/lcm.py index a041db0c..666d3cd8 100644 --- a/lcm/osm_lcm/lcm.py +++ b/lcm/osm_lcm/lcm.py @@ -671,8 +671,6 @@ class Lcm: db_nsr["detailed-status"] = "creating" db_nsr["operational-status"] = "init" - deloyment_timeout = 120 - RO = ROclient.ROClient(self.loop, **self.ro_config) # get vnfds, instantiate at RO @@ -755,8 +753,8 @@ class Lcm: step = ns_status_detailed = "Waiting ns ready at RO" db_nsr["detailed-status"] = ns_status_detailed self.logger.debug(logging_text + step + " RO_ns_id={}".format(RO_nsr_id)) - deloyment_timeout = 600 - while deloyment_timeout > 0: + deployment_timeout = 2*3600 # Two hours + while deployment_timeout > 0: desc = await RO.show("ns", RO_nsr_id) ns_status, ns_status_info = RO.check_ns_status(desc) nsr_lcm["RO"]["nsr_status"] = ns_status @@ -766,14 +764,15 @@ class Lcm: db_nsr["detailed-status"] = ns_status_detailed + "; {}".format(ns_status_info) self.update_db("nsrs", nsr_id, db_nsr) elif ns_status == "ACTIVE": + step = "Getting ns VNF management IP address" nsr_lcm["nsr_ip"] = RO.get_ns_vnf_ip(desc) break else: assert False, "ROclient.check_ns_status returns unknown {}".format(ns_status) await asyncio.sleep(5, loop=self.loop) - deloyment_timeout -= 5 - if deloyment_timeout <= 0: + deployment_timeout -= 5 + if deployment_timeout <= 0: raise ROclient.ROClientException("Timeout waiting ns to be ready") db_nsr["detailed-status"] = "Configuring vnfr" self.update_db("nsrs", nsr_id, db_nsr)