namespace = "{nsi}.{ns}".format(nsi=nsi_id if nsi_id else "", ns=nsr_id)
+ if vca_type == "native_charm":
+ index_number = 0
+ else:
+ index_number = vdu_index or 0
+
if vnfr_id:
element_type = "VNF"
element_under_configuration = vnfr_id
- namespace += ".{}-{}".format(vnfr_id, vdu_index or 0)
+ namespace += ".{}-{}".format(vnfr_id, index_number)
if vdu_id:
- namespace += ".{}-{}".format(vdu_id, vdu_index or 0)
+ namespace += ".{}-{}".format(vdu_id, index_number)
element_type = "VDU"
- element_under_configuration = "{}-{}".format(vdu_id, vdu_index or 0)
+ element_under_configuration = "{}-{}".format(vdu_id, index_number)
osm_config["osm"]["vdu_id"] = vdu_id
elif kdu_name:
- namespace += ".{}.{}".format(kdu_name, vdu_index or 0)
+ namespace += ".{}".format(kdu_name)
element_type = "KDU"
element_under_configuration = kdu_name
osm_config["osm"]["kdu_name"] = kdu_name
config=config,
num_units=num_units,
vca_id=vca_id,
+ vca_type=vca_type,
)
# write in db flag of configuration_sw already installed
params_dict=primitive_params_,
db_dict=db_dict,
vca_id=vca_id,
+ vca_type=vca_type,
)
# Once some primitive has been exec, check and write at db if it needs to exec terminated primitives
if check_if_terminated_needed:
deploy_params_vdu["OSM"] = get_osm_params(
db_vnfr, vdu_id, vdu_count_index=0
)
- vdud_count = get_vdu_profile(vnfd, vdu_id).get(
- "max-number-of-instances", 1
- )
+ vdud_count = get_number_of_instances(vnfd, vdu_id)
self.logger.debug("VDUD > {}".format(vdud))
self.logger.debug(
"path": nsr_db_path,
}
- kdu_instance = self.k8scluster_map[
- k8sclustertype
- ].generate_kdu_instance_name(
- db_dict=db_dict_install,
- kdu_model=k8s_instance_info["kdu-model"],
- kdu_name=k8s_instance_info["kdu-name"],
- )
+ if k8s_instance_info.get("kdu-deployment-name"):
+ kdu_instance = k8s_instance_info.get("kdu-deployment-name")
+ else:
+ kdu_instance = self.k8scluster_map[
+ k8sclustertype
+ ].generate_kdu_instance_name(
+ db_dict=db_dict_install,
+ kdu_model=k8s_instance_info["kdu-model"],
+ kdu_name=k8s_instance_info["kdu-name"],
+ )
self.update_db_2(
"nsrs", nsr_id, {nsr_db_path + ".kdu-instance": kdu_instance}
)
if kdud["name"] == kdur["kdu-name"]
)
namespace = kdur.get("k8s-namespace")
+ kdu_deployment_name = kdur.get("kdu-deployment-name")
if kdur.get("helm-chart"):
kdumodel = kdur["helm-chart"]
# Default version: helm3, if helm-version is v2 assign v2
"kdu-name": kdur["kdu-name"],
"kdu-model": kdumodel,
"namespace": namespace,
+ "kdu-deployment-name": kdu_deployment_name,
}
db_path = "_admin.deployed.K8s.{}".format(index)
db_nsr_update[db_path] = k8s_instance_info
await self.vca_map[vca_type].delete_execution_environment(
vca_deployed["ee_id"],
scaling_in=scaling_in,
+ vca_type=vca_type,
vca_id=vca_id,
)
total_timeout=self.timeout_primitive,
db_dict=db_dict,
vca_id=vca_id,
+ vca_type=vca_type,
),
timeout=timeout or self.timeout_primitive,
)
# Pre-scale retry check: Check if this sub-operation has been executed before
op_index = self._check_or_add_scale_suboperation(
db_nslcmop,
- nslcmop_id,
vnf_index,
vnf_config_primitive,
primitive_params,
# Post-scale retry check: Check if this sub-operation has been executed before
op_index = self._check_or_add_scale_suboperation(
db_nslcmop,
- nslcmop_id,
vnf_index,
vnf_config_primitive,
primitive_params,