Add Optimization policy for hpa_score 39/67939/1
authorDileep Ranganathan <dileep.ranganathan@intel.com>
Wed, 19 Sep 2018 16:08:21 +0000 (09:08 -0700)
committerDileep Ranganathan <dileep.ranganathan@intel.com>
Wed, 19 Sep 2018 16:08:21 +0000 (09:08 -0700)
Added policy for hpa_score optimization function for vCPE with weights.

Change-Id: Ic6f3081510cbe94c519bcb7b2a7a99137bc29e12
Issue-ID: OPTFRA-313
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
osdf/optimizers/placementopt/conductor/translation.py
test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/Placement_Optimization_1.json
test/policy-local-files/Placement_Optimization_1.json

index 76cbabd..d856a22 100644 (file)
@@ -54,7 +54,7 @@ def gen_optimization_policy(vnf_list, optimization_policy):
     for policy in optimization_policy:
         content = policy['content']
         parameter_list = []
-        parameters = ["cloud_version"]
+        parameters = ["cloud_version", "hpa_score"]
 
         for attr in content['objectiveParameter']['parameterAttributes']:
             parameter = attr['parameter'] if attr['parameter'] in parameters else attr['parameter']+"_between"
index b81b15f..ab3c586 100644 (file)
                     "parameter": "distance",
                     "weight": "1",
                     "operator": "product"
+                },
+                {
+                    "resources": ["vG"],
+                    "parameter": "hpa_score",
+                    "weight": "200",
+                    "operator": "product"
                 }
             ],
             "operator": "sum"
index b81b15f..ab3c586 100644 (file)
                     "parameter": "distance",
                     "weight": "1",
                     "operator": "product"
+                },
+                {
+                    "resources": ["vG"],
+                    "parameter": "hpa_score",
+                    "weight": "200",
+                    "operator": "product"
                 }
             ],
             "operator": "sum"