Update sample response and resolve directives 59/67959/1
authorRuoyu Ying <ruoyu.ying@intel.com>
Thu, 20 Sep 2018 10:30:15 +0000 (18:30 +0800)
committerRuoyu Ying <ruoyu.ying@intel.com>
Thu, 20 Sep 2018 10:32:10 +0000 (18:32 +0800)
Update the sample conductor response and add name_map
to resolve directives. Also updated functest payload
and localpolicies with the new policy model.

Change-Id: I5255c40fb714558261efffabbdf44da535171cbf
Issue-ID: OPTFRA-322
Signed-off-by: Ruoyu Ying <ruoyu.ying@intel.com>
osdf/optimizers/placementopt/conductor/conductor.py
test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vGMuxInfra_1.json
test/functest/simulators/policy/response-payloads/pdp-has-vcpe-good/hpa_policy_vG_1.json
test/placement-tests/conductor_response.json
test/placement-tests/response.json
test/policy-local-files/hpa_policy_vGMuxInfra_1.json
test/policy-local-files/hpa_policy_vG_1.json

index 29f0bbc..357efd1 100755 (executable)
@@ -136,7 +136,7 @@ def conductor_response_processor(conductor_response, raw_response, req_id):
     name_map = {"physical-location-id": "cloudClli", "host_id": "vnfHostName",\r
                 "cloud_version": "cloudVersion", "cloud_owner": "cloudOwner",\r
                 "cloud": "cloudRegionId", "service": "serviceInstanceId", "is_rehome": "isRehome",\r
-                "location_id": "locationId", "location_type": "locationType"}\r
+                "location_id": "locationId", "location_type": "locationType", "directives": "oof_directives"}\r
     for reco in conductor_response['plans'][0]['recommendations']:\r
         for resource in reco.keys():\r
             c = reco[resource]['candidate']\r
index da4ef03..85b1e82 100644 (file)
       "policyType": "hpaPolicy",
       "flavorFeatures": [
         {
-          "flavorLabel": "flavor_label_vm_01",
+          "id": "vgmux_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": ""},
@@ -34,6 +47,7 @@
               "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"}
@@ -44,6 +58,7 @@
               "mandatory" : "False",
               "score" : "3",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""}
               ]
@@ -52,6 +67,7 @@
               "hpa-feature" : "cpuInstructionSetExtensions",
               "mandatory" : "True",
               "architecture": "INTEL-64",
+              "directives":[],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
               ]
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_02",
+          "id": "vgmux_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"}
               "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-feature" : "pcie",
               "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": ""},
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_03",
+          "id": "vgmux_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-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"}
               "mandatory" : "False",
               "score" : "7",
               "architecture": "generic",
+              "directives":[],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
               ]
index f50ed6d..262ffe7 100644 (file)
       "policyType": "hpaPolicy",
       "flavorFeatures": [
         {
-          "flavorLabel": "flavor_label_vm_01",
+          "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": ""},
@@ -34,6 +47,7 @@
               "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"}
@@ -44,6 +58,7 @@
               "mandatory" : "False",
               "score" : "3",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""}
               ]
@@ -52,6 +67,7 @@
               "hpa-feature" : "cpuInstructionSetExtensions",
               "mandatory" : "True",
               "architecture": "INTEL-64",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
               ]
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_02",
+          "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"}
               "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-feature" : "pcie",
               "mandatory" : "True",
               "architecture": "generic",
+              "directives": [
+                {
+                  "type": "pcie_directives",
+                  "attributes": [
+                    {
+                      "attribute_name": "<pcie_label_name>",
+                      "attribute_value": "<value for pcie network>"
+                    }
+                  ]
+                }
+              ],
               "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": ""},
-                {"hpa-attribute-key": "functionType", "hpa-attribute-value": "<PCITYPEVALUE>","operator": "=", "unit": ""}
+                {"hpa-attribute-key": "physicalNetwork", "hpa-attribute-value": "<PCITYPEVALUE>","operator": "=", "unit": ""}
               ]
             }
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_03",
+          "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",
+              "directives": [],
               "architecture": "generic",
               "hpa-feature-attributes": [
                 {"hpa-attribute-key": "numaNodes", "hpa-attribute-value": "2", "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"}
               "mandatory" : "False",
               "score" : "7",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
               ]
index e7037c2..ee38ce9 100644 (file)
               "location_type": "openstack-cloud"
             },
             "attributes": {
-              "flavors": {
-                "flavor_label_1": "vim_flavor_X",
-                "flavor_label_2": "vim_flavor_Y"
+              "directives": {
+                "directives": [
+                {
+                  "id": "vFW_0",
+                  "type": "<vnfc/tocsa.nodes.nfv.Vdu.Compute>",
+                  "directives": [
+                    {
+                      "type": "flavor_directives",
+                      "attributes": [
+                        {
+                          "attribute_name": "oof_returned_flavor_label_for_firewall",
+                          "attribute_value": "vim_flavor_X"
+                        }
+                      ]
+                    },
+                    {
+                      "type": "sriovNICNetwork_directives",
+                      "attributes": [
+                        {
+                          "attribute_name": "oof_returned_vnic_type_for_firewall_protected",
+                          "attribute_value": "direct"
+                        },
+                        {
+                          "attribute_name": "oof_returned_provider_network_for_firewall_protected",
+                          "attribute_value": "physnet1"
+                        }
+                      ]
+                    },
+                    {
+                      "type": "sriovNICNetwork_directives",
+                      "attributes": [
+                        {
+                          "attribute_name": "oof_returned_vnic_type_for_firewall_unprotected",
+                          "attribute_value": "direct"
+                        },
+                        {
+                          "attribute_name": "oof_returned_provider_network_for_firewall_unprotected",
+                          "attribute_value": "physnet2"
+                        }
+                      ]
+                    }
+                  ]
+                },
+                {
+                  "id": "vFW_1",
+                  "type": "<vnfc/tocsa.nodes.nfv.Vdu.Compute>",
+                  "directives": [
+                    {
+                      "type": "flavor_directives",
+                      "attributes": [
+                        {
+                          "attribute_name": "oof_returned_flavor_label_for_generator",
+                          "attribute_value": "vim_flavor_Y"
+                        }
+                      ]
+                    }
+                  ]
+                }
+              ]
               },
               "cloud_owner": "CloudOwner1",
               "physical-location-id": "DLLSTX1A",
index 92751ac..71963e2 100644 (file)
   "solutions": {
     "placementSolutions": [
       [
-      {
-        "resourceModuleName": "vGMuxInfra",
-        "serviceResourceId": "someResourceId",
-        "solution": {
+        {
+          "resourceModuleName": "vGMuxInfra",
+          "serviceResourceId": "someResourceId",
+          "solution": {
             "identifierType": "serviceInstanceId",
-            "identifiers": ["gjhd-098-fhd-987"]
+            "identifiers": [
+              "gjhd-098-fhd-987"
+            ]
+          },
+          "assignmentInfo": [
+            {
+              "key": "cloudOwner",
+              "value": "amazon"
+            },
+            {
+              "key": "vnfHostName",
+              "value": "ahr344gh"
+            },
+            {
+              "key": "isRehome",
+              "value": "False"
+            },
+            {
+              "key": "cloudRegionId",
+              "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d"
+            },
+            {
+              "key": "oof_directives",
+              "value": {
+                "directives": [
+                  {
+                    "id": "vgmux_1",
+                    "type": "vnfc",
+                    "directives": [
+                      {
+                        "type": "flavor_directives",
+                        "attributes": [
+                          {
+                            "attribute_name": "flavorLabel1",
+                            "attribute_value": "vimFlavorX"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "id": "vgmux_2",
+                    "type": "vnfc",
+                    "directives": [
+                      {
+                        "type": "flavor_directives",
+                        "attributes": [
+                          {
+                            "attribute_name": "flavorLabel2",
+                            "attribute_value": "vimFlavorY"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            }
+          ]
         },
-        "assignmentInfo": [
-          { "key": "cloudOwner", "value": "amazon" },
-          { "key": "vnfHostName", "value": "ahr344gh" },
-          { "key": "isRehome", "value": "False" },
-          { "key": "cloudRegionId", "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d" },
-          { "key":"flavors", "value": { "flavorLabel1": "vimFlavorX", "flavorLabel2": "vimFlavorY"}}
-        ]
-      },
-      {
-        "resourceModuleName": "vG",
-        "serviceResourceId": "someResourceId",
-        "solution": {
+        {
+          "resourceModuleName": "vG",
+          "serviceResourceId": "someResourceId",
+          "solution": {
             "identifierType": "cloudRegionId",
             "cloudOwner": "amazon",
-            "identifiers": ["gjhd-098-fhd-987"]
-        },
-        "assignmentInfo": [
-          { "key": "cloudOwner", "value": "amazon" },
-          { "key": "cloudRegionId", "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d" }
-        ]
-      }
+            "identifiers": [
+              "gjhd-098-fhd-987"
+            ]
+          },
+          "assignmentInfo": [
+            {
+              "key": "cloudOwner",
+              "value": "amazon"
+            },
+            {
+              "key": "cloudRegionId",
+              "value": "1ac71fb8-ad43-4e16-9459-c3f372b8236d"
+            }
+          ]
+        }
       ]
     ],
     "licenseSolutions": [
       {
         "resourceModuleName": "vGMuxInfra",
         "serviceResourceId": "someResourceId",
-        "entitlementPoolUUID": ["1ac71fb8-ad43-4e16-9459-c3f372b8236d", "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"],
-        "licenseKeyGroupUUID": ["1ac71fb8-ad43-4e16-9459-c3f372b8236d", "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"],
-        "entitlementPoolInvariantUUID": ["1ac71fb8-ad43-4e16-9459-c3f372b8236d", "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"],
-        "licenseKeyGroupInvariantUUID": ["1ac71fb8-ad43-4e16-9459-c3f372b8236d", "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"]
+        "entitlementPoolUUID": [
+          "1ac71fb8-ad43-4e16-9459-c3f372b8236d",
+          "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"
+        ],
+        "licenseKeyGroupUUID": [
+          "1ac71fb8-ad43-4e16-9459-c3f372b8236d",
+          "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"
+        ],
+        "entitlementPoolInvariantUUID": [
+          "1ac71fb8-ad43-4e16-9459-c3f372b8236d",
+          "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"
+        ],
+        "licenseKeyGroupInvariantUUID": [
+          "1ac71fb8-ad43-4e16-9459-c3f372b8236d",
+          "834fc71fb8-ad43-4fh7-9459-c3f372b8236f"
+        ]
       }
     ]
   }
index da4ef03..ce0b7e3 100644 (file)
       "policyType": "hpaPolicy",
       "flavorFeatures": [
         {
-          "flavorLabel": "flavor_label_vm_01",
+          "id": "vgmux_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": ""},
@@ -34,6 +47,7 @@
               "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"}
@@ -44,6 +58,7 @@
               "mandatory" : "False",
               "score" : "3",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""}
               ]
@@ -52,6 +67,7 @@
               "hpa-feature" : "cpuInstructionSetExtensions",
               "mandatory" : "True",
               "architecture": "INTEL-64",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
               ]
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_02",
+          "id": "vgmux_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"}
               "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-feature" : "pcie",
               "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": ""},
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_03",
+          "id": "vgmux_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-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"}
               "mandatory" : "False",
               "score" : "7",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
               ]
index f50ed6d..4dfb6ce 100644 (file)
       "policyType": "hpaPolicy",
       "flavorFeatures": [
         {
-          "flavorLabel": "flavor_label_vm_01",
+          "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": ""},
@@ -34,6 +47,7 @@
               "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"}
@@ -44,6 +58,7 @@
               "mandatory" : "False",
               "score" : "3",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key":"dataProcessingAccelerationLibrary", "hpa-attribute-value":"ovsDpdk_version", "operator": "=", "unit":""}
               ]
@@ -52,6 +67,7 @@
               "hpa-feature" : "cpuInstructionSetExtensions",
               "mandatory" : "True",
               "architecture": "INTEL-64",
+              "directives": [],
               "hpa-feature-attributes": [
                 {"hpa-attribute-key":"instructionSetExtensions", "hpa-attribute-value":["<CPUINST>", "<CPUINST>"], "operator": "ALL", "unit":""}
               ]
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_02",
+          "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"}
               "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-feature" : "pcie",
               "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": ""},
           ]
         },
         {
-          "flavorLabel": "flavor_label_vm_03",
+          "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-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"}
               "mandatory" : "False",
               "score" : "7",
               "architecture": "generic",
+              "directives": [],
               "hpa-feature-attributes": [
                  {"hpa-attribute-key": "memoryPageSize", "hpa-attribute-value": "<MEMORYPAGESIZE>", "operator": "=", "unit": ""}
               ]