LWB increase deployment timeout. Check vnf management ip is returned 79/6079/1 v3.1 v3.1.0
authortierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 7 May 2018 15:30:04 +0000 (17:30 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 7 May 2018 15:30:04 +0000 (17:30 +0200)
Change-Id: I13f3e2d5cdac50e9f59052be615ba95d11739515
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
lcm/osm_lcm/ROclient.py
lcm/osm_lcm/lcm.py

index 8564bfd..e0533c5 100644 (file)
@@ -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"
index a041db0..666d3cd 100644 (file)
@@ -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)