Bug 2367 fixed: Couldn't perform manual scale out for multi-vnf 93/14293/1
author36970 <jegan.s@tataelxsi.co.in>
Mon, 1 Apr 2024 15:41:31 +0000 (15:41 +0000)
committer36970 <jegan.s@tataelxsi.co.in>
Mon, 1 Apr 2024 15:41:31 +0000 (15:41 +0000)
Change-Id: I2547ef2cb128c84edd6cae380cd6282211658786
Signed-off-by: 36970 <jegan.s@tataelxsi.co.in>
osm_lcm/ns.py

index 8e42ddc..25ae038 100644 (file)
@@ -6333,7 +6333,11 @@ class NsLcm(LcmBase):
                     nsr_id,
                     {
                         "_admin.scaling-group": [
-                            {"name": scaling_group, "nb-scale-op": 0}
+                            {
+                                "name": scaling_group,
+                                "vnf_index": vnf_index,
+                                "nb-scale-op": 0,
+                            }
                         ]
                     },
                 )
@@ -6342,7 +6346,10 @@ class NsLcm(LcmBase):
                 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
@@ -6350,6 +6357,9 @@ class NsLcm(LcmBase):
                     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": []}