+ # SCALE RO - END
+
+ # SCALE-UP VCA - BEGIN
+ if VCA_scaling_info:
+ step = db_nslcmop_update["detailed-status"] = \
+ "Creating new execution environments"
+ scale_process = "VCA"
+ for vdu_info in VCA_scaling_info:
+ if vdu_info["type"] == "create":
+ member_vnf_index = str(vdu_info["member-vnf-index"])
+ self.logger.debug(logging_text + "vdu info: {}".format(vdu_info))
+ vnfd_id = db_vnfr["vnfd-ref"]
+ vdu_index = int(vdu_info["vdu_index"])
+ deploy_params = {"OSM": get_osm_params(db_vnfr)}
+ if db_vnfr.get("additionalParamsForVnf"):
+ deploy_params.update(parse_yaml_strings(db_vnfr["additionalParamsForVnf"].copy()))
+ descriptor_config = get_configuration(db_vnfd, db_vnfd["id"])
+ if descriptor_config:
+ vdu_id = None
+ vdu_name = None
+ kdu_name = None
+ self._deploy_n2vc(
+ logging_text=logging_text + "member_vnf_index={} ".format(member_vnf_index),
+ 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=vdu_index,
+ vdu_name=vdu_name,
+ deploy_params=deploy_params,
+ descriptor_config=descriptor_config,
+ base_folder=base_folder,
+ task_instantiation_info=tasks_dict_info,
+ stage=stage
+ )
+ vdu_id = vdu_info["osm_vdu_id"]
+ vdur = find_in_list(db_vnfr["vdur"], lambda vdu: vdu["vdu-id-ref"] == vdu_id)
+ descriptor_config = get_configuration(db_vnfd, vdu_id)
+ if vdur.get("additionalParams"):
+ deploy_params_vdu = parse_yaml_strings(vdur["additionalParams"])
+ else:
+ deploy_params_vdu = deploy_params
+ deploy_params_vdu["OSM"] = get_osm_params(db_vnfr, vdu_id, vdu_count_index=vdu_index)
+ if descriptor_config:
+ vdu_name = None
+ kdu_name = None
+ stage[1] = "Scaling member_vnf_index={}, vdu_id={}, vdu_index={} ".format(
+ member_vnf_index, vdu_id, vdu_index)
+ stage[2] = step = "Scaling out VCA"
+ self._write_op_status(
+ op_id=nslcmop_id,
+ stage=stage
+ )
+ self._deploy_n2vc(
+ logging_text=logging_text + "member_vnf_index={}, vdu_id={}, vdu_index={} ".format(
+ member_vnf_index, vdu_id, vdu_index),
+ 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=vdu_index,
+ vdu_name=vdu_name,
+ deploy_params=deploy_params_vdu,
+ descriptor_config=descriptor_config,
+ base_folder=base_folder,
+ task_instantiation_info=tasks_dict_info,
+ stage=stage
+ )
+ # TODO: scaling for kdu is not implemented yet.
+ kdu_name = vdu_info["osm_vdu_id"]
+ descriptor_config = get_configuration(db_vnfd, kdu_name)
+ if descriptor_config:
+ vdu_id = None
+ vdu_index = vdu_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=vdu_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