blob: 35cea9d6a9b6725ed87280fb1e00b47af0823066 [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
Itohanf54cbc12019-06-19 10:19:27 -07007vFW/vDNS with HPA Tutorial: Setting Up and Configuration
8--------------------------------------------------------
Gary Wue4a2df82018-11-29 12:49:09 -08009
10Description
mrichommeefb859d2020-03-19 19:02:41 +010011~~~~~~~~~~~
Gary Wue4a2df82018-11-29 12:49:09 -080012This 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.
13This tutorial covers enhancements 1 to 5 in Background of https://wiki.onap.org/pages/viewpage.action?pageId=41421112. It focuses on Test Plan 1.
14
15**Useful Links**
16
17`HPA Test Plan Page <https://wiki.onap.org/pages/viewpage.action?pageId=41421112>`_
18
19`HPA Enhancements Page <https://wiki.onap.org/pages/viewpage.action?pageId=34376310>`_
20
21`vFW with HPA Test Status Page <https://wiki.onap.org/display/DW/vFW+with+HPA+Integration+Test+-+Test+Status>`_
22
23
24`Hardware Platform Enablement in ONAP <https://wiki.onap.org/display/DW/Hardware+Platform+Enablement+In+ONAP>`_
25
26
27
28Setting Up and Installation
mrichommeefb859d2020-03-19 19:02:41 +010029~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gary Wue4a2df82018-11-29 12:49:09 -080030Some 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
31
32Instructions 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
33
34Install 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;
35
36
371. Check that all the required components were deployed;
mrichommeefb859d2020-03-19 19:02:41 +010038
Gary Wue4a2df82018-11-29 12:49:09 -080039 ``oom-rancher# helm list``
40
412. Check the state of the pods;
42
43 ``oom-rancher# kubectl get pods -n onap``
44
453. Run robot health check
46
mrichommeefb859d2020-03-19 19:02:41 +010047 ``oom-rancher# cd oom/kubernetes/robot``
Gary Wue4a2df82018-11-29 12:49:09 -080048
49 ``oom-rancher# ./ete-k8s.sh onap health``
50
51 Ensure all the required components pass the health tests
524. Modify the SO bpmn configmap to change the SO vnf adapter endpoint to v2
mrichommeefb859d2020-03-19 19:02:41 +010053
54 ``oom-rancher# kubectl -n onap edit configmap dev-so-so-bpmn-infra-app-configmap``
Gary Wue4a2df82018-11-29 12:49:09 -080055
56 ``- vnf:``
57
58           ``endpoint: http://so-openstack-adapter.onap:8087/services/VnfAdapter``
59
60           ``rest:``
61
62             ``endpoint: http://so-openstack-adapter.onap:8087/services/rest/v1/vnfs``
63  
64 ``+ vnf:``
65
66           ``endpoint: http://so-openstack-adapter.onap:8087/services/VnfAdapter``
67
68           ``rest:``
69
70             ``endpoint: http://so-openstack-adapter.onap:8087/services/rest/v2/vnfs`` 
71
72 Then delete the bpmn pod
73
74 ``oom-rancher# kubectl delete <pod-name> -n onap``
75
Gary Wue4a2df82018-11-29 12:49:09 -080076
mrichommeefb859d2020-03-19 19:02:41 +0100775. 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 -080078
79- **Cloud Region One**
80
81 **Flavor11**
82 ``#nova flavor-create onap.hpa.flavor11 111 8 20 2``
83
84 ``#nova flavor-key onap.hpa.flavor11 set hw:mem_page_size=2048``
mrichommeefb859d2020-03-19 19:02:41 +010085
Gary Wue4a2df82018-11-29 12:49:09 -080086 **Flavor12**
87 ``#nova flavor-create onap.hpa.flavor12 112 12 20 2``
88
89 ``#nova flavor-key onap.hpa.flavor12 set hw:mem_page_size=2048``
90
91 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:3 aggr121``
92
93 ``#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 +010094
Gary Wue4a2df82018-11-29 12:49:09 -080095 **Flavor13**
mrichommeefb859d2020-03-19 19:02:41 +010096 ``#nova flavor-create onap.hpa.flavor13 113 12 20 2``
Gary Wue4a2df82018-11-29 12:49:09 -080097
98 ``#nova flavor-key onap.hpa.flavor13 set hw:mem_page_size=2048``
99
100 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:1 aggr131``
101
102 ``#openstack flavor set onap.hpa.flavor13 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:1``
103
104- **Cloud Region Two**
105
106 **Flavor21**
107 ``#nova flavor-create onap.hpa.flavor21 221 8 20 2``
108
109 ``#nova flavor-key onap.hpa.flavor21 set hw:mem_page_size=2048``
110
111 ``#nova flavor-key onap.hpa.flavor21 set hw:cpu_policy=dedicated``
112
113 ``#nova flavor-key onap.hpa.flavor21 set hw:cpu_thread_policy=isolate``
mrichommeefb859d2020-03-19 19:02:41 +0100114
Gary Wue4a2df82018-11-29 12:49:09 -0800115 **Flavor22**
116 ``#nova flavor-create onap.hpa.flavor22 222 12 20 2``
117
118 ``#nova flavor-key onap.hpa.flavor22 set hw:mem_page_size=2048``
119
120 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:2 aggr221``
121
122 ``#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 +0100123
Gary Wue4a2df82018-11-29 12:49:09 -0800124 **Flavor23**
mrichommeefb859d2020-03-19 19:02:41 +0100125 ``#nova flavor-create onap.hpa.flavor23 223 12 20 2``
Gary Wue4a2df82018-11-29 12:49:09 -0800126
127 ``#nova flavor-key onap.hpa.flavor23 set hw:mem_page_size=2048``
128
129 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:2 aggr231``
130
131 ``#openstack flavor set onap.hpa.flavor23 --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-private-1:2``
132
133- **Cloud Region Three**
134
135 **Flavor31**
136 ``#nova flavor-create onap.hpa.flavor31 331 8 20 2``
137
138 ``#nova flavor-key onap.hpa.flavor31 set hw:mem_page_size=2048``
139
140 ``#nova flavor-key onap.hpa.flavor31 set hw:cpu_policy=dedicated``
141
142 ``#nova flavor-key onap.hpa.flavor31 set hw:cpu_thread_policy=isolate``
mrichommeefb859d2020-03-19 19:02:41 +0100143
Gary Wue4a2df82018-11-29 12:49:09 -0800144 **Flavor32**
145 ``#nova flavor-create onap.hpa.flavor32 332 8192 20 2``
146
147 ``#nova flavor-key onap.hpa.flavor32 set hw:mem_page_size=1048576``
mrichommeefb859d2020-03-19 19:02:41 +0100148
Gary Wue4a2df82018-11-29 12:49:09 -0800149 **Flavor33**
mrichommeefb859d2020-03-19 19:02:41 +0100150 ``#nova flavor-create onap.hpa.flavor33 333 12 20 2``
Gary Wue4a2df82018-11-29 12:49:09 -0800151
152 ``#nova flavor-key onap.hpa.flavor33 set hw:mem_page_size=2048``
153
154 ``#openstack aggregate create --property aggregate_instance_extra_specs:sriov_nic=sriov-nic-intel-8086-154C-shared-1:1 aggr331``
155
mrichommeefb859d2020-03-19 19:02:41 +0100156 ``#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 -0800157
Itohanf54cbc12019-06-19 10:19:27 -0700158**Note: Use case can be run manually or using automation script (recommended)**
159
160
161After 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.
162
163
164
1656. Run robot healthdist
166
167 ``oom-rancher# ./ete-k8s.sh onap healthdist``
1687. Run robot demo init, this initializes the default Demonstration customer and distributes the default models
169
170 ``oom-rancher# ./demo-k8s.sh onap init``
Gary Wue4a2df82018-11-29 12:49:09 -0800171
1728. Check that the cloud complex has the right values and update if it does not. Required values are;
173
174 "elevation": "example-elevation-val-28399",
175
176 "lata": "example-lata-val-28399",
177
178 "country": "USA",
179
180 "latitude": "32.89948",
181
182 "longitude": "97.045443",
183
184 "postal-code": "00000
185
186
187If an update is needed, the update can be done via rest using curl or postman
188
189::
190
191 curl -X PUT \
192 https://$ONAP_AAI_IP:$ONAP_AAI_PORT/aai/v14/cloud-infrastructure/complexes/complex/clli1 \
193 -H 'Accept: application/json' \
194 -H 'Authorization: Basic QUFJOkFBSQ==' \
195 -H 'Cache-Control: no-cache' \
196 -H 'Content-Type: application/json' \
197 -H 'Postman-Token: 2b272126-aa65-41e6-aa5d-46bc70b9eb4f' \
198 -H 'Real-Time: true' \
199 -H 'X-FromAppId: jimmy-postman' \
200 -H 'X-TransactionId: 9999' \
201 -d '{
202 "physical-location-id": "clli1",
203 "data-center-code": "example-data-center-code-val-5556",
204 "complex-name": "clli1",
205 "identity-url": "example-identity-url-val-56898",
206 "resource-version": "1543284556407",
207 "physical-location-type": "example-physical-location-type-val-7608",
208 "street1": "example-street1-val-34205",
209 "street2": "example-street2-val-99210",
210 "city": "example-city-val-27150",
211 "state": "example-state-val-59487",
212 "postal-code": "00000",
213 "country": "USA",
214 "region": "example-region-val-13893",
215 "latitude": "32.89948",
216 "longitude": "97.045443",
217 "elevation": "example-elevation-val-28399",
218 "lata": "example-lata-val-28399"
219
220 }'
221
2229. Register new cloud regions. This can be done using instructions (Step 1 to Step 3) on this `page <https://onap.readthedocs.io/en/latest/submodules/multicloud/framework.git/docs/multicloud-plugin-windriver/UserGuide-MultiCloud-WindRiver-TitaniumCloud.html#tutorial-onboard-instance-of-wind-river-titanium-cloud>`_. 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.
223
224- Get msb-iag internal ip address and port
225
226 ``oom-rancher# kubectl get services -n onap |grep msb-iag``
227
228- Exec into any pod (oof in this case) and run curl command, you may need to install curl
229
230 ``oom-rancher# kubectl exec dev-oof-oof-6c848594c5-5khps -it -- bash``
231
mrichommeefb859d2020-03-19 19:02:41 +010023210. 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 -0800233
234**GET COMMAND**
235
236::
237
238 curl -X GET \
239 https://$ONAP_AAI_IP:$ONAP_AAI_PORT/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/${CLOUD_OWNER}/${CLOUD_REGION_ID}?depth=all \
240 -H 'Accept: application/json' \
241 -H 'Authorization: Basic QUFJOkFBSQ==' \
242 -H 'Cache-Control: no-cache' \
243 -H 'Content-Type: application/json' \
244 -H 'Postman-Token: 2899359f-871b-4e61-a307-ecf8b3144e3f' \
245 -H 'Real-Time: true' \
246 -H 'X-FromAppId: jimmy-postman' \
247 -H 'X-TransactionId: 9999'
248
249**PUT COMMAND**
250::
251
252 curl -X PUT \
253 https://{{AAI1_PUB_IP}}:{{AAI1_PUB_PORT}}/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/{{cloud-owner}}/{{cloud-region-id}}/tenants/tenant/{{tenant-id}} \
254 -H 'Accept: application/json' \
255 -H 'Authorization: Basic QUFJOkFBSQ==' \
256 -H 'Cache-Control: no-cache' \
257 -H 'Content-Type: application/json' \
258 -H 'Postman-Token: 2b272126-aa65-41e6-aa5d-46bc70b9eb4f' \
259 -H 'Real-Time: true' \
260 -H 'X-FromAppId: jimmy-postman' \
261 -H 'X-TransactionId: 9999' \
262 -d '{
263 "tenant-id": "709ba629fe194f8699b12f9d6ffd86a0",
264 "tenant-name": "Integration-HPA",
265 "resource-version": "1542650451856",
266 "relationship-list": {
267 "relationship": [
268 {
269 "related-to": "service-subscription",
270 "relationship-label": "org.onap.relationships.inventory.Uses",
271 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL",
272 "relationship-data": [
273 {
274 "relationship-key": "customer.global-customer-id",
275 "relationship-value": "Demonstration"
276 },
277 {
278 "relationship-key": "service-subscription.service-type",
279 "relationship-value": "vFWCL"
280 }
281 ]
282 },
283 {
284 "related-to": "service-subscription",
285 "relationship-label": "org.onap.relationships.inventory.Uses",
286 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/gNB",
287 "relationship-data": [
288 {
289 "relationship-key": "customer.global-customer-id",
290 "relationship-value": "Demonstration"
291 },
292 {
293 "relationship-key": "service-subscription.service-type",
294 "relationship-value": "gNB"
295 }
296 ]
297 },
298 {
299 "related-to": "service-subscription",
300 "relationship-label": "org.onap.relationships.inventory.Uses",
301 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW",
302 "relationship-data": [
303 {
304 "relationship-key": "customer.global-customer-id",
305 "relationship-value": "Demonstration"
306 },
307 {
308 "relationship-key": "service-subscription.service-type",
309 "relationship-value": "vFW"
310 }
311 ]
312 },
313 {
314 "related-to": "service-subscription",
315 "relationship-label": "org.onap.relationships.inventory.Uses",
316 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE",
317 "relationship-data": [
318 {
319 "relationship-key": "customer.global-customer-id",
320 "relationship-value": "Demonstration"
321 },
322 {
323 "relationship-key": "service-subscription.service-type",
324 "relationship-value": "vCPE"
325 }
326 ]
327 },
328 {
329 "related-to": "service-subscription",
330 "relationship-label": "org.onap.relationships.inventory.Uses",
331 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW_HPA",
332 "relationship-data": [
333 {
334 "relationship-key": "customer.global-customer-id",
335 "relationship-value": "Demonstration"
336 },
337 {
338 "relationship-key": "service-subscription.service-type",
339 "relationship-value": "vFW_HPA"
340 }
341 ]
342 },
343 {
344 "related-to": "service-subscription",
345 "relationship-label": "org.onap.relationships.inventory.Uses",
346 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vLB",
347 "relationship-data": [
348 {
349 "relationship-key": "customer.global-customer-id",
350 "relationship-value": "Demonstration"
351 },
352 {
353 "relationship-key": "service-subscription.service-type",
354 "relationship-value": "vLB"
355 }
356 ]
357 },
358 {
359 "related-to": "service-subscription",
360 "relationship-label": "org.onap.relationships.inventory.Uses",
361 "related-link": "/aai/v14/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vIMS",
362 "relationship-data": [
363 {
364 "relationship-key": "customer.global-customer-id",
365 "relationship-value": "Demonstration"
366 },
367 {
368 "relationship-key": "service-subscription.service-type",
369 "relationship-value": "vIMS"
370 }
371 ]
372 }
373 ]
374 }
375 }'
376
mrichommeefb859d2020-03-19 19:02:41 +0100377
Gary Wue4a2df82018-11-29 12:49:09 -080037811. 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.
379
38012. 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.
381
38213. 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.
383
mrichommeefb859d2020-03-19 19:02:41 +0100384::
Gary Wue4a2df82018-11-29 12:49:09 -0800385
386 curl -k -X POST \
387 http://{{k8s}}:30277/onap/so/infra/serviceInstances/v6 \
388 -H 'authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== \
389 -H 'content-type: application/json' \
mrichommeefb859d2020-03-19 19:02:41 +0100390
391 -d '{
392
393 "requestDetails":{
394
395 "modelInfo":{
396
Gary Wue4a2df82018-11-29 12:49:09 -0800397 "modelInvariantId":"b7564cb9-4074-4c9b-95d6-39d4191e80d9",
mrichommeefb859d2020-03-19 19:02:41 +0100398
Gary Wue4a2df82018-11-29 12:49:09 -0800399 "modelType":"service",
mrichommeefb859d2020-03-19 19:02:41 +0100400
Gary Wue4a2df82018-11-29 12:49:09 -0800401 "modelName":"vfw_HPA",
mrichommeefb859d2020-03-19 19:02:41 +0100402
Gary Wue4a2df82018-11-29 12:49:09 -0800403 "modelVersion":"1.0",
mrichommeefb859d2020-03-19 19:02:41 +0100404
Gary Wue4a2df82018-11-29 12:49:09 -0800405 "modelVersionId":"35d184e8-1cba-46e3-9311-a17ace766eb0",
mrichommeefb859d2020-03-19 19:02:41 +0100406
Gary Wue4a2df82018-11-29 12:49:09 -0800407 "modelUuid":"35d184e8-1cba-46e3-9311-a17ace766eb0",
mrichommeefb859d2020-03-19 19:02:41 +0100408
Gary Wue4a2df82018-11-29 12:49:09 -0800409 "modelInvariantUuid":"b7564cb9-4074-4c9b-95d6-39d4191e80d9"
mrichommeefb859d2020-03-19 19:02:41 +0100410
Gary Wue4a2df82018-11-29 12:49:09 -0800411 },
mrichommeefb859d2020-03-19 19:02:41 +0100412
413 "requestInfo":{
414
Gary Wue4a2df82018-11-29 12:49:09 -0800415 "source":"VID",
mrichommeefb859d2020-03-19 19:02:41 +0100416
Gary Wue4a2df82018-11-29 12:49:09 -0800417 "instanceName":"oof-12-homing",
mrichommeefb859d2020-03-19 19:02:41 +0100418
Gary Wue4a2df82018-11-29 12:49:09 -0800419 "suppressRollback":false,
mrichommeefb859d2020-03-19 19:02:41 +0100420
Gary Wue4a2df82018-11-29 12:49:09 -0800421 "requestorId":"demo"
mrichommeefb859d2020-03-19 19:02:41 +0100422
Gary Wue4a2df82018-11-29 12:49:09 -0800423 },
mrichommeefb859d2020-03-19 19:02:41 +0100424
425 "subscriberInfo":{
426
Gary Wue4a2df82018-11-29 12:49:09 -0800427 "globalSubscriberId":"Demonstration"
mrichommeefb859d2020-03-19 19:02:41 +0100428
Gary Wue4a2df82018-11-29 12:49:09 -0800429 },
mrichommeefb859d2020-03-19 19:02:41 +0100430
431 "requestParameters":{
432
Gary Wue4a2df82018-11-29 12:49:09 -0800433 "subscriptionServiceType":"vFW",
mrichommeefb859d2020-03-19 19:02:41 +0100434
Gary Wue4a2df82018-11-29 12:49:09 -0800435 "aLaCarte":true,
mrichommeefb859d2020-03-19 19:02:41 +0100436
Gary Wue4a2df82018-11-29 12:49:09 -0800437 "testApi":"VNF_API",
mrichommeefb859d2020-03-19 19:02:41 +0100438
439 "userParams":[
440
441 {
442
Gary Wue4a2df82018-11-29 12:49:09 -0800443 "name":"Customer_Location",
mrichommeefb859d2020-03-19 19:02:41 +0100444
445 "value":{
446
Gary Wue4a2df82018-11-29 12:49:09 -0800447 "customerLatitude":"32.897480",
mrichommeefb859d2020-03-19 19:02:41 +0100448
Gary Wue4a2df82018-11-29 12:49:09 -0800449 "customerLongitude":"97.040443",
mrichommeefb859d2020-03-19 19:02:41 +0100450
Gary Wue4a2df82018-11-29 12:49:09 -0800451 "customerName":"some_company"
mrichommeefb859d2020-03-19 19:02:41 +0100452
Gary Wue4a2df82018-11-29 12:49:09 -0800453 }
mrichommeefb859d2020-03-19 19:02:41 +0100454
Gary Wue4a2df82018-11-29 12:49:09 -0800455 },
mrichommeefb859d2020-03-19 19:02:41 +0100456
457 {
458
Gary Wue4a2df82018-11-29 12:49:09 -0800459 "name":"Homing_Solution",
mrichommeefb859d2020-03-19 19:02:41 +0100460
Gary Wue4a2df82018-11-29 12:49:09 -0800461 "value":"oof"
mrichommeefb859d2020-03-19 19:02:41 +0100462
Gary Wue4a2df82018-11-29 12:49:09 -0800463 },
mrichommeefb859d2020-03-19 19:02:41 +0100464
465 {
466
Gary Wue4a2df82018-11-29 12:49:09 -0800467 "name":"orchestrator",
mrichommeefb859d2020-03-19 19:02:41 +0100468
Gary Wue4a2df82018-11-29 12:49:09 -0800469 "value":"multicloud"
mrichommeefb859d2020-03-19 19:02:41 +0100470
Gary Wue4a2df82018-11-29 12:49:09 -0800471 }
mrichommeefb859d2020-03-19 19:02:41 +0100472
Gary Wue4a2df82018-11-29 12:49:09 -0800473 ]
mrichommeefb859d2020-03-19 19:02:41 +0100474
Gary Wue4a2df82018-11-29 12:49:09 -0800475 },
mrichommeefb859d2020-03-19 19:02:41 +0100476
477 "project":{
478
Gary Wue4a2df82018-11-29 12:49:09 -0800479 "projectName":"Project-Demonstration"
mrichommeefb859d2020-03-19 19:02:41 +0100480
Gary Wue4a2df82018-11-29 12:49:09 -0800481 },
mrichommeefb859d2020-03-19 19:02:41 +0100482
483 "owningEntity":{
484
Gary Wue4a2df82018-11-29 12:49:09 -0800485 "owningEntityId":"e1564fc9-b9d0-44f9-b5af-953b4aad2f40",
mrichommeefb859d2020-03-19 19:02:41 +0100486
Gary Wue4a2df82018-11-29 12:49:09 -0800487 "owningEntityName":"OE-Demonstration"
mrichommeefb859d2020-03-19 19:02:41 +0100488
Gary Wue4a2df82018-11-29 12:49:09 -0800489 }
mrichommeefb859d2020-03-19 19:02:41 +0100490
Gary Wue4a2df82018-11-29 12:49:09 -0800491 }
mrichommeefb859d2020-03-19 19:02:41 +0100492
Gary Wue4a2df82018-11-29 12:49:09 -0800493 }'
494
49514. 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.
496
49715. 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.
498
49916. 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.
500
501::
502
503 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
504
505To Update a policy, use the following curl command. Modify the policy as required
506
507::
508
509 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 '{
510 "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\"}",
511 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_1",
512 "policyConfigType": "MicroService",
513 "onapName": "SampleDemo",
514 "policyScope": "OSDF_CASABLANCA"
515 }' 'https://pdp:8081/pdp/api/updatePolicy'
mrichommeefb859d2020-03-19 19:02:41 +0100516
Gary Wue4a2df82018-11-29 12:49:09 -0800517
518To delete a policy, use two commands below to delete from PDP and PAP
519
520**DELETE POLICY INSIDE PDP**
521
522::
mrichommeefb859d2020-03-19 19:02:41 +0100523
Gary Wue4a2df82018-11-29 12:49:09 -0800524 curl -k -v -H 'Content-Type: application/json' \
525 -H 'Accept: application/json' \
526 -H 'ClientAuth: cHl0aG9uOnRlc3Q=' \
527 -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' \
528 -H 'Environment: TEST' \
529 -X DELETE \
530 -d '{"policyName": "OSDF_CASABLANCA.Config_MS_vnfPolicy_vFWHPA.1.xml","policyComponent":"PDP","policyType":"MicroService","pdpGroup":"default"}' https://pdp:8081/pdp/api/deletePolicy
531
532
533**DELETE POLICY INSIDE PAP**
534
535::
mrichommeefb859d2020-03-19 19:02:41 +0100536
Gary Wue4a2df82018-11-29 12:49:09 -0800537 curl -k -v -H 'Content-Type: application/json' \
538 -H 'Accept: application/json' \
539 -H 'ClientAuth: cHl0aG9uOnRlc3Q=' \
540 -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' \
541 -H 'Environment: TEST' \
542 -X DELETE \
mrichommeefb859d2020-03-19 19:02:41 +0100543 -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 -0800544
545Below are the 3 HPA policies for test cases in the `test plan <https://wiki.onap.org/pages/viewpage.action?pageId=41421112>`_
546
547**Test 1 (Basic)**
548
549Create Policy
550
551::
552
553 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 '{
554 "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\"}",
555 "policyName": "OSDF_CASABLANCA.hpa_policy_vFWHPA_1",
556 "policyConfigType": "MicroService",
557 "onapName": "SampleDemo",
558 "policyScope": "OSDF_CASABLANCA"
559 }' 'https://pdp:8081/pdp/api/createPolicy'
560
561
mrichommeefb859d2020-03-19 19:02:41 +0100562Push Policy
Gary Wue4a2df82018-11-29 12:49:09 -0800563
564::
565
566 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 '{
567 "pdpGroup": "default",
568 "policyName": "OSDF_CASABLANCA.hpa_policy_vFWHPA_1",
569 "policyType": "MicroService"
570 }' 'https://pdp:8081/pdp/api/pushPolicy'
571
572
573
574
575**Test 2: (to test SRIOV-NIC feature) (to ensure that right cloud-region is selected based on score)**
576
577Create Policy
578
579::
580
581 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 '{
582 "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\"}",
583 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_2",
584 "policyConfigType": "MicroService",
585 "onapName": "SampleDemo",
586 "policyScope": "OSDF_CASABLANCA"
587 }' 'https://pdp:8081/pdp/api/createPolicy'
588
589
mrichommeefb859d2020-03-19 19:02:41 +0100590Push Policy
Gary Wue4a2df82018-11-29 12:49:09 -0800591
592::
593
594 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 '{
595 "pdpGroup": "default",
596 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_2",
597 "policyType": "MicroService"
598 }' 'https://pdp:8081/pdp/api/pushPolicy'
599
600
601**Test 3 (to ensure that right cloud-region is selected based on score)**
602
603Create Policy
604
605::
606
607 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 '{
608 "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\"}",
609 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_3",
610 "policyConfigType": "MicroService",
611 "onapName": "SampleDemo",
612 "policyScope": "OSDF_CASABLANCA"
613 }' 'https://pdp:8081/pdp/api/createPolicy'
mrichommeefb859d2020-03-19 19:02:41 +0100614
615Push Policy
Gary Wue4a2df82018-11-29 12:49:09 -0800616
617::
618
619 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 '{
620 "pdpGroup": "default",
621 "policyName": "OSDF_CASABLANCA.hpa_policy_vFW_3",
622 "policyType": "MicroService"
623 }' 'https://pdp:8081/pdp/api/pushPolicy'
mrichommeefb859d2020-03-19 19:02:41 +0100624
Gary Wue4a2df82018-11-29 12:49:09 -080062517. Create Service Instance using step 13 above
626
62718. Check bpmn logs to ensure that OOF sent homing response and flavor directives.
628
62919. 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>`_.
630
63120. 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;
632
633::
634
635 {
636 "input": {
637 "request-information": {
638 "notification-url": "openecomp.org",
639 "order-number": "1",
640 "order-version": "1",
641 "request-action": "PreloadVNFRequest",
642 "request-id": "test"
643 },
644 "sdnc-request-header": {
645 "svc-action": "reserve",
646 "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
647 "svc-request-id": "test"
648 },
649 "vnf-topology-information": {
650 "vnf-assignments": {
651 "availability-zones": [],
652 "vnf-networks": [],
653 "vnf-vms": []
654 },
mrichommeefb859d2020-03-19 19:02:41 +0100655
656
657 "vnf-parameters": [
Gary Wue4a2df82018-11-29 12:49:09 -0800658 {
659 "vnf-parameter-name": "vfw_image_name",
660 "vnf-parameter-value": "ubuntu-16.04"
661 },
662 {
663 "vnf-parameter-name": "firewall_flavor_name",
664 "vnf-parameter-value": "m1.large"
665 },
666 {
667 "vnf-parameter-name": "sink_flavor_name",
668 "vnf-parameter-value": "m1.medium"
669 },
670 {
671 "vnf-parameter-name": "packetgen_flavor_name",
672 "vnf-parameter-value": "m1.large"
673 },
674 {
675 "vnf-parameter-name": "public_net_id",
676 "vnf-parameter-value": "external"
677 },
678 {
679 "vnf-parameter-name": "unprotected_private_net_id",
680 "vnf-parameter-value": "unprotected_private_net"
681 },
682 {
683 "vnf-parameter-name": "protected_private_net_id",
684 "vnf-parameter-value": "protected_private_net"
685 },
686 {
687 "vnf-parameter-name": "onap_private_net_id",
688 "vnf-parameter-value": "oam_onap_vnf_test"
689 },
690 {
691 "vnf-parameter-name": "onap_private_subnet_id",
692 "vnf-parameter-value": "oam_onap_vnf_test"
693 },
694 {
695 "vnf-parameter-name": "unprotected_private_net_cidr",
696 "vnf-parameter-value": "192.168.10.0/24"
697 },
698 {
699 "vnf-parameter-name": "protected_private_net_cidr",
700 "vnf-parameter-value": "192.168.20.0/24"
701 },
702 {
703 "vnf-parameter-name": "onap_private_net_cidr",
704 "vnf-parameter-value": "10.0.0.0/16"
705 },
706 {
707 "vnf-parameter-name": "vfw_private_ip_0",
708 "vnf-parameter-value": "192.168.10.100"
709 },
710 {
711 "vnf-parameter-name": "vfw_private_ip_1",
712 "vnf-parameter-value": "192.168.20.100"
713 },
714 {
715 "vnf-parameter-name": "vfw_private_ip_2",
716 "vnf-parameter-value": "10.0.100.1"
717 },
718 {
719 "vnf-parameter-name": "vpg_private_ip_0",
720 "vnf-parameter-value": "192.168.10.200"
721 },
722 {
723 "vnf-parameter-name": "vpg_private_ip_1",
724 "vnf-parameter-value": "10.0.100.2"
725 },
726 {
727 "vnf-parameter-name": "vsn_private_ip_0",
728 "vnf-parameter-value": "192.168.20.250"
729 },
730 {
731 "vnf-parameter-name": "vsn_private_ip_1",
732 "vnf-parameter-value": "10.0.100.3"
733 },
mrichommeefb859d2020-03-19 19:02:41 +0100734
Gary Wue4a2df82018-11-29 12:49:09 -0800735 {
736 "vnf-parameter-name": "vfw_name_0",
737 "vnf-parameter-value": "vfw"
738 },
739 {
740 "vnf-parameter-name": "vpg_name_0",
741 "vnf-parameter-value": "vpktgen"
742 },
743 {
744 "vnf-parameter-name": "vsn_name_0",
745 "vnf-parameter-value": "vsink"
746 },
747 {
748 "vnf-parameter-name": "vfw_private_0_port_vnic_type",
749 "vnf-parameter-value": "normal"
750 },
751 {
752 "vnf-parameter-name": "vfw_private_1_port_vnic_type",
753 "vnf-parameter-value": "normal"
754 },
755 {
756 "vnf-parameter-name": "vfw_private_2_port_vnic_type",
757 "vnf-parameter-value": "normal"
758 },
759 {
760 "vnf-parameter-name": "vpg_private_0_port_vnic_type",
761 "vnf-parameter-value": "normal"
762 },
763 {
764 "vnf-parameter-name": "vpg_private_1_port_vnic_type",
765 "vnf-parameter-value": "normal"
766 },
767 {
768 "vnf-parameter-name": "vsn_private_0_port_vnic_type",
769 "vnf-parameter-value": "normal"
770 },
771 {
772 "vnf-parameter-name": "vsn_private_1_port_vnic_type",
773 "vnf-parameter-value": "normal"
774 },
775 {
776 "vnf-parameter-name": "vf_module_id",
mrichommeefb859d2020-03-19 19:02:41 +0100777 "vnf-parameter-value": "VfwHpa..base_vfw..module-0"
Gary Wue4a2df82018-11-29 12:49:09 -0800778 },
779 {
780 "vnf-parameter-name": "sec_group",
781 "vnf-parameter-value": "default"
782 },
783 {
784 "vnf-parameter-name": "sdnc_model_name",
785 "vnf-parameter-value": ""
786 },
787 {
788 "vnf-parameter-name": "sdnc_model_version",
789 "vnf-parameter-value": ""
790 },
791 {
792 "vnf-parameter-name": "sdnc_artifact_name",
793 "vnf-parameter-value": ""
794 },
795
796 {
797 "vnf-parameter-name": "oof_directives",
798 "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\"}]}]}"
799 },
mrichommeefb859d2020-03-19 19:02:41 +0100800
Gary Wue4a2df82018-11-29 12:49:09 -0800801 {
802 "vnf-parameter-name": "sdnc_directives",
803 "vnf-parameter-value": "{}"
mrichommeefb859d2020-03-19 19:02:41 +0100804 },
805
Gary Wue4a2df82018-11-29 12:49:09 -0800806 {
807 "vnf-parameter-name": "template_type",
808 "vnf-parameter-value": "heat"
809 }
mrichommeefb859d2020-03-19 19:02:41 +0100810
811
Gary Wue4a2df82018-11-29 12:49:09 -0800812 ],
813 "vnf-topology-identifier": {
814 "generic-vnf-name": "oof-12-vnf-3",
mrichommeefb859d2020-03-19 19:02:41 +0100815 "generic-vnf-type": "vfw_hpa 0",
Gary Wue4a2df82018-11-29 12:49:09 -0800816 "service-type": "6b17354c-0fae-4491-b62e-b41619929c54",
mrichommeefb859d2020-03-19 19:02:41 +0100817 "vnf-name": "vfwhpa_stack",
Gary Wue4a2df82018-11-29 12:49:09 -0800818 "vnf-type": "VfwHpa..base_vfw..module-0"
mrichommeefb859d2020-03-19 19:02:41 +0100819
Gary Wue4a2df82018-11-29 12:49:09 -0800820 }
821 }
822 }}
Gary Wue4a2df82018-11-29 12:49:09 -0800823
mrichommeefb859d2020-03-19 19:02:41 +0100824
825Change parameters based on your environment.
Gary Wue4a2df82018-11-29 12:49:09 -0800826
827**Note**
828
829::
830
831 "generic-vnf-name": "oof-12-vnf-3", <-- NAME GIVEN TO VNF
832 "generic-vnf-type": "vfw_hpa 0", <-- can be found on VNF dialog screen get the part of the VNF-TYPE after the '/'
833 "service-type": "6b17354c-0fae-4491-b62e-b41619929c54", <-- same as Service Instance ID
834 "vnf-name": "vfwhpa_stack", <-- name to be given to the vf module
835 "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 +0100836
Gary Wue4a2df82018-11-29 12:49:09 -080083721. 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).