Feature 8720: Add scale support for charms 26/8726/11
authorDavid Garcia <david.garcia@canonical.com>
Wed, 25 Mar 2020 17:21:37 +0000 (18:21 +0100)
committerDavid Garcia <david.garcia@canonical.com>
Fri, 26 Jun 2020 07:46:00 +0000 (09:46 +0200)
Change-Id: Ibbd561bd9ed14d9e3869b5aa369371cc11dab7b2
Signed-off-by: David Garcia <david.garcia@canonical.com>
osm_lcm/ns.py

index 489c436..9514768 100644 (file)
@@ -1271,11 +1271,24 @@ class NsLcm(LcmBase):
                                 deploy_params
                             )
                             break
+            num_units = 1
+            if is_proxy_charm:
+                if element_type == "NS":
+                    num_units = db_nsr.get("config-units") or 1
+                elif element_type == "VNF":
+                    num_units = db_vnfr.get("config-units") or 1
+                elif element_type == "VDU":
+                    for v in db_vnfr["vdur"]:
+                        if vdu_id == v["vdu-id-ref"]:
+                            num_units = v.get("config-units") or 1
+                            break
+
             await self.n2vc.install_configuration_sw(
                 ee_id=ee_id,
                 artifact_path=artifact_path,
                 db_dict=db_dict,
-                config=config
+                config=config,
+                num_units=num_units
             )
 
             # write in db flag of configuration_sw already installed