"""
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"
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
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
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)