nsr_id,
{
"_admin.scaling-group": [
- {"name": scaling_group, "nb-scale-op": 0}
+ {
+ "name": scaling_group,
+ "vnf_index": vnf_index,
+ "nb-scale-op": 0,
+ }
]
},
)
for admin_scale_index, admin_scale_info in enumerate(
db_nsr["_admin"]["scaling-group"]
):
- if admin_scale_info["name"] == scaling_group:
+ if (
+ admin_scale_info["name"] == scaling_group
+ and admin_scale_info["vnf_index"] == vnf_index
+ ):
nb_scale_op = admin_scale_info.get("nb-scale-op", 0)
break
else: # not found, set index one plus last element and add new entry with the name
db_nsr_update[
"_admin.scaling-group.{}.name".format(admin_scale_index)
] = scaling_group
+ db_nsr_update[
+ "_admin.scaling-group.{}.vnf_index".format(admin_scale_index)
+ ] = vnf_index
vca_scaling_info = []
scaling_info = {"scaling_group_name": scaling_group, "vdu": [], "kdu": []}