Issue-ID: INT-1129
[integration.git] / docs / docs_scaleout.rst
1 .. _docs_scaleout:
2
3 VF Module Scale Out Use Case
4 ----------------------------
5
6 Source files
7 ~~~~~~~~~~~~
8 - Heat templates directory: https://git.onap.org/demo/tree/heat/vLB_CDS?h=dublin
9
10 Additional files
11 ~~~~~~~~~~~~~~~~
12 - DCAE blueprint: https://git.onap.org/integration/tree/docs/files/scaleout/k8s-tca-clamp-policy-05162019.yaml
13 - TOSCA model template: https://git.onap.org/integration/tree/docs/files/scaleout/service-Vloadbalancercds-template.yml
14 - Naming policy script: https://git.onap.org/integration/tree/docs/files/scaleout/push_naming_policy.sh
15
16 Description
17 ~~~~~~~~~~~
18 The scale out use case uses a VNF composed of three virtual functions. A traffic generator (vPacketGen), a load balancer (vLB), and a DNS (vDNS). Communication between the vPacketGen and the vLB, and the vLB and the vDNS occurs via two separate private networks. In addition, all virtual functions have an interface to the ONAP OAM private network, as shown in the topology below.
19
20 .. figure:: files/scaleout/topology.png
21    :align: center
22
23 The vPacketGen issues DNS lookup queries that reach the DNS server via the vLB. vDNS replies reach the packet generator via the vLB as well. The vLB reports the average amount of traffic per vDNS instances over a given time interval (e.g. 10 seconds) to the DCAE collector via the ONAP OAM private network.
24
25 To run the use case, make sure that the security group in OpenStack has ingress/egress entries for protocol 47 (GRE). Users can test the VNF by running DNS queries from the vPakcketGen:
26
27 ::
28
29   dig @vLoadBalancer_IP host1.dnsdemo.onap.org
30
31 The output below means that the vLB has been set up correctly, has forwarded the DNS queries to a vDNS instance, and the vPacketGen has received the vDNS reply message.
32
33 ::
34
35     ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @192.168.9.111 host1.dnsdemo.onap.org
36     ; (1 server found)
37     ;; global options: +cmd
38     ;; Got answer:
39     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31892
40     ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
41     ;; WARNING: recursion requested but not available
42
43     ;; OPT PSEUDOSECTION:
44     ; EDNS: version: 0, flags:; udp: 4096
45     ;; QUESTION SECTION:
46     ;host1.dnsdemo.onap.org.            IN      A
47
48     ;; ANSWER SECTION:
49     host1.dnsdemo.onap.org.     604800  IN      A       10.0.100.101
50
51     ;; AUTHORITY SECTION:
52     dnsdemo.onap.org.   604800  IN      NS      dnsdemo.onap.org.
53
54     ;; ADDITIONAL SECTION:
55     dnsdemo.onap.org.   604800  IN      A       10.0.100.100
56
57     ;; Query time: 0 msec
58     ;; SERVER: 192.168.9.111#53(192.168.9.111)
59     ;; WHEN: Fri Nov 10 17:39:12 UTC 2017
60     ;; MSG SIZE  rcvd: 97
61
62
63 The Scale Out Use Case
64 ~~~~~~~~~~~~~~~~~~~~~~
65 The Scale Out use case shows how users/network operators can add Virtual Network Function Components (VNFCs) as part of a VF Module that has been instantiated in the Service model, in order to increase capacity of the network. ONAP Dublin release supports scale out with manual trigger by directly calling SO APIs and closed-loop-enabled automation from Policy. For Dublin, the APPC controller is used to demonstrate accepting request from SO to execute the Scale Out operation. APPC can be used to scale different VNF types, not only the VNF described in this document.
66
67
68 PART 1 - Service Definition and Onboarding
69 ------------------------------------------
70 This use-case requires operations on several ONAP components to perform service definition and onboarding
71
72
73 1-1 using CDS : VNF configuration modeling and upload
74 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75 For Dublin, the scale out use case integrates with the Controller Design Studio (CDS) ONAP component to automate the generation of cloud configuration at VNF instantiation time. Users can model this configuration at VNF design time and onboard the blueprint to CDS via the CDS GUI. The blueprint includes naming policies and network configuration details (e.g. IP address families, network names, etc.) that CDS will use during VNF instantiation to generate resource names and assign network configuration to VMs through the cloud orchestrator.
76
77 Please look at the CDS documentation for details about how to create configuration models, blueprints, and use the CDS tool: https://wiki.onap.org/display/DW/Modeling+Concepts. For running the use case, users can use the standard model package that CDS provides out of the box, which can be found here: https://wiki.onap.org/pages/viewpage.action?pageId=64007442
78
79
80 1-2 using SDC : VNF onboarding and Service definition
81 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82 Once the configuration blueprint is uploaded to CDS, users can define and onboard a service using SDC. For details about service design and creation, please refer to the SDC wiki page: https://wiki.onap.org/display/DW/Design
83
84 During the creation of the service in SDC, there are a few extra steps that need to be executed to make the VNF ready for scale out. These require users to login to the SDC Portal as service designer user (username: cs0008, password: demo123456!).
85
86 After importing the Vendor Software Package (VSP), as described in the SDC wiki page, users need to set property values in the Property Assignment window, as shown below:
87
88 .. figure:: files/scaleout/9.png
89    :align: center
90
91 These properties include parameters in the Heat template (which will be overridden by CDS and then don't need to be changed) and other parameters that describe the VNF type or are used to link the service to the configuration in the CDS package.
92
93 Users can search for parameter names starting with "nf" to assign values that describe the VNF type, such as nf_type, nf_function, and nf_role. Users are free to choose the values they like. Users should also set "skip_post_instantiation" to "TRUE", as for Dublin CDS is not used for post-instantiation configuration.
94
95 .. figure:: files/scaleout/10.png
96    :align: center
97
98 For CDS parameters, users can search for names starting with "sdnc". These parameters have to match the configuration blueprint in CDS. To use the standard blueprint shipped with CDS, please set the parameters as below. For further details, please refer to the CDS documentation.
99
100 .. figure:: files/scaleout/11.png
101    :align: center
102
103
104 After importing the VSP, users need to onboard the DCAE blueprint and the Policy Model used to design closed loops in CLAMP. From the "Composition" tab in the service menu, select the artifact icon on the right, as shown below:
105
106 .. figure:: files/scaleout/1.png
107    :align: center
108
109 Upload the DCAE blueprint linked at the top of the page using the pop-up window.
110
111 .. figure:: files/scaleout/2.png
112    :align: center
113
114 The blueprint will appear in the artifacts section on the right.
115
116 .. figure:: files/scaleout/3.png
117    :align: center
118
119 To attach a Policy Model to the service, open the Policy drop-down list on left.
120
121 .. figure:: files/scaleout/4.png
122    :align: center
123
124 Then, add the TCA Policy.
125
126 .. figure:: files/scaleout/5.png
127    :align: center
128
129 The Policy will be attached to the service defined in SDC
130
131 .. figure:: files/scaleout/6.png
132    :align: center
133
134 Finally, users need to provide the maximum number of VNF instances that ONAP is allowed to create as part of the scale out use case by setting up deployment properties.
135
136 .. figure:: files/scaleout/7.png
137    :align: center
138
139 This VNF only supports scaling the vDNS, so users should select the vDNS module from the right panel and then click the "max_vf_module_instance" link. The maximum number of VNF instances to scale can be set to an arbitrary number higher than zero.
140
141 .. figure:: files/scaleout/8.png
142    :align: center
143
144 At this point, users can complete the service creation in SDC by testing, accepting, and distributing the Service Models as described in the SDC user manual.
145
146
147
148 1-3 using a shell script : deploy naming policy
149 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150 In order to instantiate the VNF using CDS features, users need to deploy the naming policy that CDS uses for resource name generation to the Policy Engine. User can copy and run the script at the top of the page from any ONAP pod, for example Robot or Drools. The script uses the Policy endpoint defined in the Kubernetes domain, so the execution has to be triggered from some pod in the Kubernetes space.
151
152 ::
153
154     kubectl exec -it dev-policy-drools-0
155     ./push_naming_policy.sh
156
157
158 1-4 using CLAMP : Closed Loop Design
159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160 Once the service model is distributed, users can design the closed loop from CLAMP, using the GUI at https://clamp.api.simpledemo.onap.org:30258/designer/index.html
161
162 Use the "Closed Loop" link to open a distributed model.
163
164 .. figure:: files/scaleout/12.png
165    :align: center
166
167 Select the closed loop associated to the distributed service model.
168
169 .. figure:: files/scaleout/13.png
170    :align: center
171
172 The closed loop main page for TCA microservices is shown below.
173
174 .. figure:: files/scaleout/14.png
175    :align: center
176
177 Click on the TCA box to create a configuration policy. From the pop-up window, users need to click "Add item" to create a new policy and fill it in with specific information, as shown below.
178
179 .. figure:: files/scaleout/15.png
180    :align: center
181
182 For this use case, the control loop schema type is "VM", while the event name has to match the event name reported in the VNF telemetry, which is "vLoadBalancer".
183
184 Once the policy item has been created, users can define a threshold that will be used at runtime to evaluate telemetry reported by the vLB. When the specified threshold is crossed, DCAE generates an ONSET event that will tell Policy Engine which closed loop to activate.
185
186 .. figure:: files/scaleout/16.png
187    :align: center
188
189 After the configuration policy is created, users need to create the operational policy, which the Policy Engine uses to determine which actions and parameters should be used during closed loop.
190
191 .. figure:: files/scaleout/17.png
192    :align: center
193
194 Select "VF Module Create" recipe and "SO" actor. The payload section is:
195
196 ::
197
198     requestParameters: '{"usePreload":false,"userParams":[]}'
199     configurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[17].value","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[31].value"}]'
200
201 Policy Engine passes the payload to SO, which will then use it during VF module instantiation to resolve configuration parameters. The JSON path
202
203 ::
204
205     "ip-addr":"$.vf-module-topology.vf-module-parameters.param[17].value"
206
207 indicates that resolution for parameter "ip-addr" is available at "$.vf-module-topology.vf-module-parameters.param[17].value" in the JSON object linked by the VF module self-link in AAI. For the vPacketGen/vLB/vDNS VNF, use the JSON paths provided in the example above.
208
209 The target type to select is VF module, as we are scaling a VF module. Please select the vDNS module as target resource ID.
210
211 .. figure:: files/scaleout/18.png
212    :align: center
213
214 For what regards guard policies, either "Frequency Limiter", or "MinMax", or both can be used for the scale out use case. The example below shows the definition of a "Frequency Limiter" guard policy. Irrespective of the guard policy type, the policy name should be x.y.scaleout.
215
216 Once the operational policy design is completed, users can submit and then deploy the closed loop clicking the "Submit" and "Deploy" buttons, respectively, as shown below.
217
218 .. figure:: files/scaleout/20.png
219    :align: center
220
221 At this point, the closed loop is deployed to Policy Engine and DCAE, and a new microservice will be deployed to the DCAE platform.
222
223
224 1-5 using CDT : Creating a VNF Template
225 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226 Before running scale out use case, the users need to create a VNF template using the Controller Design Tool (CDT), a design-time tool that allows users to create and on-board VNF templates into APPC. The template describes which control operation can be executed against the VNF (e.g. scale out, health check, modify configuration, etc.), the protocols that the VNF supports, port numbers, VNF APIs, and credentials for authentication. Being VNF agnostic, APPC uses these templates to "learn" about specific VNFs and the supported operations.
227 CDT requires two input:
228
229 1) the list of parameters that APPC will receive (ip-addr, oam-ip-addr, enabled in the example above);
230
231 2) the VNF API that APPC will use to reconfigure the VNF.
232
233 Below is an example of the parameters file (yaml format), which we call parameters.yaml:
234 ::
235
236     version: V1
237     vnf-parameter-list:
238     - name: ip-addr
239       type: null
240       description: null
241       required: "true"
242       default: null
243       source: Manual
244       rule-type: null
245       request-keys: null
246       response-keys: null
247     - name: oam-ip-addr
248       type: null
249       description: null
250       required: "true"
251       default: null
252       source: Manual
253       rule-type: null
254       request-keys: null
255       response-keys: null
256     - name: enabled
257       type: null
258       description: null
259       required: "false"
260       default: null
261       source: Manual
262       rule-type: null
263       request-keys: null
264       response-keys: null
265
266 Here is an example of API for the vLB VNF used for this use case. We name the file after the vnf-type contained in SDNC (i.e. Vloadbalancerms..vdns..module-3):
267 ::
268
269     <vlb-business-vnf-onap-plugin xmlns="urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin">
270         <vdns-instances>
271             <vdns-instance>
272                 <ip-addr>${ip-addr}</ip-addr>
273                 <oam-ip-addr>${oam-ip-addr}</oam-ip-addr>
274                 <enabled>true</enabled>
275             </vdns-instance>
276         </vdns-instances>
277     </vlb-business-vnf-onap-plugin>
278
279 To create the VNF template in CDT, the following steps are required:
280
281 - Connect to the CDT GUI: http://ANY-K8S-IP:30289
282 - Click "My VNF" Tab. Create your user ID, if necessary
283 - Click "Create new VNF" entering the VNF type as reported in VID or AAI, e.g. vLoadBalancerMS/vLoadBalancerMS 0
284 - Select "ConfigScaleOut" action
285 - Create a new template identifier using the VNF type name in service model as template name, e.g. Vloadbalancerms..vdns..module-3
286 - Select protocol (Netconf-XML), VNF username (admin), and VNF port number (2831 for NETCONF)
287 - Click "Parameter Definition" Tab and upload the parameters (.yaml) file
288 - Click "Template Tab" and upload API template (.yaml) file
289 - Click "Reference Data" Tab
290 - Click "Save All to APPC"
291
292 For health check operation, we just need to specify the protocol, the port number and username of the VNF (REST, 8183, and "admin" respectively, in the case of vLB/vDNS) and the API. For the vLB/vDNS, the API is:
293 ::
294
295   restconf/operational/health-vnf-onap-plugin:health-vnf-onap-plugin-state/health-check
296
297 Note that we don't need to create a VNF template for health check, so the "Template" flag can be set to "N". Again, the user has to click "Save All to APPC" to update the APPC database.
298 At this time, CDT doesn't allow users to provide VNF password from the GUI. To update the VNF password we need to log into the APPC Maria DB container and change the password manually:
299 ::
300
301   mysql -u sdnctl -p (type "gamma" when password is prompted)
302   use sdnctl;
303   UPDATE DEVICE_AUTHENTICATION SET PASSWORD='admin' WHERE
304   VNF_TYPE='vLoadBalancerMS/vLoadBalancerMS 0'; (use your VNF type)
305
306
307 1-6 using SO : Setting the Controller Type in SO Database
308 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
309 Users need to specify which controller to use for the scale out use case. For Dublin, the supported controller is APPC. Users need to create an association between the controller and the VNF type in the SO database.
310
311 To do so:
312
313 - Connect to one of the replicas of the MariaDB database
314 - Type
315
316 ::
317
318     mysql -ucataloguser -pcatalog123
319
320 - Use catalogdb databalse
321
322 ::
323
324     use catalogdb;
325
326 - Create an association between APPC and the VNF type, for example:
327
328 ::
329
330     INSER INTO controller_selection_reference (`VNF_TYPE`, `CONTROLLER_NAME`, `ACTION_CATEGORY`) VALUES ('<VNF Type>', 'APPC', 'ConfigScaleOut');
331     INSER INTO controller_selection_reference (`VNF_TYPE`, `CONTROLLER_NAME`, `ACTION_CATEGORY`) VALUES ('<VNF Type>', 'APPC', 'HealthCheck');
332
333 SO has a default entry for VNF type "vLoadBalancerMS/vLoadBalancerMS 0"
334
335
336
337
338 PART 2 - Scale-out use-case Instantiation
339 -----------------------------------------
340
341 TO BE DESCRIBED
342
343
344 PART 3 - post_instantiation
345 ---------------------------
346
347 3-1 using the VNF : vLB manual configuration
348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349 After the VNF has been instantiated using the CDS configuration blueprint, user should manually configure the vLB to open a connection towards the vDNS. At this time, the use case doesn't support automated post-instantiation configuration with CDS. Note that this step is NOT required during scale out operations, as VNF reconfiguration will be triggered by SO and executed by APPC. To change the state of the vLB, the users can run the following REST call, replacing the IP addresses in the VNF endpoint and JSON object to match the private IP addresses of their vDNS instance:
350
351 ::
352
353   curl -X PUT \
354   http://10.12.5.78:8183/restconf/config/vlb-business-vnf-onap-plugin:vlb-business-vnf-onap-plugin/vdns-instances/vdns-instance/192.168.10.59 \
355   -H 'Accept: application/json' \
356   -H 'Content-Type: application/json' \
357   -H 'Postman-Token: a708b064-adb1-4804-89a7-ee604f5fe76f' \
358   -H 'cache-control: no-cache' \
359   -d '{
360     "vdns-instance": [
361         {
362             "ip-addr": "192.168.10.59",
363             "oam-ip-addr": "10.0.101.49",
364             "enabled": true
365         }
366     ]}'
367
368 At this point, the VNF is fully set up.
369
370
371 3-2 using AAI : update AAI inventory with VNF resources
372 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373 To allow automated scale out via closed loop, the users need to inventory the VNF resources in AAI. This is done by running the heatbridge python script in /root/oom/kubernetes/robot in the Rancher VM in the Kubernetes cluster:
374
375 ::
376
377     ./demo-k8s.ete onap heatbridge <vLB stack_name in OpenStack> <service_instance_id> vLB vlb_onap_private_ip_0
378
379 Heatbridge is needed for control loops because DCAE and Policy runs queries against AAI using vServer names as key.
380
381
382 PART 4 - running a manual Scale Out
383 -----------------------------------
384
385 4- 1 using SO : manually triggering scale-out
386 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
387 For scale out with manual trigger, VID is not supported at this time. Users can run the use case by directly calling SO APIs:
388
389 ::
390
391   curl -X POST \
392   http://10.12.5.86:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/7d3ca782-c486-44b3-9fe5-39f322d8ee80/vnfs/9d33cf2d-d6aa-4b9e-a311-460a6be5a7de/vfModules/scaleOut \
393   -H 'Accept: application/json' \
394   -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
395   -H 'Cache-Control: no-cache' \
396   -H 'Connection: keep-alive' \
397   -H 'Content-Type: application/json' \
398   -H 'Host: 10.12.5.86:30277' \
399   -H 'Postman-Token: 12f2601a-4eb2-402c-a51a-f29502359501,9befda68-b2c9-4e7a-90ca-1be9c24ef664' \
400   -H 'User-Agent: PostmanRuntime/7.15.0' \
401   -H 'accept-encoding: gzip, deflate' \
402   -H 'cache-control: no-cache' \
403   -H 'content-length: 2422' \
404   -H 'cookie: JSESSIONID=B3BA24216367F9D39E3DF5E8CBA4BC64' \
405   -b JSESSIONID=B3BA24216367F9D39E3DF5E8CBA4BC64 \
406   -d '{
407     "requestDetails": {
408         "modelInfo": {
409             "modelCustomizationName": "VdnsloadbalancerCds..vdns..module-3",
410             "modelCustomizationId": "ec2f6466-a786-41f9-98f3-86506ceb57aa",
411             "modelInvariantId": "8e134fbd-d6fe-4b0a-b4da-286c69dfed2f",
412             "modelVersionId": "297c4829-a412-4db2-bcf4-8f8ab8890772",
413             "modelName": "VdnsloadbalancerCds..vdns..module-3",
414             "modelType": "vfModule",
415             "modelVersion": "1"
416         },
417         "cloudConfiguration": {
418             "lcpCloudRegionId": "RegionOne",
419             "tenantId": "d570c718cbc545029f40e50b75eb13df",
420             "cloudOwner": "CloudOwner"
421         },
422         "requestInfo": {
423             "instanceName": "RegionOne_ONAP-NF_20190613T023006695Z_1",
424             "source": "VID",
425             "suppressRollback": false,
426             "requestorId": "demo"
427         },
428         "requestParameters": {
429             "userParams": []
430         },
431         "relatedInstanceList": [
432             {
433                 "relatedInstance": {
434                     "instanceId": "7d3ca782-c486-44b3-9fe5-39f322d8ee80",
435                     "modelInfo": {
436                         "modelType": "service",
437                         "modelInvariantId": "a158d0c9-7de4-4011-a838-f1fb8fa26be8",
438                         "modelVersionId": "a68d8e71-206b-4ed7-a759-533a4473304b",
439                         "modelName": "vDNSLoadBalancerService_CDS",
440                         "modelVersion": "2.0"
441                     }
442                 }
443             },
444             {
445                 "relatedInstance": {
446                     "instanceId": "9d33cf2d-d6aa-4b9e-a311-460a6be5a7de",
447                     "modelInfo": {
448                         "modelType": "vnf",
449                         "modelInvariantId": "7cc46834-962b-463a-93b8-8c88d45c4fb1",
450                         "modelVersionId": "94cb4ca9-7084-4236-869f-9ba114245e41",
451                         "modelName": "vDNSLOADBALANCER_CDS",
452                         "modelVersion": "3.0",
453                         "modelCustomizationId": "69a4ebc7-0200-435b-930a-3cb247d7a3fd"
454                     }
455                 }
456             }
457         ],
458         "configurationParameters": [
459             {
460                 "ip-addr": "$.vf-module-topology.vf-module-parameters.param[17].value",
461                 "oam-ip-addr": "$.vf-module-topology.vf-module-parameters.param[31].value"
462             }
463         ]
464     }}'
465
466
467 To fill in the JSON object, users can refer to the Service Model TOSCA template at the top of the page. The template contains all the model (invariant/version/customization) IDs of service, VNF, and VF modules that the input request to SO needs.
468
469
470
471
472
473 Test Status and Plans
474 ---------------------
475 Dublin Scale Out test cases can be found here: https://wiki.onap.org/pages/viewpage.action?pageId=59966105
476
477 Known Issues and Resolutions
478 ----------------------------
479 1) When running closed loop-enabled scale out, the closed loop designed in CLAMP conflicts with the default closed loop defined for the old vLB/vDNS use case
480
481 Resolution: Change TCA configuration for the old vLB/vDNS use case
482
483 - Connect to Consul: http://<ANY K8S VM IP ADDRESS>:30270 and click on "Key/Value" → "dcae-tca-analytics"
484 - Change "eventName" in the vLB default policy to something different, for example "vLB" instead of the default value "vLoadBalancer"
485 - Change "subscriberConsumerGroup" in the TCA configuration to something different, for example "OpenDCAE-c13" instead of the default value "OpenDCAE-c12"
486 - Click "UPDATE" to upload the new TCA configuration