1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
14 The OOF(ONAP Optimization Framework) retrieves applicable constraints and objective functions as policies from the policy platform. These policies are retrieved at runtime, thus allowing an operator to change policies as and when needed. These policies are specified using policy models that are on-boarded during the OOF application deployment-time in the policy platform. The OOF-related policy models are typically derived from the constraints and objective functions of an OOF-application. Currently, for R2, these models will be pushed into the policy platform manually using the OOF policy uploaded module.
15 Below is an example using HPA (Hardware Platform Awareness).
17 Updating Policy Models
18 ^^^^^^^^^^^^^^^^^^^^^^
20 The following HPA TOSCA policy models need to be uploaded as a dictionary during the deployment-time of an optimization application. Currently, the model uploading process is manual since the policy system does not offer an interface to upload models programmatical. Once the models are uploaded, policy templates are created in the policy portal/GUI using which optimization policies can be created. Alternatively, the policy system offers CRUD REST APIs using which the policies can be managed by the application.
26 tosca_definitions_version: tosca_simple_yaml_1_0_0
28 policy.nodes.hpaPolicy:
29 derived_from: policy.nodes.Root
33 description: scope where the policy is applicable
40 description: type of a policy
58 - type: policy.data.flavorFeatures_properties
60 policy.data.flavorFeatures_properties:
61 derived_from: tosca.nodes.Root
70 - type: policy.data.flavorProperties_properties
71 policy.data.flavorProperties_properties:
72 derived_from: tosca.nodes.Root
89 hpa-feature-attributes:
93 - type: policy.data.hpa-feature-attributes_properties
94 policy.data.hpa-feature-attributes_properties:
95 derived_from: tosca.nodes.Root
124 The POLICY Dictionary tab is used to create and manage attributes in the dictionaries.
126 1. Access to the POLICY GUI via the ONAP Portal. Select Dictionary on the left side.
127 2. Select Policy Type Dictionary. you need choose the Optimization Policy.
128 3. Select Dictionary. you need Select ONAP Optimization Models.
129 4. Click Import Dictionary's button, upload the HPA Policy file.
131 The image below shows an example of an uploaded policy.
133 .. image:: OofHpa_dictionary.png
135 Creating HPA Policies
136 ^^^^^^^^^^^^^^^^^^^^^
138 There are two options for creating policies: (1) through the GUI and (2) through the restful API.
145 1. Select editor, right click a scope and choose create policy
146 2. Choose Config under Policy Type
147 3. Choose Optimization under Optimization
148 4. Enter all required fields I for common Config Policy Type:
151 * Onap Name - Name of the source of the requests
156 * Optimization Model: choose hpaPolicy
157 * Optimization Model Version: CSIT
159 5. Enter all required fields II about specified Optimization Config Policy Type:
160 6. Click validate, then save
163 Below is an example of a policy that uses the HPA feature: hpaPolicy_vGmuxInfra.
165 .. image:: OofHpa_create1.png
167 .. image:: OofHpa_create2.png
172 To create the policy, use the PUT /createPolicy API.
173 The request should be in the following form for the Optimization policy:
176 :caption: HPA Policy Json file
180 "service": "hpaPolicy",
181 "policyName": "hpaPolicy_vGMuxInfra",
182 "description": "HPA policy for vGMuxInfra",
183 "templateVersion": "0.0.1",
186 "riskType": "SampleRiskType",
189 "Optimization Model" : "hpaPolicy",
190 "Optimization Model Version": "CSIT",
192 "resources": "vGMuxInfra",
193 "identity": "hpaPolicy_vGMuxInfra",
194 "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra"],
195 "policyType": "hpaPolicy",
198 "flavorLabel": "flavor_label_vm_01",
201 "hpa-feature" : "cpuTopology",
202 "mandatory" : "True",
203 "architecture": "generic",
205 "hpa-feature-attributes": [
206 {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "2","operator": ">=", "unit": ""}
219 Use the Push tab to push the policy and make it active on the pdp-x.
221 1. From the web, select Push tab
222 2. Select the polices
224 4. Click the Push Polices button
226 A message will be displayed indicatng a successful push.
228 .. image:: OofHpa_push.png
231 Semantics of Policy attributes
232 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
235 :caption: HPA Feature Attributes Semantics
237 "hpa-feature-attributes": [
239 "hpa-attribute-key": "{attribute name}",
240 "hpa-attribute-value": "{attribute value}",
241 "operator": "{comparison operator}",
242 "unit": "{the unit of an attribute}"
249 "hpa-feature-attributes": [
250 {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "2","operator": ">=", "unit": ""},
251 {"hpa-attribute-key":"numCpuSockets", "hpa-attribute-value": "4","operator": "<=", "unit": ""},
252 {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "2", "operator":">=", "unit": ""},
253 {"hpa-attribute-key":"numCpuCores", "hpa-attribute-value": "4", "operator":"<=", "unit": ""},
254 {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "4", "operator":">=", "unit": ""},
255 {"hpa-attribute-key":"numCpuThreads", "hpa-attribute-value": "8", "operator":"<=", "unit": ""}
259 .. seealso:: `Policy Specification and Retrieval for OOF <oofSpec.html>`_
264 .. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Policy+OOF+HPA