continue
vdu_id_ref = vdur["vdu-id-ref"]
if vdu_create and vdu_create.get(vdu_id_ref):
+ vdur_copy = deepcopy(vdur)
+ vdur_copy["status"] = "BUILD"
+ vdur_copy["status-detailed"] = None
+ vdur_copy["ip_address"]: None
+ for iface in vdur_copy["interfaces"]:
+ iface["ip-address"] = None
+ iface["mac-address"] = None
+ iface.pop("mgmt_vnf", None) # only first vdu can be managment of vnf # TODO ALF
for index in range(0, vdu_create[vdu_id_ref]):
- vdur = deepcopy(vdur)
- vdur["_id"] = str(uuid4())
- vdur["count-index"] += 1
- vdurs.insert(vdu_index+1+index, vdur)
+ vdur_copy["_id"] = str(uuid4())
+ vdur_copy["count-index"] += 1
+ vdurs.insert(vdu_index+1+index, vdur_copy)
+ self.logger.debug("scale out, adding vdu={}".format(vdur_copy))
+ vdur_copy = deepcopy(vdur_copy)
+
del vdu_create[vdu_id_ref]
if vdu_delete and vdu_delete.get(vdu_id_ref):
del vdurs[vdu_index]
scale_process = None
old_operational_status = ""
old_config_status = ""
- vnfr_scaled = False
try:
# wait for any previous tasks in process
step = "Waiting for previous operations to terminate"
db_nslcmop_update["_admin.deploy.RO"] = RO_nslcmop_id
RO_task_done = False
- step = detailed_status = "Waiting RO_task_id={} to complete the scale action.".format(RO_nslcmop_id)
+ step = detailed_status = "Waiting for VIM to scale. RO_task_id={}.".format(RO_nslcmop_id)
detailed_status_old = None
self.logger.debug(logging_text + step)
detailed_status = step + "; {}".format(ns_status_info)
elif ns_status == "ACTIVE":
RO_task_done = True
+ self.scale_vnfr(db_vnfr, vdu_create=vdu_create, vdu_delete=vdu_delete)
step = detailed_status = "Waiting ns ready at RO. RO_id={}".format(RO_nsr_id)
self.logger.debug(logging_text + step)
else:
assert False, "ROclient.check_action_status returns unknown {}".format(ns_status)
else:
+ desc = await self.RO.show("ns", RO_nsr_id)
+ ns_status, ns_status_info = self.RO.check_ns_status(desc)
+ # deploymentStatus
+ self._on_update_ro_db(nsrs_id=nsr_id, ro_descriptor=desc)
if ns_status == "ERROR":
raise ROclient.ROClientException(ns_status_info)
elif ns_status == "ACTIVE":
step = detailed_status = \
"Waiting for management IP address reported by the VIM. Updating VNFRs"
- if not vnfr_scaled:
- self.scale_vnfr(db_vnfr, vdu_create=vdu_create, vdu_delete=vdu_delete)
- vnfr_scaled = True
try:
- desc = await self.RO.show("ns", RO_nsr_id)
-
- # deploymentStatus
- self._on_update_ro_db(nsrs_id=nsr_id, ro_descriptor=desc)
-
# nsr_deployed["nsr_ip"] = RO.get_ns_vnf_info(desc)
self.ns_update_vnfr({db_vnfr["member-vnf-index-ref"]: db_vnfr}, desc)
break