blob: 147d80d2a1f9fd3bc036377287fa2562bb29de55 [file] [log] [blame]
Gary Wue4a2df82018-11-29 12:49:09 -08001.. 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
mrichommee4643892020-11-30 18:31:29 +01007:orphan:
8
Itohanf54cbc12019-06-19 10:19:27 -07009vFW/vDNS with HPA Tutorial: Setting Up and Configuration
10--------------------------------------------------------
Gary Wue4a2df82018-11-29 12:49:09 -080011
12Description
mrichommeefb859d2020-03-19 19:02:41 +010013~~~~~~~~~~~
Gary Wue4a2df82018-11-29 12:49:09 -080014This 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.
15This 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
mrichommea958b982020-04-13 18:46:35 +020023`vFW with HPA Test Status Page <https://wiki.onap.org/pages/viewpage.action?pageId=45301960>`_
Gary Wue4a2df82018-11-29 12:49:09 -080024
25
26`Hardware Platform Enablement in ONAP <https://wiki.onap.org/display/DW/Hardware+Platform+Enablement+In+ONAP>`_
27
28
29
30Setting Up and Installation
mrichommeefb859d2020-03-19 19:02:41 +010031~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gary Wue4a2df82018-11-29 12:49:09 -080032
Michal Jagielloeaebcef2022-11-10 08:41:22 +000033Install OOM ONAP using the deploy script in the integration repo. Instructions for this can be found in this link https://docs.onap.org/projects/onap-oom/en/latest/sections/guides/deployment_guides/oom_deployment.html. When the installation is complete (all the pods are either in running or completed state) Do the following;
Gary Wue4a2df82018-11-29 12:49:09 -080034
35
361. Check that all the required components were deployed;
mrichommeefb859d2020-03-19 19:02:41 +010037
Gary Wue4a2df82018-11-29 12:49:09 -080038 ``oom-rancher# helm list``
39
402. Check the state of the pods;
41
42 ``oom-rancher# kubectl get pods -n onap``
43
443. Run robot health check
45
mrichommeefb859d2020-03-19 19:02:41 +010046 ``oom-rancher# cd oom/kubernetes/robot``
Gary Wue4a2df82018-11-29 12:49:09 -080047
48 ``oom-rancher# ./ete-k8s.sh onap health``
49
50 Ensure all the required components pass the health tests
514. Modify the SO bpmn configmap to change the SO vnf adapter endpoint to v2
mrichommeefb859d2020-03-19 19:02:41 +010052
53 ``oom-rancher# kubectl -n onap edit configmap dev-so-so-bpmn-infra-app-configmap``
Gary Wue4a2df82018-11-29 12:49:09 -080054
55 ``- vnf:``
56
57           ``endpoint: http://so-openstack-adapter.onap:8087/services/VnfAdapter``
58
59           ``rest:``
60
61             ``endpoint: http://so-openstack-adapter.onap:8087/services/rest/v1/vnfs``
62  
63 ``+ vnf:``
64
65           ``endpoint: http://so-openstack-adapter.onap:8087/services/VnfAdapter``
66
67           ``rest:``
68
69             ``endpoint: http://so-openstack-adapter.onap:8087/services/rest/v2/vnfs`` 
70
71 Then delete the bpmn pod
72
73 ``oom-rancher# kubectl delete <pod-name> -n onap``
74
Gary Wue4a2df82018-11-29 12:49:09 -080075
mrichommeefb859d2020-03-19 19:02:41 +0100765. 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>`_.
Gary Wue4a2df82018-11-29 12:49:09 -080077
78- **Cloud Region One**
79
80 **Flavor11**
81 ``#nova flavor-create onap.hpa.flavor11 111 8 20 2``
82
83 ``#nova flavor-key onap.hpa.flavor11 set hw:mem_page_size=2048``
mrichommeefb859d2020-03-19 19:02:41 +010084
Gary Wue4a2df82018-11-29 12:49:09 -080085 **Flavor12**
86 ``#nova flavor-create onap.hpa.flavor12 112 12 20 2``
87
88 ``#nova flavor-key onap.hpa.flavor12 set hw:mem_page_size=2048``
89
90 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:3 aggr121``
91
92 ``#openstack flavor set onap.hpa.flavor12 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:3``
mrichommeefb859d2020-03-19 19:02:41 +010093
Gary Wue4a2df82018-11-29 12:49:09 -080094 **Flavor13**
mrichommeefb859d2020-03-19 19:02:41 +010095 ``#nova flavor-create onap.hpa.flavor13 113 12 20 2``
Gary Wue4a2df82018-11-29 12:49:09 -080096
97 ``#nova flavor-key onap.hpa.flavor13 set hw:mem_page_size=2048``
98
99 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:1 aggr131``
100
101 ``#openstack flavor set onap.hpa.flavor13 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:1``
102
103- **Cloud Region Two**
104
105 **Flavor21**
106 ``#nova flavor-create onap.hpa.flavor21 221 8 20 2``
107
108 ``#nova flavor-key onap.hpa.flavor21 set hw:mem_page_size=2048``
109
110 ``#nova flavor-key onap.hpa.flavor21 set hw:cpu_policy=dedicated``
111
112 ``#nova flavor-key onap.hpa.flavor21 set hw:cpu_thread_policy=isolate``
mrichommeefb859d2020-03-19 19:02:41 +0100113
Gary Wue4a2df82018-11-29 12:49:09 -0800114 **Flavor22**
115 ``#nova flavor-create onap.hpa.flavor22 222 12 20 2``
116
117 ``#nova flavor-key onap.hpa.flavor22 set hw:mem_page_size=2048``
118
119 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:2 aggr221``
120
121 ``#openstack flavor set onap.hpa.flavor22 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:2``
mrichommeefb859d2020-03-19 19:02:41 +0100122
Gary Wue4a2df82018-11-29 12:49:09 -0800123 **Flavor23**
mrichommeefb859d2020-03-19 19:02:41 +0100124 ``#nova flavor-create onap.hpa.flavor23 223 12 20 2``
Gary Wue4a2df82018-11-29 12:49:09 -0800125
126 ``#nova flavor-key onap.hpa.flavor23 set hw:mem_page_size=2048``
127
128 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:2 aggr231``
129
130 ``#openstack flavor set onap.hpa.flavor23 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:2``
131
132- **Cloud Region Three**
133
134 **Flavor31**
135 ``#nova flavor-create onap.hpa.flavor31 331 8 20 2``
136
137 ``#nova flavor-key onap.hpa.flavor31 set hw:mem_page_size=2048``
138
139 ``#nova flavor-key onap.hpa.flavor31 set hw:cpu_policy=dedicated``
140
141 ``#nova flavor-key onap.hpa.flavor31 set hw:cpu_thread_policy=isolate``
mrichommeefb859d2020-03-19 19:02:41 +0100142
Gary Wue4a2df82018-11-29 12:49:09 -0800143 **Flavor32**
144 ``#nova flavor-create onap.hpa.flavor32 332 8192 20 2``
145
146 ``#nova flavor-key onap.hpa.flavor32 set hw:mem_page_size=1048576``
mrichommeefb859d2020-03-19 19:02:41 +0100147
Gary Wue4a2df82018-11-29 12:49:09 -0800148 **Flavor33**
mrichommeefb859d2020-03-19 19:02:41 +0100149 ``#nova flavor-create onap.hpa.flavor33 333 12 20 2``
Gary Wue4a2df82018-11-29 12:49:09 -0800150
151 ``#nova flavor-key onap.hpa.flavor33 set hw:mem_page_size=2048``
152
153 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:1 aggr331``
154
mrichommeefb859d2020-03-19 19:02:41 +0100155 ``#openstack flavor set onap.hpa.flavor33 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:1``
Gary Wue4a2df82018-11-29 12:49:09 -0800156
Itohanf54cbc12019-06-19 10:19:27 -0700157**Note: Use case can be run manually or using automation script (recommended)**
158
159
160After 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.
161
162
163
1646. Run robot healthdist
165
166 ``oom-rancher# ./ete-k8s.sh onap healthdist``
1677. Run robot demo init, this initializes the default Demonstration customer and distributes the default models
168
169 ``oom-rancher# ./demo-k8s.sh onap init``
Gary Wue4a2df82018-11-29 12:49:09 -0800170
1718. Check that the cloud complex has the right values and update if it does not. Required values are;
172
173 "elevation": "example-elevation-val-28399",
174
175 "lata": "example-lata-val-28399",
176
177 "country": "USA",
178
179 "latitude": "32.89948",
180
181 "longitude": "97.045443",
182
183 "postal-code": "00000
184
185
186If an update is needed, the update can be done via rest using curl or postman
187
188::
189
190 curl -X PUT \
191 https://$ONAP_AAI_IP:$ONAP_AAI_PORT/aai/v14/cloud-infrastructure/complexes/complex/clli1 \
192 -H 'Accept: application/json' \
193 -H 'Authorization: Basic QUFJOkFBSQ==' \
194 -H 'Cache-Control: no-cache' \
195 -H 'Content-Type: application/json' \
196 -H 'Postman-Token: 2b272126-aa65-41e6-aa5d-46bc70b9eb4f' \
197 -H 'Real-Time: true' \
198 -H 'X-FromAppId: jimmy-postman' \
199 -H 'X-TransactionId: 9999' \
200 -d '{
201 "physical-location-id": "clli1",
202 "data-center-code": "example-data-center-code-val-5556",
203 "complex-name": "clli1",
204 "identity-url": "example-identity-url-val-56898",
205 "resource-version": "1543284556407",
206 "physical-location-type": "example-physical-location-type-val-7608",
207 "street1": "example-street1-val-34205",
208 "street2": "example-street2-val-99210",
209 "city": "example-city-val-27150",
210 "state": "example-state-val-59487",
211 "postal-code": "00000",
212 "country": "USA",
213 "region": "example-region-val-13893",
214 "latitude": "32.89948",
215 "longitude": "97.045443",
216 "elevation": "example-elevation-val-28399",
217 "lata": "example-lata-val-28399"
218
219 }'
220
mrichomme20a4dbd2020-07-08 17:52:13 +02002219. 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.
Gary Wue4a2df82018-11-29 12:49:09 -0800222
223- Get msb-iag internal ip address and port
224
225 ``oom-rancher# kubectl get services -n onap |grep msb-iag``
226
227- Exec into any pod (oof in this case) and run curl command, you may need to install curl
228
229 ``oom-rancher# kubectl exec dev-oof-oof-6c848594c5-5khps -it -- bash``
230
mrichommeefb859d2020-03-19 19:02:41 +010023110. 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.
Gary Wue4a2df82018-11-29 12:49:09 -0800232
233**GET COMMAND**
234
235::
236
237 curl -X GET \
238 https://$ONAP_AAI_IP:$ONAP_AAI_PORT/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/${CLOUD_OWNER}/${CLOUD_REGION_ID}?depth=all \
239 -H 'Accept: application/json' \
240 -H 'Authorization: Basic QUFJOkFBSQ==' \
241 -H 'Cache-Control: no-cache' \
242 -H 'Content-Type: application/json' \
243 -H 'Postman-Token: 2899359f-871b-4e61-a307-ecf8b3144e3f' \
244 -H 'Real-Time: true' \
245 -H 'X-FromAppId: jimmy-postman' \
246 -H 'X-TransactionId: 9999'
247
248**PUT COMMAND**
249::
250
251 curl -X PUT \
252 https://{{AAI1_PUB_IP}}:{{AAI1_PUB_PORT}}/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/{{cloud-owner}}/{{cloud-region-id}}/tenants/tenant/{{tenant-id}} \
253 -H 'Accept: application/json' \
254 -H 'Authorization: Basic QUFJOkFBSQ==' \
255 -H 'Cache-Control: no-cache' \
256 -H 'Content-Type: application/json' \
257 -H 'Postman-Token: 2b272126-aa65-41e6-aa5d-46bc70b9eb4f' \
258 -H 'Real-Time: true' \
259 -H 'X-FromAppId: jimmy-postman' \
260 -H 'X-TransactionId: 9999' \
261 -d '{
262 "tenant-id": "709ba629fe194f8699b12f9d6ffd86a0",
263 "tenant-name": "Integration-HPA",
264 "resource-version": "1542650451856",
265 "relationship-list": {
266 "relationship": [
267 {
268 "related-to": "service-subscription",
269 "relationship-label": "org.onap.relationships.inventory.Uses",
270 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL",
271 "relationship-data": [
272 {
273 "relationship-key": "customer.global-customer-id",
274 "relationship-value": "Demonstration"
275 },
276 {
277 "relationship-key": "service-subscription.service-type",
278 "relationship-value": "vFWCL"
279 }
280 ]
281 },
282 {
283 "related-to": "service-subscription",
284 "relationship-label": "org.onap.relationships.inventory.Uses",
285 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/gNB",
286 "relationship-data": [
287 {
288 "relationship-key": "customer.global-customer-id",
289 "relationship-value": "Demonstration"
290 },
291 {
292 "relationship-key": "service-subscription.service-type",
293 "relationship-value": "gNB"
294 }
295 ]
296 },
297 {
298 "related-to": "service-subscription",
299 "relationship-label": "org.onap.relationships.inventory.Uses",
300 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW",
301 "relationship-data": [
302 {
303 "relationship-key": "customer.global-customer-id",
304 "relationship-value": "Demonstration"
305 },
306 {
307 "relationship-key": "service-subscription.service-type",
308 "relationship-value": "vFW"
309 }
310 ]
311 },
312 {
313 "related-to": "service-subscription",
314 "relationship-label": "org.onap.relationships.inventory.Uses",
315 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE",
316 "relationship-data": [
317 {
318 "relationship-key": "customer.global-customer-id",
319 "relationship-value": "Demonstration"
320 },
321 {
322 "relationship-key": "service-subscription.service-type",
323 "relationship-value": "vCPE"
324 }
325 ]
326 },
327 {
328 "related-to": "service-subscription",
329 "relationship-label": "org.onap.relationships.inventory.Uses",
330 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW_HPA",
331 "relationship-data": [
332 {
333 "relationship-key": "customer.global-customer-id",
334 "relationship-value": "Demonstration"
335 },
336 {
337 "relationship-key": "service-subscription.service-type",
338 "relationship-value": "vFW_HPA"
339 }
340 ]
341 },
342 {
343 "related-to": "service-subscription",
344 "relationship-label": "org.onap.relationships.inventory.Uses",
345 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vLB",
346 "relationship-data": [
347 {
348 "relationship-key": "customer.global-customer-id",
349 "relationship-value": "Demonstration"
350 },
351 {
352 "relationship-key": "service-subscription.service-type",
353 "relationship-value": "vLB"
354 }
355 ]
356 },
357 {
358 "related-to": "service-subscription",
359 "relationship-label": "org.onap.relationships.inventory.Uses",
360 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vIMS",
361 "relationship-data": [
362 {
363 "relationship-key": "customer.global-customer-id",
364 "relationship-value": "Demonstration"
365 },
366 {
367 "relationship-key": "service-subscription.service-type",
368 "relationship-value": "vIMS"
369 }
370 ]
371 }
372 ]
373 }
374 }'
375
mrichommeefb859d2020-03-19 19:02:41 +0100376
Gary Wue4a2df82018-11-29 12:49:09 -080037711. 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.
378
37912. 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.
380
38113. 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.
382
mrichommeefb859d2020-03-19 19:02:41 +0100383::
Gary Wue4a2df82018-11-29 12:49:09 -0800384
385 curl -k -X POST \
386 http://{{k8s}}:30277/onap/so/infra/serviceInstances/v6 \
387 -H 'authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== \
388 -H 'content-type: application/json' \
mrichommeefb859d2020-03-19 19:02:41 +0100389
390 -d '{
391
392 "requestDetails":{
393
394 "modelInfo":{
395
Gary Wue4a2df82018-11-29 12:49:09 -0800396 "modelInvariantId":"b7564cb9-4074-4c9b-95d6-39d4191e80d9",
mrichommeefb859d2020-03-19 19:02:41 +0100397
Gary Wue4a2df82018-11-29 12:49:09 -0800398 "modelType":"service",
mrichommeefb859d2020-03-19 19:02:41 +0100399
Gary Wue4a2df82018-11-29 12:49:09 -0800400 "modelName":"vfw_HPA",
mrichommeefb859d2020-03-19 19:02:41 +0100401
Gary Wue4a2df82018-11-29 12:49:09 -0800402 "modelVersion":"1.0",
mrichommeefb859d2020-03-19 19:02:41 +0100403
Gary Wue4a2df82018-11-29 12:49:09 -0800404 "modelVersionId":"35d184e8-1cba-46e3-9311-a17ace766eb0",
mrichommeefb859d2020-03-19 19:02:41 +0100405
Gary Wue4a2df82018-11-29 12:49:09 -0800406 "modelUuid":"35d184e8-1cba-46e3-9311-a17ace766eb0",
mrichommeefb859d2020-03-19 19:02:41 +0100407
Gary Wue4a2df82018-11-29 12:49:09 -0800408 "modelInvariantUuid":"b7564cb9-4074-4c9b-95d6-39d4191e80d9"
mrichommeefb859d2020-03-19 19:02:41 +0100409
Gary Wue4a2df82018-11-29 12:49:09 -0800410 },
mrichommeefb859d2020-03-19 19:02:41 +0100411
412 "requestInfo":{
413
Gary Wue4a2df82018-11-29 12:49:09 -0800414 "source":"VID",
mrichommeefb859d2020-03-19 19:02:41 +0100415
Gary Wue4a2df82018-11-29 12:49:09 -0800416 "instanceName":"oof-12-homing",
mrichommeefb859d2020-03-19 19:02:41 +0100417
Gary Wue4a2df82018-11-29 12:49:09 -0800418 "suppressRollback":false,
mrichommeefb859d2020-03-19 19:02:41 +0100419
Gary Wue4a2df82018-11-29 12:49:09 -0800420 "requestorId":"demo"
mrichommeefb859d2020-03-19 19:02:41 +0100421
Gary Wue4a2df82018-11-29 12:49:09 -0800422 },
mrichommeefb859d2020-03-19 19:02:41 +0100423
424 "subscriberInfo":{
425
Gary Wue4a2df82018-11-29 12:49:09 -0800426 "globalSubscriberId":"Demonstration"
mrichommeefb859d2020-03-19 19:02:41 +0100427
Gary Wue4a2df82018-11-29 12:49:09 -0800428 },
mrichommeefb859d2020-03-19 19:02:41 +0100429
430 "requestParameters":{
431
Gary Wue4a2df82018-11-29 12:49:09 -0800432 "subscriptionServiceType":"vFW",
mrichommeefb859d2020-03-19 19:02:41 +0100433
Gary Wue4a2df82018-11-29 12:49:09 -0800434 "aLaCarte":true,
mrichommeefb859d2020-03-19 19:02:41 +0100435
Gary Wue4a2df82018-11-29 12:49:09 -0800436 "testApi":"VNF_API",
mrichommeefb859d2020-03-19 19:02:41 +0100437
438 "userParams":[
439
440 {
441
Gary Wue4a2df82018-11-29 12:49:09 -0800442 "name":"Customer_Location",
mrichommeefb859d2020-03-19 19:02:41 +0100443
444 "value":{
445
Gary Wue4a2df82018-11-29 12:49:09 -0800446 "customerLatitude":"32.897480",
mrichommeefb859d2020-03-19 19:02:41 +0100447
Gary Wue4a2df82018-11-29 12:49:09 -0800448 "customerLongitude":"97.040443",
mrichommeefb859d2020-03-19 19:02:41 +0100449
Gary Wue4a2df82018-11-29 12:49:09 -0800450 "customerName":"some_company"
mrichommeefb859d2020-03-19 19:02:41 +0100451
Gary Wue4a2df82018-11-29 12:49:09 -0800452 }
mrichommeefb859d2020-03-19 19:02:41 +0100453
Gary Wue4a2df82018-11-29 12:49:09 -0800454 },
mrichommeefb859d2020-03-19 19:02:41 +0100455
456 {
457
Gary Wue4a2df82018-11-29 12:49:09 -0800458 "name":"Homing_Solution",
mrichommeefb859d2020-03-19 19:02:41 +0100459
Gary Wue4a2df82018-11-29 12:49:09 -0800460 "value":"oof"
mrichommeefb859d2020-03-19 19:02:41 +0100461
Gary Wue4a2df82018-11-29 12:49:09 -0800462 },
mrichommeefb859d2020-03-19 19:02:41 +0100463
464 {
465
Gary Wue4a2df82018-11-29 12:49:09 -0800466 "name":"orchestrator",
mrichommeefb859d2020-03-19 19:02:41 +0100467
Gary Wue4a2df82018-11-29 12:49:09 -0800468 "value":"multicloud"
mrichommeefb859d2020-03-19 19:02:41 +0100469
Gary Wue4a2df82018-11-29 12:49:09 -0800470 }
mrichommeefb859d2020-03-19 19:02:41 +0100471
Gary Wue4a2df82018-11-29 12:49:09 -0800472 ]
mrichommeefb859d2020-03-19 19:02:41 +0100473
Gary Wue4a2df82018-11-29 12:49:09 -0800474 },
mrichommeefb859d2020-03-19 19:02:41 +0100475
476 "project":{
477
Gary Wue4a2df82018-11-29 12:49:09 -0800478 "projectName":"Project-Demonstration"
mrichommeefb859d2020-03-19 19:02:41 +0100479
Gary Wue4a2df82018-11-29 12:49:09 -0800480 },
mrichommeefb859d2020-03-19 19:02:41 +0100481
482 "owningEntity":{
483
Gary Wue4a2df82018-11-29 12:49:09 -0800484 "owningEntityId":"e1564fc9-b9d0-44f9-b5af-953b4aad2f40",
mrichommeefb859d2020-03-19 19:02:41 +0100485
Gary Wue4a2df82018-11-29 12:49:09 -0800486 "owningEntityName":"OE-Demonstration"
mrichommeefb859d2020-03-19 19:02:41 +0100487
Gary Wue4a2df82018-11-29 12:49:09 -0800488 }
mrichommeefb859d2020-03-19 19:02:41 +0100489
Gary Wue4a2df82018-11-29 12:49:09 -0800490 }
mrichommeefb859d2020-03-19 19:02:41 +0100491
Gary Wue4a2df82018-11-29 12:49:09 -0800492 }'
493
49414. 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.
495
49615. 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.
497
49816. 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.
499
500::
501
502 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
503
504To Update a policy, use the following curl command. Modify the policy as required
505
506::
507
508 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 '{
509 "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\"}",
510 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_1",
511 "policyConfigType": "MicroService",
512 "onapName": "SampleDemo",
513 "policyScope": "OSDF_CASABLANCA"
514 }' 'https://pdp:8081/pdp/api/updatePolicy'
mrichommeefb859d2020-03-19 19:02:41 +0100515
Gary Wue4a2df82018-11-29 12:49:09 -0800516
517To delete a policy, use two commands below to delete from PDP and PAP
518
519**DELETE POLICY INSIDE PDP**
520
521::
mrichommeefb859d2020-03-19 19:02:41 +0100522
Gary Wue4a2df82018-11-29 12:49:09 -0800523 curl -k -v -H 'Content-Type: application/json' \
524 -H 'Accept: application/json' \
525 -H 'ClientAuth: cHl0aG9uOnRlc3Q=' \
526 -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' \
527 -H 'Environment: TEST' \
528 -X DELETE \
529 -d '{"policyName": "OSDF_CASABLANCA.Config_MS_vnfPolicy_vFWHPA.1.xml","policyComponent":"PDP","policyType":"MicroService","pdpGroup":"default"}' https://pdp:8081/pdp/api/deletePolicy
530
531
532**DELETE POLICY INSIDE PAP**
533
534::
mrichommeefb859d2020-03-19 19:02:41 +0100535
Gary Wue4a2df82018-11-29 12:49:09 -0800536 curl -k -v -H 'Content-Type: application/json' \
537 -H 'Accept: application/json' \
538 -H 'ClientAuth: cHl0aG9uOnRlc3Q=' \
539 -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' \
540 -H 'Environment: TEST' \
541 -X DELETE \
mrichommeefb859d2020-03-19 19:02:41 +0100542 -d '{"policyName": "OSDF_CASABLANCA.Config_MS_vnfPolicy_vFWHPA.1.xml","policyComponent":"PAP","policyType":"Optimization","deleteCondition":"ALL"}' https://pdp:8081/pdp/api/deletePolicy
Gary Wue4a2df82018-11-29 12:49:09 -0800543
544Below are the 3 HPA policies for test cases in the `test plan <https://wiki.onap.org/pages/viewpage.action?pageId=41421112>`_
545
546**Test 1 (Basic)**
547
548Create Policy
549
550::
551
552 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 '{
553 "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\"}",
554 "policyName": "OSDF_CASABLANCA.hpa_policy_vFWHPA_1",
555 "policyConfigType": "MicroService",
556 "onapName": "SampleDemo",
557 "policyScope": "OSDF_CASABLANCA"
558 }' 'https://pdp:8081/pdp/api/createPolicy'
559
560
mrichommeefb859d2020-03-19 19:02:41 +0100561Push Policy
Gary Wue4a2df82018-11-29 12:49:09 -0800562
563::
564
565 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 '{
566 "pdpGroup": "default",
567 "policyName": "OSDF_CASABLANCA.hpa_policy_vFWHPA_1",
568 "policyType": "MicroService"
569 }' 'https://pdp:8081/pdp/api/pushPolicy'
570
571
572
573
574**Test 2: (to test SRIOV-NIC feature) (to ensure that right cloud-region is selected based on score)**
575
576Create Policy
577
578::
579
580 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 '{
581 "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\"}",
582 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_2",
583 "policyConfigType": "MicroService",
584 "onapName": "SampleDemo",
585 "policyScope": "OSDF_CASABLANCA"
586 }' 'https://pdp:8081/pdp/api/createPolicy'
587
588
mrichommeefb859d2020-03-19 19:02:41 +0100589Push Policy
Gary Wue4a2df82018-11-29 12:49:09 -0800590
591::
592
593 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 '{
594 "pdpGroup": "default",
595 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_2",
596 "policyType": "MicroService"
597 }' 'https://pdp:8081/pdp/api/pushPolicy'
598
599
600**Test 3 (to ensure that right cloud-region is selected based on score)**
601
602Create Policy
603
604::
605
606 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 '{
607 "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\"}",
608 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_3",
609 "policyConfigType": "MicroService",
610 "onapName": "SampleDemo",
611 "policyScope": "OSDF_CASABLANCA"
612 }' 'https://pdp:8081/pdp/api/createPolicy'
mrichommeefb859d2020-03-19 19:02:41 +0100613
614Push Policy
Gary Wue4a2df82018-11-29 12:49:09 -0800615
616::
617
618 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 '{
619 "pdpGroup": "default",
620 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_3",
621 "policyType": "MicroService"
622 }' 'https://pdp:8081/pdp/api/pushPolicy'
mrichommeefb859d2020-03-19 19:02:41 +0100623
Gary Wue4a2df82018-11-29 12:49:09 -080062417. Create Service Instance using step 13 above
625
62618. Check bpmn logs to ensure that OOF sent homing response and flavor directives.
627
62819. 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>`_.
629
63020. 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;
631
632::
633
634 {
635 "input": {
636 "request-information": {
637 "notification-url": "openecomp.org",
638 "order-number": "1",
639 "order-version": "1",
640 "request-action": "PreloadVNFRequest",
641 "request-id": "test"
642 },
643 "sdnc-request-header": {
644 "svc-action": "reserve",
645 "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
646 "svc-request-id": "test"
647 },
648 "vnf-topology-information": {
649 "vnf-assignments": {
650 "availability-zones": [],
651 "vnf-networks": [],
652 "vnf-vms": []
653 },
mrichommeefb859d2020-03-19 19:02:41 +0100654
655
656 "vnf-parameters": [
Gary Wue4a2df82018-11-29 12:49:09 -0800657 {
658 "vnf-parameter-name": "vfw_image_name",
659 "vnf-parameter-value": "ubuntu-16.04"
660 },
661 {
662 "vnf-parameter-name": "firewall_flavor_name",
663 "vnf-parameter-value": "m1.large"
664 },
665 {
666 "vnf-parameter-name": "sink_flavor_name",
667 "vnf-parameter-value": "m1.medium"
668 },
669 {
670 "vnf-parameter-name": "packetgen_flavor_name",
671 "vnf-parameter-value": "m1.large"
672 },
673 {
674 "vnf-parameter-name": "public_net_id",
675 "vnf-parameter-value": "external"
676 },
677 {
678 "vnf-parameter-name": "unprotected_private_net_id",
679 "vnf-parameter-value": "unprotected_private_net"
680 },
681 {
682 "vnf-parameter-name": "protected_private_net_id",
683 "vnf-parameter-value": "protected_private_net"
684 },
685 {
686 "vnf-parameter-name": "onap_private_net_id",
687 "vnf-parameter-value": "oam_onap_vnf_test"
688 },
689 {
690 "vnf-parameter-name": "onap_private_subnet_id",
691 "vnf-parameter-value": "oam_onap_vnf_test"
692 },
693 {
694 "vnf-parameter-name": "unprotected_private_net_cidr",
695 "vnf-parameter-value": "192.168.10.0/24"
696 },
697 {
698 "vnf-parameter-name": "protected_private_net_cidr",
699 "vnf-parameter-value": "192.168.20.0/24"
700 },
701 {
702 "vnf-parameter-name": "onap_private_net_cidr",
703 "vnf-parameter-value": "10.0.0.0/16"
704 },
705 {
706 "vnf-parameter-name": "vfw_private_ip_0",
707 "vnf-parameter-value": "192.168.10.100"
708 },
709 {
710 "vnf-parameter-name": "vfw_private_ip_1",
711 "vnf-parameter-value": "192.168.20.100"
712 },
713 {
714 "vnf-parameter-name": "vfw_private_ip_2",
715 "vnf-parameter-value": "10.0.100.1"
716 },
717 {
718 "vnf-parameter-name": "vpg_private_ip_0",
719 "vnf-parameter-value": "192.168.10.200"
720 },
721 {
722 "vnf-parameter-name": "vpg_private_ip_1",
723 "vnf-parameter-value": "10.0.100.2"
724 },
725 {
726 "vnf-parameter-name": "vsn_private_ip_0",
727 "vnf-parameter-value": "192.168.20.250"
728 },
729 {
730 "vnf-parameter-name": "vsn_private_ip_1",
731 "vnf-parameter-value": "10.0.100.3"
732 },
mrichommeefb859d2020-03-19 19:02:41 +0100733
Gary Wue4a2df82018-11-29 12:49:09 -0800734 {
735 "vnf-parameter-name": "vfw_name_0",
736 "vnf-parameter-value": "vfw"
737 },
738 {
739 "vnf-parameter-name": "vpg_name_0",
740 "vnf-parameter-value": "vpktgen"
741 },
742 {
743 "vnf-parameter-name": "vsn_name_0",
744 "vnf-parameter-value": "vsink"
745 },
746 {
747 "vnf-parameter-name": "vfw_private_0_port_vnic_type",
748 "vnf-parameter-value": "normal"
749 },
750 {
751 "vnf-parameter-name": "vfw_private_1_port_vnic_type",
752 "vnf-parameter-value": "normal"
753 },
754 {
755 "vnf-parameter-name": "vfw_private_2_port_vnic_type",
756 "vnf-parameter-value": "normal"
757 },
758 {
759 "vnf-parameter-name": "vpg_private_0_port_vnic_type",
760 "vnf-parameter-value": "normal"
761 },
762 {
763 "vnf-parameter-name": "vpg_private_1_port_vnic_type",
764 "vnf-parameter-value": "normal"
765 },
766 {
767 "vnf-parameter-name": "vsn_private_0_port_vnic_type",
768 "vnf-parameter-value": "normal"
769 },
770 {
771 "vnf-parameter-name": "vsn_private_1_port_vnic_type",
772 "vnf-parameter-value": "normal"
773 },
774 {
775 "vnf-parameter-name": "vf_module_id",
mrichommeefb859d2020-03-19 19:02:41 +0100776 "vnf-parameter-value": "VfwHpa..base_vfw..module-0"
Gary Wue4a2df82018-11-29 12:49:09 -0800777 },
778 {
779 "vnf-parameter-name": "sec_group",
780 "vnf-parameter-value": "default"
781 },
782 {
783 "vnf-parameter-name": "sdnc_model_name",
784 "vnf-parameter-value": ""
785 },
786 {
787 "vnf-parameter-name": "sdnc_model_version",
788 "vnf-parameter-value": ""
789 },
790 {
791 "vnf-parameter-name": "sdnc_artifact_name",
792 "vnf-parameter-value": ""
793 },
794
795 {
796 "vnf-parameter-name": "oof_directives",
797 "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\"}]}]}"
798 },
mrichommeefb859d2020-03-19 19:02:41 +0100799
Gary Wue4a2df82018-11-29 12:49:09 -0800800 {
801 "vnf-parameter-name": "sdnc_directives",
802 "vnf-parameter-value": "{}"
mrichommeefb859d2020-03-19 19:02:41 +0100803 },
804
Gary Wue4a2df82018-11-29 12:49:09 -0800805 {
806 "vnf-parameter-name": "template_type",
807 "vnf-parameter-value": "heat"
808 }
mrichommeefb859d2020-03-19 19:02:41 +0100809
810
Gary Wue4a2df82018-11-29 12:49:09 -0800811 ],
812 "vnf-topology-identifier": {
813 "generic-vnf-name": "oof-12-vnf-3",
mrichommeefb859d2020-03-19 19:02:41 +0100814 "generic-vnf-type": "vfw_hpa 0",
Gary Wue4a2df82018-11-29 12:49:09 -0800815 "service-type": "6b17354c-0fae-4491-b62e-b41619929c54",
mrichommeefb859d2020-03-19 19:02:41 +0100816 "vnf-name": "vfwhpa_stack",
Gary Wue4a2df82018-11-29 12:49:09 -0800817 "vnf-type": "VfwHpa..base_vfw..module-0"
mrichommeefb859d2020-03-19 19:02:41 +0100818
Gary Wue4a2df82018-11-29 12:49:09 -0800819 }
820 }
821 }}
Gary Wue4a2df82018-11-29 12:49:09 -0800822
mrichommeefb859d2020-03-19 19:02:41 +0100823
824Change parameters based on your environment.
Gary Wue4a2df82018-11-29 12:49:09 -0800825
826**Note**
827
828::
829
830 "generic-vnf-name": "oof-12-vnf-3", <-- NAME GIVEN TO VNF
831 "generic-vnf-type": "vfw_hpa 0", <-- can be found on VNF dialog screen get the part of the VNF-TYPE after the '/'
832 "service-type": "6b17354c-0fae-4491-b62e-b41619929c54", <-- same as Service Instance ID
833 "vnf-name": "vfwhpa_stack", <-- name to be given to the vf module
834 "vnf-type": "VfwHpa..base_vfw..module-0" <-- can be found on the VID - VF Module dialog screen - Model Name
mrichommeefb859d2020-03-19 19:02:41 +0100835
Gary Wue4a2df82018-11-29 12:49:09 -080083621. 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).