Merge "[DOC] Reactivate docs-linkcheck profile"
[doc.git] / docs / guides / onap-user / vfw-deployment-tutorial / index.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License. http://creativecommons.org/licenses/by/4.0
3 .. Copyright © 2017-2020 Aarna Networks, Inc.
4
5 vFW Service Deployment Tutorial
6 ###############################
7
8 In this tutorial, we will deploy the service created in the previous Service Design tutorial onto OpenStack.
9 We will do so by using the VID GUI from the ONAP Portal. Login as user demo.
10
11 In this section, you will learn the following through VID GUI
12
13 * How to Instantiate a Service
14 * How to Instantiate a VNF
15 * How to Instantiate VF Module
16 * How to Instantiate Network
17
18 Let us start by running Robot init script
19
20 1. Run Robot init script to populate demo models.
21
22 .. code-block::
23
24   cd ~/oom/kubernetes/robot
25   ./demo-k8s.sh onap init
26
27   Result:
28   All tests must pass, below is sample output.
29
30   Number of parameters:
31   2
32   KEY:
33   init
34   ++ kubectl --namespace onap get pods
35   ++ sed 's/ .*//'
36   ++ grep robot
37   + POD=dev-robot-578b965f4d-vlk8b
38   ++ dirname ./demo-k8s.sh
39   + DIR=.
40   + SCRIPTDIR=scripts/demoscript
41   + ETEHOME=/var/opt/ONAP
42   + '[' ']'
43   ++ kubectl --namespace onap exec dev-robot-578b965f4d-vlk8b -- bash -c 'ls -1q /share/logs/ | wc -l'
44   + export GLOBAL_BUILD_NUMBER=3
45   + GLOBAL_BUILD_NUMBER=3
46   ++ printf %04d 3
47   + OUTPUT_FOLDER=0003_demo_init
48   + DISPLAY_NUM=93
49   + VARIABLEFILES='-V /share/config/robot_properties.py'
50   + kubectl --namespace onap exec dev-robot-578b965f4d-vlk8b -- /var/opt/ONAP/runTags.sh -V /share/config/robot_properties.py
51   -d /share/logs/0003_demo_init -i InitDemo   --display 93
52   Starting Xvfb on display :93 with res 1280x1024x24
53   Executing robot tests at log level TRACE
54   ==============================================================================
55   Testsuites
56   ==============================================================================
57   Testsuites.Demo :: Executes the VNF Orchestration Test cases including setu...
58   ==============================================================================
59   Initialize Customer And Models                                        | PASS |
60   ------------------------------------------------------------------------------
61   Initialize SO Openstack Identity For V3                               | PASS |
62   ------------------------------------------------------------------------------
63   Testsuites.Demo :: Executes the VNF Orchestration Test cases inclu... | PASS |
64   2 critical tests, 2 passed, 0 failed
65   2 tests total, 2 passed, 0 failed
66   ==============================================================================
67   Testsuites                                                            | PASS |
68   2 critical tests, 2 passed, 0 failed
69   2 tests total, 2 passed, 0 failed
70   ==============================================================================
71   Output:  /share/logs/0003_demo_init/output.xml
72   Log:     /share/logs/0003_demo_init/log.html
73   Report:  /share/logs/0003_demo_init/report.html
74
75 2. Create vFW_demo_service Instance
76
77  A. Login into the ONAP portal as user demo / demo123456!
78
79  |image4|
80
81  B. Go to Home and select Virtual Infrastructure Deployment (VID) application
82
83  |image11|
84
85 If you see VID reporting a Security failure, and the browser does not give option to Allow Exception button as below
86
87 |image22|
88
89 Apply the below workaround for the above issue
90
91 Copy the vid.api.simpledemo.onap.org:30200 from the above window, open new tab and paste the copied URL
92 as https://vid.api.simpledemo.onap.org:30200 and click on Advanced then click on Accept the Risk and Continue tab
93
94 |image13|
95
96 Then Close the tab, go to the ONAP Home page and load the VID UI again, you will see VID home page
97
98 |image17|
99
100  C. Select Test API for A-la-carte as VNF_API(old) then click Browse SDC Service Models (Left side panel)
101
102  |image10|
103
104  D. Search for the service to instantiate, select a service (vfw_demo_service) distributed in SDC and click Deploy
105
106  |image1|
107
108  E. Complete the fields indicated by the red star and click Confirm
109
110   * Instance Name = vFW_service_00
111   * Subscriber Name = Demonstration
112   * Service Type = vFW
113   * Owning Entity = OE-Demonstration
114
115  |image24|
116
117  F. Select Confirm Button
118
119   We should see the “Service instance was created successfully” message
120
121  |image15|
122
123  G. Click Close and the next screen should appear. It will allow you to declare VNF(s) and Network(s)
124  that are part of the service model composition
125
126  |image29|
127
128 3. Instantiate a VNF
129
130  A. click on “Add node instance” and select the VNF you want to instantiate in the list
131
132  |image9|
133
134  B. Complete the fields indicated by the red star and click Confirm
135
136   * Instance Name = vFW_demo_VNF
137   * Product Family = vFW
138   * Region = RegionOne(CLOUDOWNER)
139   * Tenant = admin
140   * Line Of Business = LOB-Demonstration
141   * Platform = Platform-Demonstration
142
143  |image6|
144
145 You will get a status complete dialog message
146
147 |image18|
148
149  C. Click on close button, the following screen then should appear
150
151  |image16|
152
153 4. Instantiate VF Module
154
155  Note: Before creating VF module get the required parameter values to prepare SDNC preload data
156
157  A. Copy the following VNF attributes from VNF instance detail screen
158
159   * generic-vnf-name = vFW_demo_VNF (value must be equal to the VNF instance name value)
160
161   |image25|
162
163   * generic-vnf-type = vFW_demo_service/vFW_demo 0 (value must be equal to VNF Type value)
164
165   |image20|
166
167   * service-type =  f7c80167-ed06-48ef-a991-61b43196f98f (value must be equal to the service instance id value)
168
169   |image26|
170
171  B. Copy the following attributes From Create VF Module screen
172
173   * vnf-name = lfn_vf_module (value must be equal to the VF module instance name value)
174   * vnf-type = VfwDemo..base_vfw..module-0 (value must be equal to the “Model Name” value - see create VF module screen)
175
176   |image27|
177
178  C. Get the required vnf-parameters values from Heat env file imported while SDC design
179  (refer  https://github.com/onap/demo/blob/master/heat/vFW/base_vfw.env)
180
181  Login to Openstack and execute the below commands and get the required openstack related parameter values
182  to update in SDNC preload data
183
184  * download the image ubuntu-14.04 from cloud images & create an image with "ubuntu-14-04-cloud-amd6" name
185  * create the flavor with m1.medium
186  * create OAM_NETWORK ID  & OAM_SUBNET ID (use subnet range from base_vfw.env file)
187  * execute openstack security group rule to open all ports for onap
188
189  D. Run the SDNC preload curl command
190  Below is the sample curl command updated with all the required parameters
191
192  .. code-block::
193
194    curl -k -X POST \
195    https://sdnc.api.simpledemo.onap.org:30267/restconf/operations/VNF-API:preload-vnf-topology-operation \
196    -H 'Accept: application/json' \
197    -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
198    -H 'Content-Type: application/json' \
199    -H 'X-FromAppId: API client' \
200    -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
201    -H 'cache-control: no-cache' \
202    -d '{
203     "input": {
204     "request-information": {
205     "notification-url": "onap.org",
206     "order-number": "1",
207     "order-version": "1",
208     "request-action": "PreloadVNFRequest",
209     "request-id": "test"
210     },
211     "sdnc-request-header": {
212     "svc-action": "reserve",
213     "svc-notification-url": "http:\/\/onap.org:8080\/adapters\/rest\/SDNCNotify",
214     "svc-request-id": "test"
215     },
216     "vnf-topology-information": {
217     "vnf-assignments": {
218     "availability-zones": [],
219     "vnf-networks": [],
220     "vnf-vms": []
221     },
222     "vnf-parameters": [{
223     "vnf-parameter-name": "vfw_image_name",
224     "vnf-parameter-value": "ubuntu-14-04-cloud-amd6"
225     },
226     {
227     "vnf-parameter-name": "vfw_flavor_name",
228     "vnf-parameter-value": "m1.medium"
229     },
230     {
231     "vnf-parameter-name": "vfw_name_0",
232     "vnf-parameter-value": "zdfw1fwl01fwl01"
233     },
234     {
235     "vnf-parameter-name": "vfw_int_unprotected_private_ip_0",
236     "vnf-parameter-value": "192.168.10.101"
237     },
238     {
239     "vnf-parameter-name": "vfw_int_protected_private_ip_0",
240     "vnf-parameter-value": "192.168.20.101"
241     },
242     {
243     "vnf-parameter-name": "vfw_onap_private_ip_0",
244     "vnf-parameter-value": "10.0.100.5"
245     },
246     {
247     "vnf-parameter-name": "vfw_int_protected_private_floating_ip",
248     "vnf-parameter-value": "192.168.10.200"
249     },
250     {
251     "vnf-parameter-name": "vpg_int_unprotected_private_ip_0",
252     "vnf-parameter-value": "192.168.10.201"
253     },
254     {
255     "vnf-parameter-name": "vpg_image_name",
256     "vnf-parameter-value": "ubuntu-14-04-cloud-amd6"
257     },
258     {
259     "vnf-parameter-name": "vpg_flavor_name",
260     "vnf-parameter-value": "m1.medium"
261     },
262     {
263     "vnf-parameter-name": "vpg_name_0",
264     "vnf-parameter-value": "zdfw1fwl01pgn01"
265     },
266     {
267     "vnf-parameter-name": "vpg_onap_private_ip_0",
268     "vnf-parameter-value": "10.0.100.6"
269     },
270     {
271     "vnf-parameter-name": "vsn_image_name",
272     "vnf-parameter-value": "ubuntu-14-04-cloud-amd6"
273     },
274     {
275     "vnf-parameter-name": "vsn_flavor_name",
276     "vnf-parameter-value": "m1.medium"
277     },
278     {
279     "vnf-parameter-name": "vsn_name_0",
280     "vnf-parameter-value": "zdfw1fwl01snk01"
281     },
282     {
283     "vnf-parameter-name": "vsn_int_protected_private_ip_0",
284     "vnf-parameter-value": "192.168.20.251"
285     },
286     {
287     "vnf-parameter-name": "vsn_onap_private_ip_0",
288     "vnf-parameter-value": "10.0.100.7"
289     },
290     {
291     "vnf-parameter-name": "public_net_id",
292     "vnf-parameter-value": "07e85197-0f0a-45ca-8a6e-8eee47cec56b"
293     },
294     {
295     "vnf-parameter-name": "unprotected_private_net_id",
296     "vnf-parameter-value": "zdfw1fwl01_unprotected"
297     },
298     {
299     "vnf-parameter-name": "unprotected_private_net_cidr",
300     "vnf-parameter-value": "192.168.10.0/24"
301     },
302     {
303     "vnf-parameter-name": "protected_private_net_id",
304     "vnf-parameter-value": "zdfw1fwl01_protected"
305     },
306     {
307     "vnf-parameter-name": "protected_private_net_cidr",
308     "vnf-parameter-value": "192.168.20.0/24"
309     },
310     {
311     "vnf-parameter-name": "onap_private_net_id",
312     "vnf-parameter-value": "OAM_NETWORK"
313     },
314     {
315     "vnf-parameter-name": "onap_private_subnet_id",
316     "vnf-parameter-value": "OAM_SUBNET"
317     },
318     {
319     "vnf-parameter-name": "onap_private_net_cidr",
320     "vnf-parameter-value": "10.0.0.0/16"
321     },
322     {
323     "vnf-parameter-name": "vfw_name",
324     "vnf-parameter-value": "vFW_demo_VNF"
325     },
326     {
327     "vnf-parameter-name": "vnf_id:",
328     "vnf-parameter-value": "vFirewall_demo_app"
329     },
330     {
331     "vnf-parameter-name": "vf_module_id:",
332     "vnf-parameter-value": "vFirewall"
333     },
334     {
335     "vnf-parameter-name": "dcae_collector_ip",
336     "vnf-parameter-value": "10.43.134.33"
337     },
338     {
339     "vnf-parameter-name": "dcae_collector_port",
340     "vnf-parameter-value": "30417"
341     },
342     {
343     "vnf-parameter-name": "demo_artifacts_version",
344     "vnf-parameter-value": "1.6.0-SNAPSHOT"
345     },
346     {
347     "vnf-parameter-name": "install_script_version",
348     "vnf-parameter-value": "1.6.0-SNAPSHOT"
349     },
350     {
351     "vnf-parameter-name": "key_name",
352     "vnf-parameter-value": "vfw_key"
353     },
354     {
355     "vnf-parameter-name": "pub_key",
356     "vnf-parameter-value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCofPKCypUIALLlSAa/INJZpnz6dPnTKuKkqO5Wxkv35PnHpXVmKit1iXNcy85+ceoMUrMre8O7SjIhdRklnOckW68WmkM9A+pFIFhxoKRfO0WR2/qZyXxM9WuQ5ESdXuBj5ydx7XlWWDtGTWF3wWxrFwob2EkWm+EXFrx18bNs8OqJF+1DDJfjLcC8kKgCwSKNcuRelDSBBaIrIDROdHi1r2AbdL/REZ4sprUTICVAhezX9mPowMX8Mr3ZuTxV9HpU43nlxfWxm9vDstyhiUMpYYCOWUfA/Gzxz/F1pli9L4MfpDsiwGaJtnnQ3vWiYRPZBTv+6h1miYlw4Fm7vJq9 aarna-onap"
357     },
358     {
359     "vnf-parameter-name": "cloud_env",
360     "vnf-parameter-value": "openstack"
361     },
362     {
363     "vnf-parameter-name": "sec_group",
364     "vnf-parameter-value": "default"
365     },
366     {
367     "vnf-parameter-name": "nexus_artifact_repo",
368     "vnf-parameter-value": "https://nexus.onap.org"
369     }
370     ],
371     "vnf-topology-identifier": {
372     "generic-vnf-name": "vFW_demo_VNF",
373     "generic-vnf-type": "vFW_demo_service/vFW_demo 0",
374     "service-type": "f7c80167-ed06-48ef-a991-61b43196f98f",
375     "vnf-name": "lfn_vf_module",
376     "vnf-type": "VfwDemo..base_vfw..module-0"
377     }
378     }
379     }
380    }'
381
382    Output looks somthing like below
383    {"output":{"svc-request-id":"test","response-code":"200","ack-final-indicator":"Y"}}
384
385  E. Now click on Add VF-Module with the same name as updated through SDNC preload, click on SDN-C Preload
386  check box then press confirm
387
388  |image28|
389
390 You will get a status complete dialog message
391
392 |image2|
393
394  F. Click on close, now the following screen should appear
395
396  |image19|
397
398 5. Instantiate Network
399
400  A. Prepare the “SDNC preload” data before creating network instance
401
402   * network-role =  integration_test_net (provide any value)
403   * network-technology = neutron (use “neutron” as this example will instantiate a network using openstack neutron application)
404   * service-type = vFW_demo_service (value must be equal to “Service Name” (=service model name) displayed on VID screen)
405
406   |image5|
407
408   * network-name = lfn_nwt_001 (value must be equal to the desired network instance name)
409
410   |image7|
411
412   * network-type = Generic NeutronNet (value must be equal to “Model Name”“Generic NeutronNet” displayed on VID screen)
413
414   |image8|
415
416  B. Run the below SDNC preload curl command
417
418  .. code-block::
419
420    curl -k -X POST \
421    https://sdnc.api.simpledemo.onap.org:30267/restconf/operations/VNF-API:preload-network-topology-operation \
422    -H 'Accept: application/json' \
423    -H 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \
424    -H 'Content-Type: application/json' \
425    -H 'X-FromAppId: API client' \
426    -H 'X-TransactionId: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
427    -H 'cache-control: no-cache' \
428    -d '{
429    "input": {
430     "request-information": {
431     "request-id": "postman001",
432     "notification-url": "http://so.onap.org",
433     "order-number": "postman001",
434     "request-sub-action": "SUPP",
435     "request-action": "PreloadNetworkRequest",
436     "source": "postman",
437     "order-version": "1.0"
438     },
439     "network-topology-information": {
440     "network-policy": [],
441     "route-table-reference": [],
442     "vpn-bindings": [],
443     "network-topology-identifier": {
444         "network-role": "integration_test_net",
445         "network-technology": "neutron",
446         "service-type": "vFW_demo_service",
447         "network-name": "lfn_nwt_001",
448         "network-type": "Generic NeutronNet"
449     },
450     "provider-network-information": {
451         "is-external-network": "false",
452         "is-provider-network": "false",
453         "is-shared-network": "false"
454     },
455     "subnets": [
456         {
457         "subnet-name": "test-subnet-001",
458         "subnet-role": "OAM",
459         "start-address": "10.0.0.11",
460         "cidr-mask": "16",
461         "ip-version": "4",
462         "dhcp-enabled": "Y",
463         "dhcp-start-address": "",
464         "dhcp-end-address": "",
465         "gateway-address": "10.0.0.1",
466         "host-routes":[]
467         }
468             ]
469     },
470     "sdnc-request-header": {
471     "svc-action": "reserve",
472     "svc-notification-url": "http://so.onap.org",
473     "svc-request-id": "postman001"
474      }
475     }
476    }
477    '
478
479    Output looks something like below
480    {"output":{"svc-request-id":"postman001","response-code":"200","ack-final-indicator":"Y"}}
481
482  C. Click on “Add Network” and select the Network you want to instantiate in the list
483
484  |image12|
485
486  D. Click Confirm, We will get a status complete dialog message
487
488  |image14|
489
490  E. Click close, the following screen should appear
491
492  |image3|
493
494  At this point, the Network and subnets are now instantiated in the cloud platform
495
496 6. Now login to OpenStack Horizon dashboard, see stacks created in Openstack
497
498  A. Go to Project → Orchestration → Stacks
499  We can see the VF module and Network stacks status
500
501  |image23|
502
503  B. Now we can go to Admin → Compute → Instances to check the instances status
504
505  |image21|
506
507
508 .. |image4| image:: media/image4.png
509 .. |image11| image:: media/image11.png
510 .. |image22| image:: media/image22.png
511 .. |image13| image:: media/image13.png
512 .. |image17| image:: media/image17.png
513 .. |image10| image:: media/image10.png
514 .. |image1| image:: media/image1.png
515 .. |image24| image:: media/image24.png
516 .. |image15| image:: media/image15.png
517 .. |image29| image:: media/image29.png
518 .. |image9| image:: media/image9.png
519 .. |image6| image:: media/image6.png
520 .. |image18| image:: media/image18.png
521 .. |image16| image:: media/image16.png
522 .. |image25| image:: media/image25.png
523 .. |image20| image:: media/image20.png
524 .. |image26| image:: media/image26.png
525 .. |image27| image:: media/image27.png
526 .. |image28| image:: media/image28.png
527 .. |image2| image:: media/image2.png
528 .. |image19| image:: media/image19.png
529 .. |image5| image:: media/image5.png
530 .. |image7| image:: media/image7.png
531 .. |image8| image:: media/image8.png
532 .. |image12| image:: media/image12.png
533 .. |image14| image:: media/image14.png
534 .. |image3| image:: media/image3.png
535 .. |image23| image:: media/image23.png
536 .. |image21| image:: media/image21.png
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557