update link to upper-constraints.txt
[integration.git] / docs / docs_vfwHPA.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2018 ONAP
4
5 .. _docs_vfw_hpa:
6
7 :orphan:
8
9 vFW/vDNS with HPA Tutorial: Setting Up and Configuration
10 --------------------------------------------------------
11
12 Description
13 ~~~~~~~~~~~
14 This use case makes modifications to the regular vFW use case in ONAP by giving the VMs certain hardware features (such as SRIOV NIC, CPU pinning, pci passthrough.. etc.) in order to enhance their performance. Multiple cloud regions with flavors that have HPA features are registered with ONAP. We then create policies that specify the HPA requirements of each VM in the use case. When a service instance is created with OOF specified as the homing solution, OOF responds with the homing solution (cloud region) and flavor directives that meet the requirements specified in the policy.
15 This tutorial covers enhancements 1 to 5 in Background of https://wiki.onap.org/pages/viewpage.action?pageId=41421112. It focuses on Test Plan 1.
16
17 **Useful Links**
18
19 `HPA Test Plan Page <https://wiki.onap.org/pages/viewpage.action?pageId=41421112>`_
20
21 `HPA Enhancements Page <https://wiki.onap.org/pages/viewpage.action?pageId=34376310>`_
22
23 `vFW with HPA Test Status Page <https://wiki.onap.org/pages/viewpage.action?pageId=45301960>`_
24
25
26 `Hardware Platform Enablement in ONAP <https://wiki.onap.org/display/DW/Hardware+Platform+Enablement+In+ONAP>`_
27
28
29
30 Setting Up and Installation
31 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 Some fixes for HPA support were made subsequent to the release of the Casablanca images.  Several updated docker images need to be used to utilize the fixes.  The details of the docker images that need to be used and the issues that are fixed are described at this link https://wiki.onap.org/display/DW/Docker+image+updates+for+HPA+vFW+testing
33
34 Instructions for updating the manifest of ONAP docker images can be found here:  https://onap.readthedocs.io/en/casablanca/submodules/integration.git/docs/#deploying-an-updated-docker-manifest
35
36 Install OOM ONAP using the deploy script in the integration repo. Instructions for this can be found in this link https://wiki.onap.org/display/DW/OOM+Component. When the installation is complete (all the pods are either in running or completed state) Do the following;
37
38
39 1. Check that all the required components were deployed;
40
41  ``oom-rancher# helm list``
42
43 2. Check the state of the pods;
44
45    ``oom-rancher# kubectl get pods -n onap``
46
47 3. Run robot health check
48
49    ``oom-rancher# cd oom/kubernetes/robot``
50
51    ``oom-rancher# ./ete-k8s.sh onap health``
52
53    Ensure all the required components pass the health tests
54 4. Modify the SO bpmn configmap to change the SO vnf adapter endpoint to v2
55
56    ``oom-rancher#    kubectl -n onap edit configmap dev-so-so-bpmn-infra-app-configmap``
57
58                         ``- vnf:``
59
60                                   ``endpoint: http://so-openstack-adapter.onap:8087/services/VnfAdapter``
61
62                                   ``rest:``
63
64                                     ``endpoint: http://so-openstack-adapter.onap:8087/services/rest/v1/vnfs``
65                          
66                         ``+ vnf:``
67
68                                   ``endpoint: http://so-openstack-adapter.onap:8087/services/VnfAdapter``
69
70                                   ``rest:``
71
72                                     ``endpoint: http://so-openstack-adapter.onap:8087/services/rest/v2/vnfs`` 
73
74    Then delete the bpmn pod
75
76    ``oom-rancher#  kubectl delete <pod-name> -n onap``
77
78
79 5. Create HPA flavors in cloud regions to be registered with ONAP. All HPA flavor names must start with onap. During our tests, 3 cloud regions were registered and we created flavors in each cloud. The flavors match the flavors described in the test plan `here <https://wiki.onap.org/pages/viewpage.action?pageId=41421112>`_.
80
81 - **Cloud Region One**
82
83     **Flavor11**
84      ``#nova flavor-create onap.hpa.flavor11 111 8 20 2``
85
86      ``#nova flavor-key onap.hpa.flavor11 set hw:mem_page_size=2048``
87
88     **Flavor12**
89      ``#nova flavor-create onap.hpa.flavor12 112 12 20 2``
90
91      ``#nova flavor-key onap.hpa.flavor12 set hw:mem_page_size=2048``
92
93      ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:3 aggr121``
94
95      ``#openstack flavor set onap.hpa.flavor12 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:3``
96
97     **Flavor13**
98      ``#nova flavor-create onap.hpa.flavor13 113 12 20 2``
99
100      ``#nova flavor-key onap.hpa.flavor13 set hw:mem_page_size=2048``
101
102      ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:1 aggr131``
103
104      ``#openstack flavor set onap.hpa.flavor13 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:1``
105
106 - **Cloud Region Two**
107
108     **Flavor21**
109      ``#nova flavor-create onap.hpa.flavor21 221 8 20 2``
110
111      ``#nova flavor-key onap.hpa.flavor21 set hw:mem_page_size=2048``
112
113      ``#nova flavor-key onap.hpa.flavor21 set hw:cpu_policy=dedicated``
114
115      ``#nova flavor-key onap.hpa.flavor21 set hw:cpu_thread_policy=isolate``
116
117     **Flavor22**
118      ``#nova flavor-create onap.hpa.flavor22 222 12 20 2``
119
120      ``#nova flavor-key onap.hpa.flavor22 set hw:mem_page_size=2048``
121
122      ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:2 aggr221``
123
124      ``#openstack flavor set onap.hpa.flavor22 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:2``
125
126     **Flavor23**
127      ``#nova flavor-create onap.hpa.flavor23 223 12 20 2``
128
129      ``#nova flavor-key onap.hpa.flavor23 set hw:mem_page_size=2048``
130
131      ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:2 aggr231``
132
133      ``#openstack flavor set onap.hpa.flavor23 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:2``
134
135 - **Cloud Region Three**
136
137     **Flavor31**
138      ``#nova flavor-create onap.hpa.flavor31 331 8 20 2``
139
140      ``#nova flavor-key onap.hpa.flavor31 set hw:mem_page_size=2048``
141
142      ``#nova flavor-key onap.hpa.flavor31 set hw:cpu_policy=dedicated``
143
144      ``#nova flavor-key onap.hpa.flavor31 set hw:cpu_thread_policy=isolate``
145
146     **Flavor32**
147      ``#nova flavor-create onap.hpa.flavor32 332 8192 20 2``
148
149      ``#nova flavor-key onap.hpa.flavor32 set hw:mem_page_size=1048576``
150
151     **Flavor33**
152      ``#nova flavor-create onap.hpa.flavor33 333 12 20 2``
153
154      ``#nova flavor-key onap.hpa.flavor33 set hw:mem_page_size=2048``
155
156      ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:1 aggr331``
157
158      ``#openstack flavor set onap.hpa.flavor33 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:1``
159
160 **Note: Use case can be run manually or using automation script (recommended)**
161
162
163 After completing steps 1 to 5 above, the use case can be set up either manually using **step 6 to 21** below or using the hpa automation script in the integration repo. It can be found in this `link <https://github.com/onap/integration/tree/master/test/hpa_automation/heat>`_. The automation script is not limited to the vFW use case, it can also be used for vDNS and should ideally work with other hpa use cases such as vIPSEC. Instructions for running the script can be found in the README file in the link above. Note that the identity and policy name must be different for all the policies in the policy engine.
164
165
166
167 6. Run robot healthdist
168
169    ``oom-rancher# ./ete-k8s.sh onap healthdist``
170 7. Run robot demo init, this initializes the default Demonstration customer and distributes the default models
171
172   ``oom-rancher# ./demo-k8s.sh onap init``
173
174 8. Check that the cloud complex has the right values and update if it does not. Required values are;
175
176     "elevation": "example-elevation-val-28399",
177
178     "lata": "example-lata-val-28399",
179
180     "country": "USA",
181
182     "latitude": "32.89948",
183
184     "longitude": "97.045443",
185
186     "postal-code": "00000
187
188
189 If an update is needed, the update can be done via rest using curl or postman
190
191 ::
192
193     curl -X PUT \
194     https://$ONAP_AAI_IP:$ONAP_AAI_PORT/aai/v14/cloud-infrastructure/complexes/complex/clli1 \
195     -H 'Accept: application/json' \
196     -H 'Authorization: Basic QUFJOkFBSQ==' \
197     -H 'Cache-Control: no-cache' \
198     -H 'Content-Type: application/json' \
199     -H 'Postman-Token: 2b272126-aa65-41e6-aa5d-46bc70b9eb4f' \
200     -H 'Real-Time: true' \
201     -H 'X-FromAppId: jimmy-postman' \
202     -H 'X-TransactionId: 9999' \
203     -d '{
204          "physical-location-id": "clli1",
205          "data-center-code": "example-data-center-code-val-5556",
206          "complex-name": "clli1",
207          "identity-url": "example-identity-url-val-56898",
208          "resource-version": "1543284556407",
209          "physical-location-type": "example-physical-location-type-val-7608",
210          "street1": "example-street1-val-34205",
211          "street2": "example-street2-val-99210",
212          "city": "example-city-val-27150",
213          "state": "example-state-val-59487",
214          "postal-code": "00000",
215          "country": "USA",
216          "region": "example-region-val-13893",
217          "latitude": "32.89948",
218          "longitude": "97.045443",
219          "elevation": "example-elevation-val-28399",
220          "lata": "example-lata-val-28399"
221
222         }'
223
224 9. Register new cloud regions. This can be done using instructions (Step 1 to Step 3) on this `page <https://docs.onap.org/projects/onap-multicloud-framework/en/latest/multicloud-plugin-windriver/UserGuide-MultiCloud-WindRiver-TitaniumCloud.html?highlight=multicloud>`_. The already existing CloudOwner and cloud complex can be used. If step 3 does not work using the k8s ip and external port. It can be done using the internal ip address and port. Exec into any pod and run the command from the pod.
225
226 - Get msb-iag internal ip address and port
227
228  ``oom-rancher#  kubectl get services -n onap |grep msb-iag``
229
230 - Exec into any pod (oof in this case) and run curl command, you may need to install curl
231
232   ``oom-rancher#  kubectl exec dev-oof-oof-6c848594c5-5khps -it -- bash``
233
234 10. Put required subscription list into tenant for all the newly added cloud regions. An easy way to do this is to do a get on the default cloud region, copy the tenant information with the subscription. Then paste it in your put command and modify the region id, tenant-id, tenant-name and resource-version.
235
236 **GET COMMAND**
237
238 ::
239
240     curl -X GET \
241     https://$ONAP_AAI_IP:$ONAP_AAI_PORT/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/${CLOUD_OWNER}/${CLOUD_REGION_ID}?depth=all \
242     -H 'Accept: application/json' \
243     -H 'Authorization: Basic QUFJOkFBSQ==' \
244     -H 'Cache-Control: no-cache' \
245     -H 'Content-Type: application/json' \
246     -H 'Postman-Token: 2899359f-871b-4e61-a307-ecf8b3144e3f' \
247     -H 'Real-Time: true' \
248     -H 'X-FromAppId: jimmy-postman' \
249     -H 'X-TransactionId: 9999'
250
251 **PUT COMMAND**
252 ::
253
254  curl -X PUT \
255     https://{{AAI1_PUB_IP}}:{{AAI1_PUB_PORT}}/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/{{cloud-owner}}/{{cloud-region-id}}/tenants/tenant/{{tenant-id}} \
256     -H 'Accept: application/json' \
257     -H 'Authorization: Basic QUFJOkFBSQ==' \
258     -H 'Cache-Control: no-cache' \
259     -H 'Content-Type: application/json' \
260     -H 'Postman-Token: 2b272126-aa65-41e6-aa5d-46bc70b9eb4f' \
261     -H 'Real-Time: true' \
262     -H 'X-FromAppId: jimmy-postman' \
263     -H 'X-TransactionId: 9999' \
264     -d '{
265                 "tenant-id": "709ba629fe194f8699b12f9d6ffd86a0",
266                 "tenant-name": "Integration-HPA",
267                 "resource-version": "1542650451856",
268                 "relationship-list": {
269                     "relationship": [
270                         {
271                             "related-to": "service-subscription",
272                             "relationship-label": "org.onap.relationships.inventory.Uses",
273                             "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL",
274                             "relationship-data": [
275                                 {
276                                     "relationship-key": "customer.global-customer-id",
277                                     "relationship-value": "Demonstration"
278                                 },
279                                 {
280                                     "relationship-key": "service-subscription.service-type",
281                                     "relationship-value": "vFWCL"
282                                 }
283                             ]
284                         },
285                         {
286                             "related-to": "service-subscription",
287                             "relationship-label": "org.onap.relationships.inventory.Uses",
288                             "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/gNB",
289                             "relationship-data": [
290                                 {
291                                     "relationship-key": "customer.global-customer-id",
292                                     "relationship-value": "Demonstration"
293                                 },
294                                 {
295                                     "relationship-key": "service-subscription.service-type",
296                                     "relationship-value": "gNB"
297                                 }
298                             ]
299                         },
300                         {
301                             "related-to": "service-subscription",
302                             "relationship-label": "org.onap.relationships.inventory.Uses",
303                             "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW",
304                             "relationship-data": [
305                                 {
306                                     "relationship-key": "customer.global-customer-id",
307                                     "relationship-value": "Demonstration"
308                                 },
309                                 {
310                                     "relationship-key": "service-subscription.service-type",
311                                     "relationship-value": "vFW"
312                                 }
313                             ]
314                         },
315                         {
316                             "related-to": "service-subscription",
317                             "relationship-label": "org.onap.relationships.inventory.Uses",
318                             "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE",
319                             "relationship-data": [
320                                 {
321                                     "relationship-key": "customer.global-customer-id",
322                                     "relationship-value": "Demonstration"
323                                 },
324                                 {
325                                     "relationship-key": "service-subscription.service-type",
326                                     "relationship-value": "vCPE"
327                                 }
328                             ]
329                         },
330                         {
331                             "related-to": "service-subscription",
332                             "relationship-label": "org.onap.relationships.inventory.Uses",
333                             "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW_HPA",
334                             "relationship-data": [
335                                 {
336                                     "relationship-key": "customer.global-customer-id",
337                                     "relationship-value": "Demonstration"
338                                 },
339                                 {
340                                     "relationship-key": "service-subscription.service-type",
341                                     "relationship-value": "vFW_HPA"
342                                 }
343                             ]
344                         },
345                         {
346                             "related-to": "service-subscription",
347                             "relationship-label": "org.onap.relationships.inventory.Uses",
348                             "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vLB",
349                             "relationship-data": [
350                                 {
351                                     "relationship-key": "customer.global-customer-id",
352                                     "relationship-value": "Demonstration"
353                                 },
354                                 {
355                                     "relationship-key": "service-subscription.service-type",
356                                     "relationship-value": "vLB"
357                                 }
358                             ]
359                         },
360                         {
361                             "related-to": "service-subscription",
362                             "relationship-label": "org.onap.relationships.inventory.Uses",
363                             "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vIMS",
364                             "relationship-data": [
365                                 {
366                                     "relationship-key": "customer.global-customer-id",
367                                     "relationship-value": "Demonstration"
368                                 },
369                                 {
370                                     "relationship-key": "service-subscription.service-type",
371                                     "relationship-value": "vIMS"
372                                 }
373                             ]
374                         }
375                     ]
376                 }
377             }'
378
379
380 11.  Onboard the vFW HPA template. The templates can be gotten from the `demo <https://github.com/onap/demo>`_ repo. The heat and env files used are located in demo/heat/vFW_HPA/vFW/. Create a zip file using the files. For onboarding instructions see steps 4 to 9 of `vFWCL instantiation, testing and debugging <https://wiki.onap.org/display/DW/vFWCL+instantiation%2C+testing%2C+and+debuging>`_. Note that in step 5, only one VSP is created. For the VSP the option to submit for testing in step 5cii was not shown. So you can check in and certify the VSP and proceed to step 6.
381
382 12. Get the parameters (model info, model invarant id...etc) required to create a service instance via rest. This can be done by creating a service instance via VID as in step 10 of `vFWCL instantiation, testing and debugging <https://wiki.onap.org/display/DW/vFWCL+instantiation%2C+testing%2C+and+debuging>`_.  After creating the service instance, exec into the SO bpmn pod and look into the /app/logs/bpmn/debug.log file. Search for the service instance and look for its request details. Then populate the parameters required to create a service instance via rest in step 13 below.
383
384 13. Create a service instance rest request but do not create service instance yet. Specify OOF as the homing solution and multicloud as the orchestrator. Be sure to use a service instance name that does not exist and populate the parameters with values gotten from step 12.
385
386 ::
387
388     curl -k -X POST \
389     http://{{k8s}}:30277/onap/so/infra/serviceInstances/v6 \
390     -H 'authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== \
391     -H 'content-type: application/json' \
392
393     -d '{
394
395         "requestDetails":{
396
397             "modelInfo":{
398
399                 "modelInvariantId":"b7564cb9-4074-4c9b-95d6-39d4191e80d9",
400
401                 "modelType":"service",
402
403                 "modelName":"vfw_HPA",
404
405                 "modelVersion":"1.0",
406
407                 "modelVersionId":"35d184e8-1cba-46e3-9311-a17ace766eb0",
408
409                 "modelUuid":"35d184e8-1cba-46e3-9311-a17ace766eb0",
410
411                 "modelInvariantUuid":"b7564cb9-4074-4c9b-95d6-39d4191e80d9"
412
413             },
414
415             "requestInfo":{
416
417                 "source":"VID",
418
419                 "instanceName":"oof-12-homing",
420
421                 "suppressRollback":false,
422
423                 "requestorId":"demo"
424
425             },
426
427             "subscriberInfo":{
428
429                 "globalSubscriberId":"Demonstration"
430
431             },
432
433             "requestParameters":{
434
435                 "subscriptionServiceType":"vFW",
436
437                 "aLaCarte":true,
438
439                 "testApi":"VNF_API",
440
441                 "userParams":[
442
443                     {
444
445                         "name":"Customer_Location",
446
447                         "value":{
448
449                             "customerLatitude":"32.897480",
450
451                             "customerLongitude":"97.040443",
452
453                             "customerName":"some_company"
454
455                         }
456
457                     },
458
459                     {
460
461                         "name":"Homing_Solution",
462
463                         "value":"oof"
464
465                     },
466
467                     {
468
469                         "name":"orchestrator",
470
471                         "value":"multicloud"
472
473                     }
474
475                 ]
476
477             },
478
479             "project":{
480
481                 "projectName":"Project-Demonstration"
482
483             },
484
485             "owningEntity":{
486
487                 "owningEntityId":"e1564fc9-b9d0-44f9-b5af-953b4aad2f40",
488
489                 "owningEntityName":"OE-Demonstration"
490
491             }
492
493         }
494
495     }'
496
497 14. Get the resourceModuleName to be used for creating policies. This can be gotten from the CSAR file of the service model created. However, an easy way to get the resourceModuleName is to send the service instance create request in step 13 above. This will fail as there are no policies but you can then go into the bpmn debug.log file and get its value by searching for resourcemodulename.
498
499 15. Create policies. For instructions to do this, look in **method 2 (Manual upload)** of `OOF - HPA guide for integration testing <https://wiki.onap.org/display/DW/OOF+-+HPA+guide+for+integration+testing>`_. Put in the correct resouceModuleName. This is located in the resources section of the rest request. For example the resourceModuleName in the distance policy is 7400fd06C75f4a44A68f.
500
501 16. Do a get to verify all the polcies have been put in correctly. This can be done by doing an exec into the policy-pdp pod and running the following curl command.
502
503 ::
504
505     curl -k -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -X POST -d '{"policyName": "OSDF_CASABLANCA.*", "configAttributes": {"policyScope": "us"}}' 'https://pdp:8081/pdp/api/getConfig' | python -m json.tool
506
507 To Update a policy, use the following curl command. Modify the policy as required
508
509 ::
510
511     curl -k -v  -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
512         "configBody": "{\"service\":\"hpaPolicy\",\"guard\":\"False\",\"content\":{\"flavorFeatures\":[{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"firewall_flavor_name\"}],\"type\":\"flavor_directives\"}],\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"2\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"numVirtualCpu\"},{\"hpa-attribute-value\":\"8\",\"unit\":\"MB\",\"operator\":\"=\",\"hpa-attribute-key\":\"virtualMemSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"},{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"2\",\"unit\":\"MB\",\"operator\":\"=\",\"hpa-attribute-key\":\"memoryPageSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"hugePages\"},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]},{\"mandatory\":\"False\",\"score\":\"100\",\"directives\":[],\"hpa-version\":\"v1\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"1\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"pciCount\"},{\"hpa-attribute-value\":\"8086\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"pciVendorId\"},{\"hpa-attribute-value\":\"37c9\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"pciDeviceId\"}],\"architecture\":\"vf\",\"hpa-feature\":\"pciePassthrough\"}],\"id\":\"vfw\"},{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"packetgen_flavor_name\"}],\"type\":\"flavor_directives\"}],\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"1\",\"operator\":\">=\",\"hpa-attribute-key\":\"numVirtualCpu\"},{\"hpa-attribute-value\":\"7\",\"unit\":\"GB\",\"operator\":\">=\",\"hpa-attribute-key\":\"virtualMemSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]}],\"id\":\"vgenerator\"},{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"sink_flavor_name\"}],\"type\":\"flavor_directives\"}],\"id\":\"vsink\",\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"directives\":[],\"hpa-version\":\"v1\",\"hpa-feature-attributes\":[],\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"}]}],\"policyType\":\"hpa\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"hpa-vFW\",\"resources\":[\"vFW\",\"A5ece5a02e86450391d6\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"HPApolicyforvFW\",\"policyName\":\"OSDF_CASABLANCA.hpa_policy_vFW_1\",\"version\":\"test1\",\"riskType\":\"test\"}",
513         "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_1",
514         "policyConfigType": "MicroService",
515         "onapName": "SampleDemo",
516         "policyScope": "OSDF_CASABLANCA"
517     }' 'https://pdp:8081/pdp/api/updatePolicy'
518
519
520 To delete a policy, use two commands below to delete from PDP and PAP
521
522 **DELETE POLICY INSIDE PDP**
523
524 ::
525
526     curl -k -v -H 'Content-Type: application/json' \
527      -H 'Accept: application/json' \
528      -H 'ClientAuth: cHl0aG9uOnRlc3Q=' \
529      -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' \
530      -H 'Environment: TEST' \
531      -X DELETE \
532      -d '{"policyName": "OSDF_CASABLANCA.Config_MS_vnfPolicy_vFWHPA.1.xml","policyComponent":"PDP","policyType":"MicroService","pdpGroup":"default"}' https://pdp:8081/pdp/api/deletePolicy
533
534
535 **DELETE POLICY INSIDE PAP**
536
537 ::
538
539     curl -k -v -H 'Content-Type: application/json' \
540     -H 'Accept: application/json' \
541     -H 'ClientAuth: cHl0aG9uOnRlc3Q=' \
542     -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' \
543     -H 'Environment: TEST' \
544     -X DELETE \
545     -d '{"policyName": "OSDF_CASABLANCA.Config_MS_vnfPolicy_vFWHPA.1.xml","policyComponent":"PAP","policyType":"Optimization","deleteCondition":"ALL"}' https://pdp:8081/pdp/api/deletePolicy
546
547 Below are the 3 HPA policies for test cases in the `test plan <https://wiki.onap.org/pages/viewpage.action?pageId=41421112>`_
548
549 **Test 1 (Basic)**
550
551 Create Policy
552
553 ::
554
555     curl -k -v  -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
556         "configBody": "{\"service\":\"hpaPolicy\",\"guard\":\"False\",\"content\":{\"flavorFeatures\":[{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"firewall_flavor_name\"}],\"type\":\"flavor_directives\"}],\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"2\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"numVirtualCpu\"},{\"hpa-attribute-value\":\"8\",\"unit\":\"MB\",\"operator\":\"=\",\"hpa-attribute-key\":\"virtualMemSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"},{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"2\",\"unit\":\"MB\",\"operator\":\"=\",\"hpa-attribute-key\":\"memoryPageSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"hugePages\"},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]},{\"mandatory\":\"False\",\"score\":\"100\",\"directives\":[],\"hpa-version\":\"v1\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"isolate\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"logicalCpuThreadPinningPolicy\"},{\"hpa-attribute-value\":\"dedicated\",\"unit\":\"\",\"operator\":\"=\",\"hpa-attribute-key\":\"logicalCpuPinningPolicy\"}],\"architecture\":\"generic\",\"hpa-feature\":\"cpuPinning\"}],\"id\":\"vfw\"},{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"packetgen_flavor_name\"}],\"type\":\"flavor_directives\"}],\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"hpa-feature-attributes\":[{\"hpa-attribute-value\":\"1\",\"operator\":\">=\",\"hpa-attribute-key\":\"numVirtualCpu\"},{\"hpa-attribute-value\":\"7\",\"unit\":\"GB\",\"operator\":\">=\",\"hpa-attribute-key\":\"virtualMemSize\"}],\"directives\":[],\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]}],\"id\":\"vgenerator\"},{\"directives\":[{\"attributes\":[{\"attribute_value\":\"\",\"attribute_name\":\"sink_flavor_name\"}],\"type\":\"flavor_directives\"}],\"id\":\"vsink\",\"type\":\"vnfc\",\"flavorProperties\":[{\"mandatory\":\"True\",\"directives\":[],\"hpa-version\":\"v1\",\"hpa-feature-attributes\":[],\"architecture\":\"generic\",\"hpa-feature\":\"basicCapabilities\"}]}],\"policyType\":\"hpa\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"hpa-vFW\",\"resources\":[\"vFW\",\"VfwHpa\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"HPApolicyforvFW\",\"policyName\":\"OSDF_CASABLANCA.hpa_policy_vFWHPA_1\",\"version\":\"test1\",\"riskType\":\"test\"}",
557         "policyName": "OSDF_CASABLANCA.hpa_policy_vFWHPA_1",
558         "policyConfigType": "MicroService",
559         "onapName": "SampleDemo",
560         "policyScope": "OSDF_CASABLANCA"
561     }' 'https://pdp:8081/pdp/api/createPolicy'
562
563
564 Push Policy
565
566 ::
567
568         curl -k -v  -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
569         "pdpGroup": "default",
570         "policyName": "OSDF_CASABLANCA.hpa_policy_vFWHPA_1",
571         "policyType": "MicroService"
572         }' 'https://pdp:8081/pdp/api/pushPolicy'
573
574
575
576
577 **Test 2:  (to test SRIOV-NIC feature) (to ensure that right cloud-region is selected based on score)**
578
579 Create Policy
580
581 ::
582
583     curl -k -v  -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
584     "configBody": "{\"service\":\"hpaPolicy\",\"guard\":\"False\",\"content\":{\"flavorFeatures\":[{\"id\":\"vfw\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"firewall_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"True\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vfw_private_0_port_vnic_type\",\"attribute_value\":\"direct\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"private-1\",\"operator\":\"=\"}]}]},{\"id\":\"vgenerator\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"packetgen_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"True\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vpg_private_0_port_vnic_type\",\"attribute_value\":\"direct\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"3\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"shared-1\",\"operator\":\"=\"}]}]},{\"id\":\"vsink\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"sink_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"True\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vsn_private_0_port_vnic_type\",\"attribute_value\":\"direct\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\",\"unit\":\"\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"private-1\",\"operator\":\"=\"}]}]}],\"policyType\":\"hpa\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"hpa-vFW\",\"resources\":[\"vFW\",\"A5ece5a02e86450391d6\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"HPApolicyforvFW\",\"policyName\":\"OSDF_CASABLANCA.hpa_policy_vFW_2\",\"version\":\"test1\",\"riskType\":\"test\"}",
585     "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_2",
586     "policyConfigType": "MicroService",
587     "onapName": "SampleDemo",
588     "policyScope": "OSDF_CASABLANCA"
589     }' 'https://pdp:8081/pdp/api/createPolicy'
590
591
592 Push Policy
593
594 ::
595
596             curl -k -v  -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
597     "pdpGroup": "default",
598     "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_2",
599     "policyType": "MicroService"
600     }' 'https://pdp:8081/pdp/api/pushPolicy'
601
602
603 **Test 3 (to ensure that right cloud-region is selected based on score)**
604
605 Create Policy
606
607 ::
608
609         curl -k -v  -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
610         "configBody": "{\"service\":\"hpaPolicy\",\"guard\":\"False\",\"content\":{\"flavorFeatures\":[{\"id\":\"vfw\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"firewall_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"sriovNICNetwork\",\"hpa-version\":\"v1\",\"architecture\":\"intel\",\"mandatory\":\"False\",\"score\":\"100\",\"directives\":[{\"type\":\"sriovNICNetwork_directives\",\"attributes\":[{\"attribute_name\":\"vfw_private_0_port_vnic_type\",\"attribute_value\":\"direct\"}]}],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"pciCount\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciVendorId\",\"hpa-attribute-value\":\"8086\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"pciDeviceId\",\"hpa-attribute-value\":\"154C\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"physicalNetwork\",\"hpa-attribute-value\":\"shared-1\",\"operator\":\"=\"}]},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]},{\"hpa-feature\":\"hugePages\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"memoryPageSize\",\"hpa-attribute-value\":\"2\",\"operator\":\"=\",\"unit\":\"MB\"}]},{\"hpa-feature\":\"basicCapabilities\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"numVirtualCpu\",\"hpa-attribute-value\":\"2\",\"operator\":\"=\"},{\"hpa-attribute-key\":\"virtualMemSize\",\"hpa-attribute-value\":\"8\",\"operator\":\"=\",\"unit\":\"MB\"}]}]},{\"id\":\"vgenerator\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"packetgen_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"hugePages\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"False\",\"score\":\"200\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"memoryPageSize\",\"hpa-attribute-value\":\"1\",\"operator\":\"=\",\"unit\":\"GB\"}]},{\"hpa-feature\":\"localStorage\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"diskSize\",\"hpa-attribute-value\":\"10\",\"operator\":\">=\",\"unit\":\"GB\"}]},{\"hpa-feature\":\"basicCapabilities\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[{\"hpa-attribute-key\":\"numVirtualCpu\",\"hpa-attribute-value\":\"1\",\"operator\":\">=\"},{\"hpa-attribute-key\":\"virtualMemSize\",\"hpa-attribute-value\":\"2\",\"operator\":\">=\",\"unit\":\"GB\"}]}]},{\"id\":\"vsink\",\"type\":\"vnfc\",\"directives\":[{\"type\":\"flavor_directives\",\"attributes\":[{\"attribute_name\":\"sink_flavor_name\",\"attribute_value\":\"\"}]}],\"flavorProperties\":[{\"hpa-feature\":\"basicCapabilities\",\"hpa-version\":\"v1\",\"architecture\":\"generic\",\"mandatory\":\"True\",\"directives\":[],\"hpa-feature-attributes\":[]}]}],\"policyType\":\"hpa\",\"policyScope\":[\"vfw\",\"us\",\"international\",\"ip\"],\"identity\":\"hpa-vFW\",\"resources\":[\"vFW\",\"A5ece5a02e86450391d6\"]},\"priority\":\"3\",\"templateVersion\":\"OpenSource.version.1\",\"riskLevel\":\"2\",\"description\":\"HPApolicyforvFW\",\"policyName\":\"OSDF_CASABLANCA.hpa_policy_vFW_3\",\"version\":\"test1\",\"riskType\":\"test\"}",
611         "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_3",
612         "policyConfigType": "MicroService",
613         "onapName": "SampleDemo",
614         "policyScope": "OSDF_CASABLANCA"
615     }' 'https://pdp:8081/pdp/api/createPolicy'
616
617 Push Policy
618
619 ::
620
621                 curl -k -v  -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
622     "pdpGroup": "default",
623     "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_3",
624     "policyType": "MicroService"
625     }' 'https://pdp:8081/pdp/api/pushPolicy'
626
627 17. Create Service Instance using step 13 above
628
629 18. Check bpmn logs to ensure that OOF sent homing response and flavor directives.
630
631 19. Create vnf using VID as in 10f and 10g in `vFWCL instantiation, testing and debugging <https://wiki.onap.org/display/DW/vFWCL+instantiation%2C+testing%2C+and+debuging>`_.
632
633 20. Do SDNC Preload. Instructions for this can be found in this `video <https://wiki.onap.org/display/DW/Running+the+ONAP+Demos?preview=/1015891/16010290/vFW_closed_loop.mp4>`_ (Fast forward to 3:55 in the video). The contents of my preload file are shown below;
634
635 ::
636
637     {
638         "input": {
639             "request-information": {
640                 "notification-url": "openecomp.org",
641                 "order-number": "1",
642                 "order-version": "1",
643                 "request-action": "PreloadVNFRequest",
644                 "request-id": "test"
645             },
646             "sdnc-request-header": {
647                 "svc-action": "reserve",
648                 "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
649                 "svc-request-id": "test"
650             },
651             "vnf-topology-information": {
652                 "vnf-assignments": {
653                     "availability-zones": [],
654                     "vnf-networks": [],
655                     "vnf-vms": []
656                 },
657
658
659                 "vnf-parameters": [
660                             {
661                         "vnf-parameter-name": "vfw_image_name",
662                         "vnf-parameter-value": "ubuntu-16.04"
663                     },
664                                 {
665                         "vnf-parameter-name": "firewall_flavor_name",
666                         "vnf-parameter-value": "m1.large"
667                     },
668                                  {
669                         "vnf-parameter-name": "sink_flavor_name",
670                         "vnf-parameter-value": "m1.medium"
671                     },
672                                  {
673                         "vnf-parameter-name": "packetgen_flavor_name",
674                         "vnf-parameter-value": "m1.large"
675                     },
676                     {
677                         "vnf-parameter-name": "public_net_id",
678                         "vnf-parameter-value": "external"
679                     },
680                                  {
681                         "vnf-parameter-name": "unprotected_private_net_id",
682                         "vnf-parameter-value": "unprotected_private_net"
683                     },
684                                 {
685                         "vnf-parameter-name": "protected_private_net_id",
686                         "vnf-parameter-value": "protected_private_net"
687                     },
688                     {
689                         "vnf-parameter-name": "onap_private_net_id",
690                         "vnf-parameter-value": "oam_onap_vnf_test"
691                     },
692                     {
693                         "vnf-parameter-name": "onap_private_subnet_id",
694                         "vnf-parameter-value": "oam_onap_vnf_test"
695                     },
696                                 {
697                         "vnf-parameter-name": "unprotected_private_net_cidr",
698                         "vnf-parameter-value": "192.168.10.0/24"
699                     },
700                                 {
701                         "vnf-parameter-name": "protected_private_net_cidr",
702                         "vnf-parameter-value": "192.168.20.0/24"
703                     },
704                                 {
705                         "vnf-parameter-name": "onap_private_net_cidr",
706                         "vnf-parameter-value": "10.0.0.0/16"
707                     },
708                                 {
709                         "vnf-parameter-name": "vfw_private_ip_0",
710                         "vnf-parameter-value": "192.168.10.100"
711                     },
712                                 {
713                         "vnf-parameter-name": "vfw_private_ip_1",
714                         "vnf-parameter-value": "192.168.20.100"
715                     },
716                                 {
717                         "vnf-parameter-name": "vfw_private_ip_2",
718                         "vnf-parameter-value": "10.0.100.1"
719                     },
720                                 {
721                         "vnf-parameter-name": "vpg_private_ip_0",
722                         "vnf-parameter-value": "192.168.10.200"
723                     },
724                                 {
725                         "vnf-parameter-name": "vpg_private_ip_1",
726                         "vnf-parameter-value": "10.0.100.2"
727                     },
728                                 {
729                         "vnf-parameter-name": "vsn_private_ip_0",
730                         "vnf-parameter-value": "192.168.20.250"
731                     },
732                                 {
733                         "vnf-parameter-name": "vsn_private_ip_1",
734                         "vnf-parameter-value": "10.0.100.3"
735                     },
736
737                                 {
738                         "vnf-parameter-name": "vfw_name_0",
739                         "vnf-parameter-value": "vfw"
740                     },
741                                 {
742                         "vnf-parameter-name": "vpg_name_0",
743                         "vnf-parameter-value": "vpktgen"
744                     },
745                                 {
746                         "vnf-parameter-name": "vsn_name_0",
747                         "vnf-parameter-value": "vsink"
748                     },
749                                 {
750                         "vnf-parameter-name": "vfw_private_0_port_vnic_type",
751                         "vnf-parameter-value": "normal"
752                     },
753                                 {
754                         "vnf-parameter-name": "vfw_private_1_port_vnic_type",
755                         "vnf-parameter-value": "normal"
756                     },
757                                 {
758                         "vnf-parameter-name": "vfw_private_2_port_vnic_type",
759                         "vnf-parameter-value": "normal"
760                     },
761                                 {
762                         "vnf-parameter-name": "vpg_private_0_port_vnic_type",
763                         "vnf-parameter-value": "normal"
764                     },
765                                 {
766                         "vnf-parameter-name": "vpg_private_1_port_vnic_type",
767                         "vnf-parameter-value": "normal"
768                     },
769                                 {
770                         "vnf-parameter-name": "vsn_private_0_port_vnic_type",
771                         "vnf-parameter-value": "normal"
772                     },
773                                 {
774                         "vnf-parameter-name": "vsn_private_1_port_vnic_type",
775                         "vnf-parameter-value": "normal"
776                     },
777                     {
778                         "vnf-parameter-name": "vf_module_id",
779                         "vnf-parameter-value": "VfwHpa..base_vfw..module-0"
780                     },
781                     {
782                         "vnf-parameter-name": "sec_group",
783                         "vnf-parameter-value": "default"
784                     },
785                     {
786                         "vnf-parameter-name": "sdnc_model_name",
787                         "vnf-parameter-value": ""
788                     },
789                      {
790                         "vnf-parameter-name": "sdnc_model_version",
791                         "vnf-parameter-value": ""
792                     },
793                     {
794                         "vnf-parameter-name": "sdnc_artifact_name",
795                         "vnf-parameter-value": ""
796                     },
797
798                     {
799                         "vnf-parameter-name": "oof_directives",
800                         "vnf-parameter-value": "{\"directives\": [{\"id\": \"vfw\", \"type\": \"vnfc\", \"directives\": [{\"attributes\": [{\"attribute_name\": \"firewall_flavor_name\", \"attribute_value\": \"onap.hpa.flavor31\"}, {\"attribute_name\": \"flavorId\", \"attribute_value\": \"2297339f-6a89-4808-a78f-68216091f904\"}, {\"attribute_name\": \"flavorId\", \"attribute_value\": \"2297339f-6a89-4808-a78f-68216091f904\"}, {\"attribute_name\": \"flavorId\", \"attribute_value\": \"2297339f-6a89-4808-a78f-68216091f904\"}], \"type\": \"flavor_directives\"}]}, {\"id\": \"vgenerator\", \"type\": \"vnfc\", \"directives\": [{\"attributes\": [{\"attribute_name\": \"packetgen_flavor_name\", \"attribute_value\": \"onap.hpa.flavor32\"}, {\"attribute_name\": \"flavorId\", \"attribute_value\": \"2297339f-6a89-4808-a78f-68216091f904\"}], \"type\": \"flavor_directives\"}]}, {\"id\": \"vsink\", \"type\": \"vnfc\", \"directives\": [{\"attributes\": [{\"attribute_name\": \"sink_flavor_name\", \"attribute_value\": \"onap.large\"}, {\"attribute_name\": \"flavorId\", \"attribute_value\": \"2297339f-6a89-4808-a78f-68216091f904\"}], \"type\": \"flavor_directives\"}]}]}"
801                    },
802
803                    {
804                         "vnf-parameter-name": "sdnc_directives",
805                         "vnf-parameter-value": "{}"
806                     },
807
808                     {
809                         "vnf-parameter-name": "template_type",
810                         "vnf-parameter-value": "heat"
811                     }
812
813
814                 ],
815                 "vnf-topology-identifier": {
816                     "generic-vnf-name": "oof-12-vnf-3",
817                     "generic-vnf-type": "vfw_hpa 0",
818                     "service-type": "6b17354c-0fae-4491-b62e-b41619929c54",
819                     "vnf-name": "vfwhpa_stack",
820                     "vnf-type": "VfwHpa..base_vfw..module-0"
821
822                 }
823             }
824         }}
825
826
827 Change parameters based on your environment.
828
829 **Note**
830
831 ::
832
833     "generic-vnf-name": "oof-12-vnf-3",     <-- NAME GIVEN TO VNF
834     "generic-vnf-type": "vfw_hpa 0",   <-- can be found on VNF dialog screen get the part of the VNF-TYPE after the '/'
835     "service-type": "6b17354c-0fae-4491-b62e-b41619929c54",  <-- same as Service Instance ID
836     "vnf-name": "vfwhpa_stack",  <-- name to be given to the vf module
837     "vnf-type": "VfwHpa..base_vfw..module-0" <-- can be found on the VID - VF Module dialog screen - Model Name
838
839 21. Create vf module (11g of `vFWCL instantiation, testing and debugging <https://wiki.onap.org/display/DW/vFWCL+instantiation%2C+testing%2C+and+debuging>`_). If everything worked properly, you should see the stack created in your VIM(WR titanium cloud openstack in this case).