Fixed tosca models and updated policies 17/71617/1
authorChayal, Avteet (ac229e) <ac229e@att.com>
Thu, 1 Nov 2018 07:06:38 +0000 (07:06 +0000)
committerChayal, Avteet (ac229e) <ac229e@att.com>
Thu, 1 Nov 2018 07:07:05 +0000 (07:07 +0000)
Fixed tosca models and updated policies for vFW

Issue-ID: OPTFRA-384
Change-Id: If84cd3117f3c7b3d91a22e379b38c567ed3804e2
Signed-off-by: Chayal, Avteet (ac229e) <ac229e@att.com>
osdf/models/policy/placement/tosca/hpaPolicy-v20181031.yml
osdf/models/policy/placement/tosca/optimizationPolicy-v20181031.yml
osdf/models/policy/placement/tosca/queryPolicy-v20181031.yml
osdf/models/policy/placement/tosca/vnfPolicy-v20181031.yml [moved from osdf/models/policy/placement/tosca/vnfPolicy-v20180326.yml with 97% similarity]
test/functest/simulators/simulated-config/common_config.yaml
test/policy-local-files/hpa_policy_vFW_1.json
test/policy-local-files/subscriber_policy_vCPE.json [moved from test/policy-local-files/subscriber_policy.json with 87% similarity]
test/policy-local-files/subscriber_policy_vFW.json [new file with mode: 0644]

index baa654a..bf7380d 100644 (file)
@@ -32,7 +32,7 @@ node_types:
                 type: list
                 required: true
                 entry_schema:
-                   type: policy.data.flavorFeatures_properties
+                   type:policy.data.flavorFeatures_properties
 data_types:
     policy.data.flavorFeatures_properties:
         derived_from: tosca.nodes.Root
index 166799c..2c7e6c7 100644 (file)
@@ -32,11 +32,11 @@ node_types:
                     -   valid_values:
                         - minimize
                         - maximize
-            objectiveParameters:
-                type: policy.data.objectiveParameters_properties
+            objectiveParameter:
+                type: policy.data.objectiveParameter_properties
                 required: true
 data_types:
-    policy.data.objectiveParameters_properties:
+    policy.data.objectiveParameter_properties:
         derived_from: tosca.nodes.Root
         properties:
             parameterAttributes:
index 805b5a2..7f2b550 100644 (file)
@@ -27,7 +27,7 @@ node_types:
                 type: list
                 required: true
                 entry_schema:
-                -   type: policy.data.queryProperties_properties
+                   type:policy.data.queryProperties_properties
 data_types:
     policy.data.queryProperties_properties:
         derived_from: tosca.nodes.Root
@@ -41,7 +41,7 @@ node_types:
                 type: list
                 required: true
                 entry_schema:
-                -   type: policy.data.vnfProperties_properties
+                   type:policy.data.vnfProperties_properties
 data_types:
     policy.data.vnfProperties_properties:
         derived_from: tosca.nodes.Root
index 1a85714..1249dc0 100644 (file)
@@ -23,7 +23,7 @@ osdf_temp:  # special configuration required for "workarounds" or testing
             - hpa_policy_vG_1.json
             - vnfPolicy_vG.json
             - vnfPolicy_vGMuxInfra.json
-            - subscriber_policy.json
+            - subscriber_policy_vCPE.json
 service_info:
     vCPE:
         vcpeHostName: requestParameters.vcpeHostName
index 5d2499f..f2306d3 100644 (file)
 {
-    "service": "hpaPolicy",
-    "policyName": "OSDF_R2.hpa_policy_vG_1",
-    "description": "HPA policy for vG",
-    "templateVersion": "OpenSource.version.1",
-    "version": "test1",
-    "priority": "3",
-    "riskType": "test",
-    "riskLevel": "2",
-    "guard": "False",
-    "content": {
-      "resources": "vG",
-      "identity": "hpaPolicy_vG",
-      "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vG"],
-      "policyType": "hpaPolicy",
-      "flavorFeatures": [
-        {
-          "id": "vg_1",
-          "type": "vnfc",
-          "directives": [
-            {
-              "type": "flavor_directives",
-              "attributes": [
-                {
-                  "attribute_name": "flavor_label_vm_01",
-                  "attribute_value": ""
-                }
-              ]
-            }
-          ],
-          "flavorProperties":[
-            {
-              "hpa-feature" : "cpuTopology",
-              "mandatory" : "True",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "2","operator": ">=", "unit": ""},
-                {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "4","operator": "<=", "unit": ""},
-                {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "2", "operator":">=", "unit": ""},
-                {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "4", "operator":"<=", "unit": ""},
-                {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "4", "operator":">=", "unit": ""},
-                {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "8", "operator":"<=", "unit": ""}
-              ]
-            },
-            {
-              "hpa-feature" : "basicCapabilities",
-              "mandatory" : "True",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
-              ]
-            },
-            {
-              "hpa-feature" : "ovsDpdk",
-              "mandatory" : "False",
-              "score" : "3",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                 {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""}
-              ]
-            },
-            {
-              "hpa-feature" : "cpuInstructionSetExtensions",
-              "mandatory" : "True",
-              "architecture": "INTEL-64",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
-              ]
-            }
-          ]
-        },
-        {
-          "id": "vg_2",
-          "type": "vnfc",
-          "directives": [
-            {
-              "type": "flavor_directives",
-              "attributes": [
-                {
-                  "attribute_name": "flavor_label_vm_02",
-                  "attribute_value": ""
-                }
-              ]
-            }
-          ],
-          "flavorProperties":[
-            {
-              "hpa-feature" : "cpuPinningy",
-              "mandatory" : "True",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key":"logicalCpuThreadPinningPolicy", "hpa-attribute-value":"<CPUTHREADPOLICY>", "operator": "=", "unit":""},
-                {"hpa-attribute-key":"logicalCpuPinningPolicy", "hpa-attribute-value": "<CPUPOLICY>","operator": "=", "unit":""}
-              ]
-            },
-            {
-              "hpa-feature" : "basicCapabilities",
-              "mandatory" : "True",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
-              ]
-            },
-            {
-              "hpa-feature" : "localStorage",
-              "mandatory" : "False",
-              "score" : "5",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key": "diskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"},
-                {"hpa-attribute-key": "ephemeralDiskSize", "hpa-attribute-value": "2", "operator": "=", "unit": "GB"},
-                {"hpa-attribute-key": "swapMemSize", "hpa-attribute-value":"16", "operator": "=", "unit": "MB"}
-              ]
-            },
-            {
-              "hpa-feature" : "pciePassthrough",
-              "mandatory" : "True",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key": "pciCount", "hpa-attribute-value": "2", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "pciVendorId", "hpa-attribute-value":"8086", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "pciDeviceId", "hpa-attribute-value": "2", "operator": "=", "unit": ""}
-              ]
-            }
-          ]
-        },
-        {
-          "id": "vg_3",
-          "type": "vnfc",
-          "directives": [
-            {
-              "type": "flavor_directives",
-              "attributes": [
-                {
-                  "attribute_name": "flavor_label_vm_03",
-                  "attribute_value": ""
-                }
-              ]
-            }
-          ],
-          "flavorProperties":[
-            {
-              "hpa-feature" : "numa",
-              "mandatory" : "False",
-              "score" : "5",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key": "numaNodes", "hpa-attribute-value": "2", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "numaCpu-0", "hpa-attribute-value":"2", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "numaMem-0", "hpa-attribute-value": "2048", "operator": "=", "unit": "MB"},
-                {"hpa-attribute-key": "numaCpu-1", "hpa-attribute-value":"4", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "numaMem-1", "value": "4096", "operator": "=", "unit": "MB"}
-              ]
-            },
-            {
-              "hpa-feature" : "basicCapabilities",
-              "mandatory" : "True",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                {"hpa-attribute-key": "numVirtualCpu", "hpa-attribute-value": "6", "operator": "=", "unit": ""},
-                {"hpa-attribute-key": "virtualMemSize", "hpa-attribute-value":"6", "operator": "=", "unit": "GB"}
-              ]
-            },
-            {
-              "hpa-feature" : "hugePages",
-              "mandatory" : "False",
-              "score" : "7",
-              "architecture": "generic",
-              "directives": [],
-              "hpa-feature-attributes": [
-                 {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
-              ]
-            }
-          ]
-        }
-      ]
-    }
+  "service": "hpaPolicy",
+  "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_1",
+  "description": "HPA policy for vFW",
+  "templateVersion": "OpenSource.version.1",
+  "version": "test1",
+  "priority": "3",
+  "riskType": "test",
+  "riskLevel": "2",
+  "guard": "False",
+  "content": {
+    "resources": ["vFW"],
+    "identity": "hpa-vFW",
+    "policyScope": ["vFW", "US", "INTERNATIONAL", "ip"],
+    "policyType": "hpa",
+    "flavorFeatures": [
+      {
+        "flavorProperties": [
+          {
+            "architecture": "generic",
+            "directives": [],
+            "hpa-version": "v1",
+            "hpa-feature-attributes": [
+              {
+                "unit": "",
+                "operator": ">=",
+                "hpa-attribute-value": "2",
+                "hpa-attribute-key": "numVirtualCpu"
+              },
+              {
+                "unit": "MB",
+                "operator": ">=",
+                "hpa-attribute-value": "8",
+                "hpa-attribute-key": "virtualMemSize"
+              }
+            ],
+            "hpa-feature": "basicCapabilities",
+            "mandatory": "True"
+          },
+          {
+            "architecture": "generic",
+            "directives": [],
+            "hpa-version": "v1",
+            "hpa-feature-attributes": [
+              {
+                "unit": "",
+                "operator": "=",
+                "hpa-attribute-value": "2",
+                "hpa-attribute-key": "numaNodes"
+              },
+              {
+                "operator": "=",
+                "hpa-attribute-value": "2",
+                "hpa-attribute-key": "numaCpu-0"
+              },
+              {
+                "operator": "=",
+                "hpa-attribute-value": "4",
+                "hpa-attribute-key": "numaCpu-1"
+              },
+              {
+                "unit": "GB",
+                "operator": "=",
+                "hpa-attribute-value": "2",
+                "hpa-attribute-key": "numaMem-0"
+              },
+              {
+                "unit": "GB",
+                "operator": "=",
+                "hpa-attribute-value": "4",
+                "hpa-attribute-key": "numaMem-1"
+              }
+            ],
+            "hpa-feature": "numa",
+            "mandatory": "True"
+          },
+          {
+            "architecture": "generic",
+            "directives": [],
+            "hpa-version": "v1",
+            "hpa-feature-attributes": [
+              {
+                "unit": "MB",
+                "operator": "=",
+                "hpa-attribute-value": "2",
+                "hpa-attribute-key": "memoryPageSize"
+              },
+              {
+                "operator": "=",
+                "hpa-attribute-value": "4",
+                "hpa-attribute-key": "numberOfPages"
+              }
+            ],
+            "hpa-feature": "hugePages",
+            "mandatory": "True"
+          },
+          {
+            "architecture": "Intel64",
+            "hpa-feature": "sriovNICNetwork",
+            "hpa-version": "v1",
+            "directives": [
+              {
+                "type": "sriovNICNetwork_directives",
+                "attributes": [
+                  {
+                    "attribute_name": "oof_returned_vnic_type_for_firewall_protected",
+                    "attribute_value": "direct"
+                  }
+                ]
+              }
+            ],
+            "hpa-feature-attributes": [
+              {
+                "unit": "",
+                "operator": "=",
+                "hpa-attribute-value": "1",
+                "hpa-attribute-key": "pciCount"
+              },
+              {
+                "unit": "",
+                "operator": "=",
+                "hpa-attribute-value": "1234",
+                "hpa-attribute-key": "pciVendorId"
+              },
+              {
+                "unit": "",
+                "operator": "=",
+                "hpa-attribute-value": "7890",
+                "hpa-attribute-key": "pciDeviceId"
+              }
+            ],
+            "score": "100",
+            "mandatory": "False"
+          }
+        ],
+        "type": "vnfc",
+        "id": "vfw_1",
+        "directives": [
+          {
+            "type": "flavor_directives",
+            "attributes": [
+              {
+                "attribute_name": "label_1",
+                "attribute_value": ""
+              }
+            ]
+          }
+        ]
+      },
+      {
+        "flavorProperties": [
+          {
+            "architecture": "generic",
+            "directives": [],
+            "hpa-version": "v1",
+            "hpa-feature-attributes": [
+              {
+                "operator": ">=",
+                "hpa-attribute-value": "1",
+                "hpa-attribute-key": "numVirtualCpu"
+              },
+              {
+                "unit": "GB",
+                "operator": ">=",
+                "hpa-attribute-value": "7",
+                "hpa-attribute-key": "virtualMemSize"
+              }
+            ],
+            "hpa-feature": "basicCapabilities",
+            "mandatory": "True"
+          }
+        ],
+        "type": "vnfc",
+        "id": "vfw_2",
+        "directives": [
+          {
+            "type": "flavor_directives",
+            "attributes": [
+              {
+                "attribute_name": "label_2",
+                "attribute_value": ""
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  }
 }
@@ -1,7 +1,7 @@
 {
     "service": "subscriberPolicy",
     "policyName": "OSDF_CASABLANCA.SubscriberPolicy_v1",
-    "description": "Subscriber Policy",
+    "description": "Subscriber Policy for vCPE",
     "templateVersion": "OpenSource.version.1",
     "version": "test1",
     "priority": "1",
@@ -9,7 +9,7 @@
     "riskLevel": "3",
     "guard": "False",
     "content": {
-        "identity": "subscriber",
+        "identity": "subscriber_vCPE",
         "policyScope": ["vCPE", "subscriber_x", "subscriber_y", "subscriberPolicy"],
         "properties": {
                 "subscriberName": ["subscriber_x", "subscriber_y"],
diff --git a/test/policy-local-files/subscriber_policy_vFW.json b/test/policy-local-files/subscriber_policy_vFW.json
new file mode 100644 (file)
index 0000000..38e615c
--- /dev/null
@@ -0,0 +1,22 @@
+{
+    "service": "subscriberPolicy",
+    "policyName": "OSDF_CASABLANCA.SubscriberPolicy_v1",
+    "description": "Subscriber Policy for VFW",
+    "templateVersion": "OpenSource.version.1",
+    "version": "test1",
+    "priority": "1",
+    "riskType": "test",
+    "riskLevel": "3",
+    "guard": "False",
+    "content": {
+        "identity": "subscriber_vFW",
+        "policyScope": ["vFW", "subscriber_x", "subscriber_y", "subscriberPolicy"],
+        "properties": {
+                "subscriberName": ["subscriber_x", "subscriber_y"],
+                "subscriberRole": ["PVT Homing"],
+                "provStatus": ["CAPPED"]
+        },
+        "policyType": "subscriberPolicy",
+        "serviceName": "vFW"
+    }
+}