] = "Deleting the execution environments"
scale_process = "VCA"
for vca_info in vca_scaling_info:
- if vca_info["type"] == "delete":
+ if vca_info["type"] == "delete" and not vca_info.get("osm_kdu_id"):
member_vnf_index = str(vca_info["member-vnf-index"])
self.logger.debug(
logging_text + "vdu info: {}".format(vca_info)
] = "Scaling member_vnf_index={}, vdu_id={}, vdu_index={} ".format(
member_vnf_index, vdu_id, vdu_index
)
- else:
- vdu_index = 0
- kdu_id = vca_info["osm_kdu_id"]
- stage[
- 1
- ] = "Scaling member_vnf_index={}, kdu_id={}, vdu_index={} ".format(
- member_vnf_index, kdu_id, vdu_index
- )
stage[2] = step = "Scaling in VCA"
self._write_op_status(op_id=nslcmop_id, stage=stage)
vca_update = db_nsr["_admin"]["deployed"]["VCA"]
] = "Creating new execution environments"
scale_process = "VCA"
for vca_info in vca_scaling_info:
- if vca_info["type"] == "create":
+ if vca_info["type"] == "create" and not vca_info.get("osm_kdu_id"):
member_vnf_index = str(vca_info["member-vnf-index"])
self.logger.debug(
logging_text + "vdu info: {}".format(vca_info)
task_instantiation_info=tasks_dict_info,
stage=stage,
)
- else:
- kdu_name = vca_info["osm_kdu_id"]
- descriptor_config = get_configuration(db_vnfd, kdu_name)
- if descriptor_config:
- vdu_id = None
- kdu_index = int(vca_info["kdu_index"])
- vdu_name = None
- kdur = next(
- x
- for x in db_vnfr["kdur"]
- if x["kdu-name"] == kdu_name
- )
- deploy_params_kdu = {"OSM": get_osm_params(db_vnfr)}
- if kdur.get("additionalParams"):
- deploy_params_kdu = parse_yaml_strings(
- kdur["additionalParams"]
- )
-
- self._deploy_n2vc(
- logging_text=logging_text,
- db_nsr=db_nsr,
- db_vnfr=db_vnfr,
- nslcmop_id=nslcmop_id,
- nsr_id=nsr_id,
- nsi_id=nsi_id,
- vnfd_id=vnfd_id,
- vdu_id=vdu_id,
- kdu_name=kdu_name,
- member_vnf_index=member_vnf_index,
- vdu_index=kdu_index,
- vdu_name=vdu_name,
- deploy_params=deploy_params_kdu,
- descriptor_config=descriptor_config,
- base_folder=base_folder,
- task_instantiation_info=tasks_dict_info,
- stage=stage,
- )
# SCALE-UP VCA - END
scale_process = None