Set Python and Ubuntu versions in .readthedocs.yaml
[integration.git] / docs / docs_scaleout.rst
1 .. _docs_scaleout:
2
3 :orphan:
4
5 VF Module Scale Out Use Case
6 ----------------------------
7
8 Source files
9 ~~~~~~~~~~~~
10 - Heat templates directory: https://git.onap.org/demo/tree/heat?h=guilin
11 - Heat templates directory (vLB_CDS use case): https://git.onap.org/demo/tree/heat/vLB_CDS?h=guilin
12
13 Additional files
14 ~~~~~~~~~~~~~~~~
15 - TOSCA model template: https://git.onap.org/integration/tree/docs/files/scaleout/service-Vloadbalancercds-template.yml
16 - Naming policy script: :download:`push_naming_poliy.sh <files/scaleout/push_naming_policy.sh>`
17 - Controller Blueprint Archive (to use with CDS) : https://git.onap.org/ccsdk/cds/tree/components/model-catalog/blueprint-model/service-blueprint/vLB_CDS_Kotlin?h=guilin
18 - TCA blueprint: :download:`guilin-tca.yaml <files/scaleout/latest-tca-guilin.yaml>`
19
20 Useful tool
21 ~~~~~~~~~~~
22 POSTMAN collection that can be used to simulate all inter process queries : https://www.getpostman.com/collections/878061d291f9efe55463
23 To be able to use this postman collection, you may need to expose some ports that are not exposed in OOM by default.
24 These commands may help for exposing the ports:
25
26 ::
27
28     kubectl port-forward service/cds-blueprints-processor-http --address 0.0.0.0 32749:8080 -n onap &
29     kubectl port-forward service/so-catalog-db-adapter --address 0.0.0.0 30845:8082 -n onap &
30     kubectl port-forward service/so-request-db-adapter --address 0.0.0.0 32223:8083 -n onap &
31
32 OOM Installation
33 ~~~~~~~~~~~~~~~~
34 Before doing the OOM installation, take care to the following steps:
35
36 Set the right Openstack values for Robot and SO
37 ===============================================
38
39 The config for robot must be set in an OOM override file before the OOM installation, this will initialize the robot framework & SO with all the required openstack info.
40 A section like that is required in that override file
41
42 ::
43
44     robot:
45       enabled: true
46       flavor: small
47       appcUsername: "appc@appc.onap.org"
48       appcPassword: "demo123456!"
49       openStackKeyStoneUrl: "http://10.12.25.2:5000"
50       openStackKeystoneAPIVersion: "v3"
51       openStackPublicNetId: "5771462c-9582-421c-b2dc-ee6a04ec9bde"
52       openStackTenantId: "c9ef9a6345b440b7a96d906a0f48c6b1"
53       openStackUserName: "openstack_user"
54       openStackUserDomain: "default"
55       openStackProjectName: "CLAMP"
56       ubuntu14Image: "trusty-server-cloudimg-amd64-disk1"
57       ubuntu16Image: "xenial-server-cloudimg-amd64-disk1"
58       openStackPrivateNetCidr: "10.0.0.0/16"
59       openStackPrivateNetId: "fd05c1ab-3f43-4f6f-8a8c-76aee04ef293"
60       openStackPrivateSubnetId: "fd05c1ab-3f43-4f6f-8a8c-76aee04ef293"
61       openStackSecurityGroup: "f05e9cbf-d40f-4d1f-9f91-d673ba591a3a"
62       openStackOamNetworkCidrPrefix: "10.0"
63       dcaeCollectorIp: "10.12.6.10"
64       vnfPubKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh"
65       demoArtifactsVersion: "1.6.0"
66       demoArtifactsRepoUrl: "https://nexus.onap.org/content/repositories/releases"
67       scriptVersion: "1.6.0"
68       nfsIpAddress: "10.12.6.10"
69       config:
70         openStackEncryptedPasswordHere: "e10c86aa13e692020233d18f0ef6d527"
71         openStackSoEncryptedPassword: "1DD1B3B4477FBAFAFEA617C575639C6F09E95446B5AE1F46C72B8FD960219ABB0DBA997790FCBB12"
72     so:
73       enabled: true
74       so-catalog-db-adapter:
75         config:
76           openStackUserName: "opesntack_user"
77           openStackKeyStoneUrl: "http://10.12.25.2:5000/v3"
78           openStackEncryptedPasswordHere: "1DD1B3B4477FBAFAFEA617C575639C6F09E95446B5AE1F46C72B8FD960219ABB0DBA997790FCBB12"
79           openStackKeystoneVersion: "KEYSTONE_V3"
80
81 The values that must be changed according to your lab are all "openStack******" parameters +  dcaeCollectorIp + nfsIpAddress
82
83 **Generating SO Encrypted Password:**
84
85 The SO Encrypted Password uses a java based encryption utility since the
86 Java encryption library is not easy to integrate with openssl/python that
87 Robot uses in Dublin and upper versions.
88
89 .. note::
90   To generate SO ``openStackEncryptedPasswordHere`` and ``openStackSoEncryptedPassword``
91   ensure `default-jdk` is installed::
92
93     apt-get update; apt-get install default-jdk
94
95   Then execute (on oom repository)::
96
97     SO_ENCRYPTION_KEY=`cat ~/oom/kubernetes/so/resources/config/mso/encryption.key`
98     OS_PASSWORD=XXXX_OS_CLEARTESTPASSWORD_XXXX
99
100     git clone http://gerrit.onap.org/r/integration
101     cd integration/deployment/heat/onap-rke/scripts
102
103     javac Crypto.java
104     java Crypto "$OS_PASSWORD" "$SO_ENCRYPTION_KEY"
105
106 **Update the OpenStack parameters:**
107
108 There are assumptions in the demonstration VNF Heat templates about the
109 networking available in the environment. To get the most value out of these
110 templates and the automation that can help confirm the setup is correct, please
111 observe the following constraints.
112
113
114 ``openStackPublicNetId:``
115   This network should allow Heat templates to add interfaces.
116   This need not be an external network, floating IPs can be assigned to the
117   ports on the VMs that are created by the heat template but its important that
118   neutron allow ports to be created on them.
119
120 ``openStackPrivateNetCidr: "10.0.0.0/16"``
121   This ip address block is used to assign OA&M addresses on VNFs to allow ONAP
122   connectivity. The demonstration Heat templates assume that 10.0 prefix can be
123   used by the VNFs and the demonstration ip addressing plan embodied in the
124   preload template prevent conflicts when instantiating the various VNFs. If
125   you need to change this, you will need to modify the preload data in the
126   Robot Helm chart like integration_preload_parameters.py and the
127   demo/heat/preload_data in the Robot container. The size of the CIDR should
128   be sufficient for ONAP and the VMs you expect to create.
129
130 ``openStackOamNetworkCidrPrefix: "10.0"``
131   This ip prefix mush match the openStackPrivateNetCidr and is a helper
132   variable to some of the Robot scripts for demonstration. A production
133   deployment need not worry about this setting but for the demonstration VNFs
134   the ip asssignment strategy assumes 10.0 ip prefix.
135
136 **Generating ROBOT Encrypted Password:**
137
138 The Robot encrypted Password uses the same encryption.key as SO but an
139 openssl algorithm that works with the python based Robot Framework.
140
141 .. note::
142   To generate Robot ``openStackEncryptedPasswordHere`` call on oom respository::
143
144     cd so/resources/config/mso/
145     /oom/kubernetes/so/resources/config/mso# echo -n "<openstack tenant password>" | openssl aes-128-ecb -e -K `cat encryption.key` -nosalt | xxd -c 256 -p``
146
147 Initialize the Customer and Owning entities
148 ===========================================
149
150 The robot script can be helpful to initialize the customer and owning entity that
151 will be used later to instantiate the VNF (PART 2 - Scale Out Use Case Instantiation)
152
153 ::
154
155   In the oom_folder/kubernetes/robot/ execute the following command:
156   ./demo-k8s.sh onap init_customer
157
158 If this command is unsuccessful it means that the parameters provided to the OOM installation were not correct.
159
160 - Verify and Get the tenant/owning entity/cloud-regions defined in AAI by Robot script:
161   These values will be required by the POSTMAN collection when instantiating the Service/vnf ...
162
163 To get them some POSTMAN collection queries are useful to use:
164
165 - GET "AAI Owning Entities"
166 - GET "AAI Cloud-regions"
167 - GET "AAI Cloud-regions/tenant"
168
169 Description
170 ~~~~~~~~~~~
171
172 The scale out use case uses a VNF composed of three virtual functions. A traffic
173 generator (vPacketGen), a load balancer (vLB), and a DNS (vDNS). Communication
174 between the vPacketGen and the vLB, and the vLB and the vDNS occurs via two
175 separate private networks. In addition, all virtual functions have an interface
176 to the ONAP OAM private network, as shown in the topology below.
177
178 .. figure:: files/scaleout/topology.png
179    :align: center
180
181 The vPacketGen issues DNS lookup queries that reach the DNS server via the vLB.
182 vDNS replies reach the packet generator via the vLB as well. The vLB reports the
183 average amount of traffic per vDNS instances over a given time interval (e.g. 10
184 seconds) to the DCAE collector via the ONAP OAM private network.
185
186 To run the use case, make sure that the security group in OpenStack has
187 ingress/egress entries for protocol 47 (GRE). Users can test the VNF by running
188 DNS queries from the vPakcketGen:
189
190 ::
191
192   dig @vLoadBalancer_IP host1.dnsdemo.onap.org
193
194 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.
195
196 ::
197
198     ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @192.168.9.111 host1.dnsdemo.onap.org
199     ; (1 server found)
200     ;; global options: +cmd
201     ;; Got answer:
202     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31892
203     ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
204     ;; WARNING: recursion requested but not available
205
206     ;; OPT PSEUDOSECTION:
207     ; EDNS: version: 0, flags:; udp: 4096
208     ;; QUESTION SECTION:
209     ;host1.dnsdemo.onap.org.            IN      A
210
211     ;; ANSWER SECTION:
212     host1.dnsdemo.onap.org.     604800  IN      A       10.0.100.101
213
214     ;; AUTHORITY SECTION:
215     dnsdemo.onap.org.   604800  IN      NS      dnsdemo.onap.org.
216
217     ;; ADDITIONAL SECTION:
218     dnsdemo.onap.org.   604800  IN      A       10.0.100.100
219
220     ;; Query time: 0 msec
221     ;; SERVER: 192.168.9.111#53(192.168.9.111)
222     ;; WHEN: Fri Nov 10 17:39:12 UTC 2017
223     ;; MSG SIZE  rcvd: 97
224
225
226 The Scale Out Use Case
227 ~~~~~~~~~~~~~~~~~~~~~~
228
229 The Scale Out use case shows how users/network operators can add Virtual Network
230 Function Components (VNFCs) as part of a VF Module that has been instantiated in
231 the Service model, in order to increase capacity of the network. ONAP Frankfurt
232 release supports scale out with manual trigger by directly calling SO APIs and
233 closed-loop-enabled automation from Policy. For Frankfurt, the APPC controller is
234 used to demonstrate post-scaling VNF reconfiguration operations. APPC can handle
235 different VNF types, not only the VNF described in this document.
236
237 The figure below shows all the interactions that take place during scale out operations.
238
239 .. figure:: files/scaleout/scaleout.png
240    :align: center
241
242 There are four different message flows:
243   - Gray: This communication happens internally to the VNF and it is described in the section above.
244   - Green: Scale out with manual trigger.
245   - Red: Closed-loop enabled scale out.
246   - Black: Orchestration and VNF lifecycle management (LCM) operations.
247
248 The numbers in the figure represent the sequence of steps within a given flow.
249 Note that interactions between the components in the picture and AAI, SDNC, and
250 DMaaP are not shown for clarity's sake.
251
252 Scale out with manual trigger (green flow) and closed-loop-enabled scale out
253 (red flow) are mutually exclusive. When the manual trigger is used, VID directly
254 triggers the appropriate workflow in SO (step 1 of the green flow in the figure
255 above). See Section 4 for more details.
256
257 When closed-loop enabled scale out is used, Policy triggers the SO workflow.
258 The closed loop starts with the vLB periodically reporting telemetry about traffic
259 patterns to the VES collector in DCAE (step 1 of the red flow). When the amount
260 of traffic exceeds a given threshold (which the user defines during closed loop
261 creation in CLAMP - see Section 1-4), DCAE notifies Policy (step 2), which in turn
262 triggers the appropriate action. For this use case, the action is contacting SO to
263 augment resource capacity in the network (step 3).
264
265 At high level, once SO receives a call for scale out actions, it first creates a
266 new VF module (step 1 of the black flow), then calls APPC to trigger some LCM
267 actions (step 2). APPC runs VNF health check and configuration scale out as part
268 of LCM actions (step 3). At this time, the VNF health check only reports the
269 health status of the vLB, while the configuration scale out operation adds a new
270 vDNS instance to the vLB internal state. As a result of configuration scale out,
271 the vLB opens a connection towards the new vDNS instance.
272
273 At deeper level, the SO workflow works as depicted below:
274
275 .. figure:: files/scaleout/so-blocks.png
276    :align: center
277
278 SO first contacts APPC to run VNF health check and proceeds on to the next block
279 of the workflow only if the vLB is healthy (not shown in the previous figure for
280 simplicity's sake). Then, SO assigns resources, instantiates, and activates the
281 new VF module. Finally, SO calls APPC again for configuration scale out and VNF
282 health check. The VNF health check at the end of the workflow validates that the
283 vLB health status hasn't been negatively affected by the scale out operation.
284
285 PART 1 - Service Definition and Onboarding
286 ------------------------------------------
287
288 This use-case requires operations on several ONAP components to perform service definition and onboarding.
289
290 1-1 VNF Configuration Modeling and Upload with CDS (Recommended way)
291 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
292
293 Since 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. The user interested in running the use case only with manual preload can skip this section and start from Section 1-2. The description of the use case with manual preload is provided in Section5.
294
295 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.
296
297 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
298
299 ::
300
301   For the current use case you can also follow these steps (Do not use the SDC flow to deploy the CBA when importing a VSP, this is not going to work anymore since Guilin):
302   1. You must first bootstrap CDS by using the query in the POSTMAN collection query named POST "CDS Bootstrap"
303   2. You must upload the attached CBA by using the POSTMAN collection named POST "CDS Save without Validation", the CBA zip file can be attached in the POSTMAN query
304   Controller Blueprint Archive (to use with CDS) : https://git.onap.org/ccsdk/cds/tree/components/model-catalog/blueprint-model/service-blueprint/vLB_CDS_Kotlin?h=guilin
305   3. Create a zip file with the HEAT files located here:  https://git.onap.org/demo/tree/heat/vLB_CDS?h=guilin
306   4. Create the VSP & Service in the SDC onboarding and SDC Catalog + Distribute the service
307      To know the right values that must be set in the SDC Service properties assignment you must open the CBA zip and look at the TOSCA-Metadata/TOSCA.meta file
308       This file looks like that:
309           TOSCA-Meta-File-Version: 1.0.0
310           CSAR-Version: 1.0
311           Created-By: Seaudi, Abdelmuhaimen <abdelmuhaimen.seaudi@orange.com>
312           Entry-Definitions: Definitions/vLB_CDS.json
313           Template-Tags: vLB_CDS
314           Template-Name: vLB_CDS
315           Template-Version: 1.0.0
316           Template-Type: DEFAULT
317
318     - The sdnc_model_version is the Template-Version
319     - The sdnc_model_name is the Template-Name
320     - The sdnc_artifact_name is the prefix of the file you want to use in the Templates folder, in our CBA example it's vnf (that is supposed to reference the /Templates/vnf-mapping.json file)
321
322     Follow this guide for the VSP onboarding + service creation + properties assignment + distribution part (just skip the CBA attachment part as the CBA should have been pushed manually with the REST command): https://wiki.onap.org/pages/viewpage.action?pageId=64007442
323
324     Note that in case of issues with the AAI distribution, this may help : https://jira.onap.org/browse/AAI-1759
325
326 1-2 VNF Onboarding and Service Creation with SDC
327 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
328
329 Once the configuration blueprint is uploaded to CDS, users can define and onboard a service using SDC. SDC requires users to onboard a VNF descriptor that contains the definition of all the resources (private networks, compute nodes, keys, etc.) with their parameters that compose a VNF. The VNF used to demonstrate the scale out use case supports Heat templates as VNF descriptor, and hence requires OpenStack as cloud layer. Users can use the Heat templates linked at the top of the page to create a zip file that can be uploaded to SDC during service creation. To create a zip file, the user must be in the same folder that contains the Heat templates and the Manifest file that describes the content of the package. To create a zip file from command line, type:
330 ::
331
332     zip ../vLB.zip *
333
334 For a complete description of service design and creation, please refer to the SDC documentation.
335
336 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!).
337
338 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:
339
340 .. figure:: files/scaleout/9.png
341    :align: center
342
343 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.
344
345 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.
346
347 .. figure:: files/scaleout/10.png
348    :align: center
349
350 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.
351
352 .. figure:: files/scaleout/11.png
353    :align: center
354
355
356 After importing the VSP, users need to onboard the DCAE blueprint used to design closed loops in CLAMP. This step is only required for users that want to run closed loop; users interested in manual scale out only can skip the remainder of the section. Note that since Frankfurt users are not required to upload a Policy model from SDC, as Policy models are now managed by the Policy Engine.
357
358 To upload a DCAE blueprint, from the "Composition" tab in the service menu, select the artifact icon on the right, as shown below:
359
360 .. figure:: files/scaleout/1.png
361    :align: center
362
363 Upload the DCAE blueprint (choose the one depending on your ONAP release, as the orginal TCA was depecrated in Guilin a new one is available to use) linked at the top of the page using the pop-up window.
364
365 .. figure:: files/scaleout/2.png
366    :align: center
367
368 The blueprint will appear in the artifacts section on the right.
369
370 .. figure:: files/scaleout/3.png
371    :align: center
372
373 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.
374
375 .. figure:: files/scaleout/7.png
376    :align: center
377
378 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.
379
380 .. figure:: files/scaleout/8.png
381    :align: center
382
383 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.
384
385
386 1-3 Deploy Naming Policy
387 ~~~~~~~~~~~~~~~~~~~~~~~~
388
389 This step is only required if CDS is used.
390 Note that in Guilin, the default naming policy is already deployed in policy so this step is optional
391
392 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.
393
394 ::
395
396     kubectl exec -it dev-policy-drools-0
397     ./push_naming_policy.sh
398
399
400
401 1-4 Closed Loop Design with CLAMP
402 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
403
404 This step is only required if closed loop is used, for manual scaleout this section can be skipped.
405
406 Here are Json examples that can be copy pasted in each policy configuration by clicking on the button EDIT JSON, just replace the value "LOOP_test_vLB_CDS" by your loop ID:
407 For TCA config:
408 ::
409
410     {
411       "tca.policy": {
412         "domain": "measurementsForVfScaling",
413         "metricsPerEventName": [
414           {
415             "policyScope": "DCAE",
416             "thresholds": [
417               {
418                 "version": "1.0.2",
419                 "severity": "MAJOR",
420                 "thresholdValue": 200,
421                 "closedLoopEventStatus": "ONSET",
422                 "closedLoopControlName": "LOOP_test_vLB_CDS",
423                 "direction": "LESS_OR_EQUAL",
424                 "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta"
425               }
426             ],
427             "eventName": "vLoadBalancer",
428             "policyVersion": "v0.0.1",
429             "controlLoopSchemaType": "VM",
430             "policyName": "DCAE.Config_tca-hi-lo"
431           }
432         ]
433       }
434     }
435
436 For Drools config:
437
438 ::
439
440     {
441       "abatement": false,
442       "operations": [
443         {
444           "failure_retries": "final_failure_retries",
445           "id": "policy-1-vfmodule-create",
446           "failure_timeout": "final_failure_timeout",
447           "failure": "final_failure",
448           "operation": {
449             "payload": {
450               "requestParameters": "{\"usePreload\":false,\"userParams\":[]}",
451               "configurationParameters": "[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[16].value\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[30].value\"}]"
452             },
453             "target": {
454               "entityIds": {
455                 "resourceID": "Vlbcds..vdns..module-3",
456                 "modelInvariantId": "e95a2949-8ba5-433d-a88f-587a6244b4ea",
457                 "modelVersionId": "4a6ceddc-147e-471c-ae6f-907a0df76040",
458                 "modelName": "Vlbcds..vdns..module-3",
459                 "modelVersion": "1",
460                 "modelCustomizationId": "7806ed67-a826-4b0e-b474-9ca4fa052a10"
461               },
462               "targetType": "VFMODULE"
463             },
464             "actor": "SO",
465             "operation": "VF Module Create"
466           },
467           "failure_guard": "final_failure_guard",
468           "retries": 1,
469           "timeout": 300,
470           "failure_exception": "final_failure_exception",
471           "description": "test",
472           "success": "final_success"
473         }
474       ],
475       "trigger": "policy-1-vfmodule-create",
476       "timeout": 650,
477       "id": "LOOP_test_vLB_CDS"
478     }
479
480 For Frequency Limiter config:
481
482 ::
483
484     {
485       "id": "LOOP_test_vLB_CDS",
486       "actor": "SO",
487       "operation": "VF Module Create",
488       "limit": 1,
489       "timeWindow": 10,
490       "timeUnits": "minute"
491     }
492
493 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
494
495 Use the "Loop Instance" link to create a closed loop using a distributed model.
496
497 .. figure:: files/scaleout/clamp/1.png
498    :align: center
499
500 Select the distributed service model.
501
502 .. figure:: files/scaleout/clamp/2.png
503    :align: center
504
505 The closed loop main page for TCA microservices is shown below.
506
507 .. figure:: files/scaleout/clamp/3.png
508    :align: center
509
510 Click on the TCA box to create a configuration policy. From the pop-up window, users need to click "Add" to create a new policy and fill it in with specific information, as shown below.
511
512 .. figure:: files/scaleout/clamp/4.png
513    :align: center
514
515 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".
516
517 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.
518
519 .. figure:: files/scaleout/clamp/5.png
520    :align: center
521
522 Since Frankfurt, users are required to define the PDP group for the configuration policy, as shown in the figure below.
523
524 .. figure:: files/scaleout/clamp/6.png
525    :align: center
526
527 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. From the "Loop Instance" tab, users can select "Modify" to add a new Policy Model of type Drools:
528
529 .. figure:: files/scaleout/clamp/7.png
530    :align: center
531
532 Users are required to provide basic closed loop information, like ID, timeout, and trigger, as shown in the example below. The trigger name, in particular, must match the name of the root operational policy created during the next step.
533
534 .. figure:: files/scaleout/clamp/8.png
535    :align: center
536
537 To create a new operational policy, users can use the "Add" button below, and fill up the fields in the CLAMP GUI as shown in the example below, making sure that the "id" matches the "trigger" field defined before:
538
539 .. figure:: files/scaleout/clamp/9.png
540    :align: center
541
542 During creation of the operational policy, the user should select "VF Module Create" recipe and "SO" actor. The payload section is a JSON object like below:
543
544 ::
545
546     {"requestParameters":"{\"usePreload\":true,\"userParams\":[]}",
547    "configurationParameters":"[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[16]\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[30]\"}]"}
548
549 Users can use the "Edit JSON" button to upload the payload.
550
551 .. figure:: files/scaleout/clamp/10.png
552    :align: center
553
554 The Policy Engine passes the payload to SO, which will then use it during VF module instantiation to resolve configuration parameters. The JSON path
555
556 ::
557
558     "ip-addr":"$.vf-module-topology.vf-module-parameters.param[16].value"
559
560 indicates that resolution for parameter "ip-addr" is available at "$.vf-module-topology.vf-module-parameters.param[16].value" in the JSON object linked by the VF module self-link in AAI. See section 1-7 for an example of how to determine the right path to configuration parameters.
561
562 The "targetType" tab allows users to select the target type for the closed loop. For this use case, the user should select VF module as target type, as we are scaling a VF module. Please select the vDNS module as target resource ID.
563
564 .. figure:: files/scaleout/clamp/11.png
565    :align: center
566
567 As with configuration policy, users need to assign the PDP group to the operational policy.
568
569 .. figure:: files/scaleout/clamp/12.png
570    :align: center
571
572 For what regards guard policies, either "Frequency Limiter", or "MinMax", or both can be used for the scale out use case. They can be added using the "Modify" item in the "Loop Instance" tab.
573
574 .. figure:: files/scaleout/clamp/13.png
575    :align: center
576
577 The example below shows the definition of a "Frequency Limiter" guard policy. Note that some optional fields, such as id and time interval, should be added to the policy using the "Object Properties" button:
578
579 .. figure:: files/scaleout/clamp/14.png
580    :align: center
581
582 The user needs to manually insert id, actor, and operation so as to match the same fields defined in the operational policy.
583
584 .. figure:: files/scaleout/clamp/15.png
585    :align: center
586
587 Once the operational policy design is completed, users can submit and then deploy the closed loop clicking the "Submit" and "Deploy" buttons from the "Loop Operations" tab, as shown below.
588
589 .. figure:: files/scaleout/clamp/16.png
590    :align: center
591
592 At this point, the closed loop is deployed to Policy Engine and DCAE, and a new microservice will be deployed to the DCAE platform.
593
594
595 1-5 Creating a VNF Template with CDT
596 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
597
598 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.
599 CDT requires two input:
600
601 1) the list of parameters that APPC will receive (ip-addr, oam-ip-addr, enabled in the example above);
602
603 2) the VNF API that APPC will use to reconfigure the VNF.
604
605 Below is an example of the parameters file (yaml format), which we call parameters.yaml:
606 ::
607
608     version: V1
609     vnf-parameter-list:
610     - name: ip-addr
611       type: null
612       description: null
613       required: "true"
614       default: null
615       source: Manual
616       rule-type: null
617       request-keys: null
618       response-keys: null
619     - name: oam-ip-addr
620       type: null
621       description: null
622       required: "true"
623       default: null
624       source: Manual
625       rule-type: null
626       request-keys: null
627       response-keys: null
628     - name: enabled
629       type: null
630       description: null
631       required: "false"
632       default: null
633       source: Manual
634       rule-type: null
635       request-keys: null
636       response-keys: null
637
638 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):
639 ::
640
641     <vlb-business-vnf-onap-plugin xmlns="urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin">
642         <vdns-instances>
643             <vdns-instance>
644                 <ip-addr>${ip-addr}</ip-addr>
645                 <oam-ip-addr>${oam-ip-addr}</oam-ip-addr>
646                 <enabled>true</enabled>
647             </vdns-instance>
648         </vdns-instances>
649     </vlb-business-vnf-onap-plugin>
650
651 To create the VNF template in CDT, the following steps are required:
652
653 - Connect to the CDT GUI: http://ANY_K8S_IP:30289
654 - Click "My VNF" Tab. Create your user ID, if necessary
655 - Click "Create new VNF" entering the VNF type as reported in VID or AAI, e.g. vLoadBalancerMS/vLoadBalancerMS 0
656 - Select "ConfigScaleOut" action
657 - Create a new template identifier using the VNF type name in service model as template name, e.g. Vloadbalancerms..vdns..module-3
658 - Select protocol (Netconf-XML), VNF username (admin), and VNF port number (2831 for NETCONF)
659 - Click "Parameter Definition" Tab and upload the parameters (.yaml) file
660 - Click "Template Tab" and upload API template (.yaml) file
661 - Click "Reference Data" Tab
662 - Click "Save All to APPC"
663
664 Note, if a user gets an error when saving to Appc (cannot connect to AppC network), he should open a browser to http://ANY_K8S_IP:30211 to accept AppC proxy certificate
665
666 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:
667 ::
668
669   restconf/operational/health-vnf-onap-plugin:health-vnf-onap-plugin-state/health-check
670
671 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.
672 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:
673 ::
674
675   mysql -u sdnctl -p (type "gamma" when password is prompted)
676   use sdnctl;
677   UPDATE DEVICE_AUTHENTICATION SET PASSWORD='admin' WHERE
678   VNF_TYPE='vLoadBalancerMS/vLoadBalancerMS 0'; (use your VNF type)
679
680
681 1-6 Setting the Controller Type in SO Database
682 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
683
684 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.
685
686 To do so:
687
688 - Connect to one of the replicas of the MariaDB database
689 - Type
690
691 ::
692
693     mysql -ucataloguser -pcatalog123
694
695 - Use catalogdb database
696
697 ::
698
699     use catalogdb;
700
701 - Create an association between APPC and the VNF type, for example:
702
703 ::
704
705     INSERT INTO controller_selection_reference (`VNF_TYPE`, `CONTROLLER_NAME`, `ACTION_CATEGORY`) VALUES ('<VNF Type>', 'APPC', 'ConfigScaleOut');
706     INSERT INTO controller_selection_reference (`VNF_TYPE`, `CONTROLLER_NAME`, `ACTION_CATEGORY`) VALUES ('<VNF Type>', 'APPC', 'HealthCheck');
707
708 SO has a default entry for VNF type "vLoadBalancerMS/vLoadBalancerMS 0"
709
710
711 1-7 Determining VNF reconfiguration parameters
712 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
713
714 The post scale out VNF reconfiguration is VNF-independent but the parameters used for VNF reconfiguration depend on the specific use case. For example, the vLB-vDNS-vPacketGenerator VNF described in this documentation use the vLB as "anchor" point. The vLB maintains the state of the VNF, which, for this use case is the list of active vDNS instances. After creating a new vDNS instance, the vLB needs to know the IP addresses (of the internal private network and management network) of the new vDNS. The reconfiguration action is executed by APPC, which receives those IP addresses from SO during the scale out workflow execution. Note that different VNFs may have different reconfiguration actions. A parameter resolution is expressed as JSON path to the SDNC VF module topology parameter array. For each reconfiguration parameter, the user has to specify the array location that contains the corresponding value (IP address in the specific case). For example, the "configurationParameters" section of the input request to SO during scale out with manual trigger (see Section 4) contains the resolution path to "ip-addr" and "oam-ip-addr" parameters used by the VNF.
715
716 ::
717
718     "configurationParameters": [
719             {
720                 "ip-addr": "$.vf-module-topology.vf-module-parameters.param[16].value",
721                 "oam-ip-addr": "$.vf-module-topology.vf-module-parameters.param[30].value"
722             }
723     ]
724
725 The same resolution path needs to be provided for the closed-loop enabled use case during the closed loop design phase in CLAMP (see Section 1-4). The reconfiguration parameters and their resolution path will be pushed to the Policy Engine during closed loop deployment. Policy will eventually push them to SO during closed loop execution.
726
727 Users can determine the correct location by querying the SDNC topology object. The URL can be obtained from AAI following these steps:
728
729 1) Retrieve the list of VNF instances in AAI using the following link:
730
731 ::
732
733     curl -k -X GET \
734   https://<Any_K8S_Node_IP_Address>:30233/aai/v16/network/generic-vnfs \
735   -H 'Accept: application/json' \
736   -H 'Authorization: Basic QUFJOkFBSQ==' \
737   -H 'Content-Type: application/json' \
738   -H 'X-FromAppId: AAI' \
739   -H 'X-TransactionId: get_aai_subscr'
740
741 2) From the returned JSON object, search for the generic VNF object related to the VNF of interest (for example by using the VNF name defined during VNF instantiation). Then, select the "vnf-id" value to build a request to AAI to list all the VF modules of that VNF:
742
743 ::
744
745     curl -k -X GET \
746   https://<Any_K8S_Node_IP_Address>:30233/aai/v16/network/generic-vnfs/generic-vnf/0e905228-c719-489a-9bcc-4470f3254e87/vf-modules \
747   -H 'Accept: application/json' \
748   -H 'Authorization: Basic QUFJOkFBSQ==' \
749   -H 'Content-Type: application/json' \
750   -H 'X-FromAppId: AAI' \
751   -H 'X-TransactionId: get_aai_subscr'
752
753 3) From the returned list of VF modules, select the "selflink" URL of the VF module type that is target of the scaling action. This object refers to an existing instance of that VF module type, which could have been created either as part of regular VNF instantiation process or scaling action. The selflink points to the topology of that VF module instance in SDNC. A new instance of this VF module type will have a topology of the same form, just different parameter values. As such, the existing topology pointed by the selflink in AAI can be used to determine the resolution path to configuration parameters for future instantiation of that VF module type.
754
755 The selflink has the following structure:
756
757 ::
758
759     restconf/config/GENERIC-RESOURCE-API:services/service/4545562a-cbe3-409a-8227-0b863f5bc34e/service-data/vnfs/vnf/0e905228-c719-489a-9bcc-4470f3254e87/vnf-data/vf-modules/vf-module/793df714-106e-40a6-a28a-746b65f9e247/vf-module-data/vf-module-topology/
760
761 The complete URL to access the VF module topology in SDNC becomes:
762
763 ::
764
765     http://<Any_K8S_Node_IP_Address>:30202/restconf/config/GENERIC-RESOURCE-API:services/service/4545562a-cbe3-409a-8227-0b863f5bc34e/service-data/vnfs/vnf/0e905228-c719-489a-9bcc-4470f3254e87/vnf-data/vf-modules/vf-module/793df714-106e-40a6-a28a-746b65f9e247/vf-module-data/vf-module-topology/
766
767 See below an example of VF module topology. It can be stored in SDNC either using CDS (see Section 2) or manual preload (see Section 5).
768
769 ::
770
771     {
772     "vf-module-topology": {
773         "onap-model-information": {
774             "model-name": "VlbCds..vdns..module-3",
775             "model-invariant-uuid": "b985f371-4c59-45f7-b53e-36f970946469",
776             "model-version": "1",
777             "model-customization-uuid": "613b6877-0231-4ca4-90e4-4aa3374674ef",
778             "model-uuid": "739e4a32-f744-47be-9208-5dcf15772306"
779         },
780         "vf-module-parameters": {
781             "param": [
782                 {
783                     "name": "vfc_customization_uuid",
784                     "value": "770af15f-564d-438c-ba3e-6df318c2b1fe",
785                     "resource-resolution-data": {
786                         "capability-name": "RA Resolved",
787                         "status": "SUCCESS"
788                     }
789                 },
790                 {
791                     "name": "key_name",
792                     "value": "${key_name}",
793                     "resource-resolution-data": {
794                         "capability-name": "RA Resolved",
795                         "status": "SUCCESS"
796                     }
797                 },
798                 {
799                     "name": "vdns_flavor_name",
800                     "value": "m1.medium",
801                     "resource-resolution-data": {
802                         "capability-name": "RA Resolved",
803                         "status": "SUCCESS"
804                     }
805                 },
806                 {
807                     "name": "cloud_env",
808                     "value": "openstack",
809                     "resource-resolution-data": {
810                         "capability-name": "RA Resolved",
811                         "status": "SUCCESS"
812                     }
813                 },
814                 {
815                     "name": "vnfc-model-customization-uuid",
816                     "value": "770af15f-564d-438c-ba3e-6df318c2b1fe",
817                     "resource-resolution-data": {
818                         "capability-name": "RA Resolved",
819                         "status": "SUCCESS"
820                     }
821                 },
822                 {
823                     "name": "vf-module-name",
824                     "value": "RegionOne_ONAP-NF_20191010T013003141Z_vdns_Expansion_003",
825                     "resource-resolution-data": {
826                         "capability-name": "generate-name",
827                         "resource-key": [
828                             {
829                                 "name": "VF_MODULE_LABEL",
830                                 "value": "vdns"
831                             },
832                             {
833                                 "name": "resource-name",
834                                 "value": "vf-module-name"
835                             },
836                             {
837                                 "name": "resource-value",
838                                 "value": "${vf-module-name}"
839                             },
840                             {
841                                 "name": "naming-type",
842                                 "value": "VF-MODULE"
843                             },
844                             {
845                                 "name": "VNF_NAME",
846                                 "value": "RegionOne_ONAP-NF_20191010T013003141Z"
847                             },
848                             {
849                                 "name": "external-key",
850                                 "value": "793df714-106e-40a6-a28a-746b65f9e247_vf-module-name"
851                             },
852                             {
853                                 "name": "policy-instance-name",
854                                 "value": "SDNC_Policy.Config_MS_ONAP_VNF_NAMING_TIMESTAMP"
855                             },
856                             {
857                                 "name": "VF_MODULE_TYPE",
858                                 "value": "Expansion"
859                             }
860                         ],
861                         "status": "SUCCESS"
862                     }
863                 },
864                 {
865                     "name": "vnfc-model-version",
866                     "value": "1.0",
867                     "resource-resolution-data": {
868                         "capability-name": "RA Resolved",
869                         "status": "SUCCESS"
870                     }
871                 },
872                 {
873                     "name": "pktgen_private_net_cidr",
874                     "value": "${pktgen_private_net_cidr}",
875                     "resource-resolution-data": {
876                         "capability-name": "RA Resolved",
877                         "status": "SUCCESS"
878                     }
879                 },
880                 {
881                     "name": "vnf_model_customization_uuid",
882                     "value": "c7be2fca-9a5c-4364-8c32-801e64f90ccd",
883                     "resource-resolution-data": {
884                         "capability-name": "RA Resolved",
885                         "status": "SUCCESS"
886                     }
887                 },
888                 {
889                     "name": "service-instance-id",
890                     "value": "4545562a-cbe3-409a-8227-0b863f5bc34e",
891                     "resource-resolution-data": {
892                         "capability-name": "RA Resolved",
893                         "status": "SUCCESS"
894                     }
895                 },
896                 {
897                     "name": "vlb_private_net_cidr",
898                     "value": "192.168.10.0/24",
899                     "resource-resolution-data": {
900                         "capability-name": "RA Resolved",
901                         "status": "SUCCESS"
902                     }
903                 },
904                 {
905                     "name": "install_script_version",
906                     "value": "1.5.0-SNAPSHOT",
907                     "resource-resolution-data": {
908                         "capability-name": "RA Resolved",
909                         "status": "SUCCESS"
910                     }
911                 },
912                 {
913                     "name": "vlb_int_private_ip_0",
914                     "value": "192.168.10.50",
915                     "resource-resolution-data": {
916                         "capability-name": "RA Resolved",
917                         "status": "SUCCESS"
918                     }
919                 },
920                 {
921                     "name": "vnfc-model-invariant-uuid",
922                     "value": "49e70b6f-87e7-4f68-b1ec-958e68c7cbf5",
923                     "resource-resolution-data": {
924                         "capability-name": "RA Resolved",
925                         "status": "SUCCESS"
926                     }
927                 },
928                 {
929                     "name": "pub_key",
930                     "value": "${pub_key}",
931                     "resource-resolution-data": {
932                         "capability-name": "RA Resolved",
933                         "status": "SUCCESS"
934                     }
935                 },
936                 {
937                     "name": "onap_private_net_cidr",
938                     "value": "10.0.0.0/8",
939                     "resource-resolution-data": {
940                         "capability-name": "RA Resolved",
941                         "status": "SUCCESS"
942                     }
943                 },
944                 {
945                     "name": "vdns_int_private_ip_0",
946                     "value": "192.168.10.54",
947                     "resource-resolution-data": {
948                         "capability-name": "netbox-ip-assign",
949                         "resource-key": [
950                             {
951                                 "name": "external_key",
952                                 "value": "0e905228-c719-489a-9bcc-4470f3254e87-vdns_int_private_ip_0"
953                             },
954                             {
955                                 "name": "vnf-id",
956                                 "value": "0e905228-c719-489a-9bcc-4470f3254e87"
957                             },
958                             {
959                                 "name": "service-instance-id",
960                                 "value": "4545562a-cbe3-409a-8227-0b863f5bc34e"
961                             },
962                             {
963                                 "name": "prefix-id",
964                                 "value": "2"
965                             }
966                         ],
967                         "status": "SUCCESS"
968                     }
969                 },
970                 {
971                     "name": "vnf_id",
972                     "value": "0e905228-c719-489a-9bcc-4470f3254e87",
973                     "resource-resolution-data": {
974                         "capability-name": "RA Resolved",
975                         "status": "SUCCESS"
976                     }
977                 },
978                 {
979                     "name": "nfc-naming-code",
980                     "value": "vdns",
981                     "resource-resolution-data": {
982                         "capability-name": "RA Resolved",
983                         "status": "SUCCESS"
984                     }
985                 },
986                 {
987                     "name": "onap_private_subnet_id",
988                     "value": "oam_network_qXyY",
989                     "resource-resolution-data": {
990                         "capability-name": "RA Resolved",
991                         "status": "SUCCESS"
992                     }
993                 },
994                 {
995                     "name": "vf_module_customization_uuid",
996                     "value": "613b6877-0231-4ca4-90e4-4aa3374674ef",
997                     "resource-resolution-data": {
998                         "capability-name": "RA Resolved",
999                         "status": "SUCCESS"
1000                     }
1001                 },
1002                 {
1003                     "name": "vf_module_type",
1004                     "value": "Expansion",
1005                     "resource-resolution-data": {
1006                         "capability-name": "RA Resolved",
1007                         "status": "SUCCESS"
1008                     }
1009                 },
1010                 {
1011                     "name": "vlb_onap_private_ip_0",
1012                     "value": "10.0.101.32",
1013                     "resource-resolution-data": {
1014                         "capability-name": "RA Resolved",
1015                         "status": "SUCCESS"
1016                     }
1017                 },
1018                 {
1019                     "name": "vf_module_id",
1020                     "value": "793df714-106e-40a6-a28a-746b65f9e247",
1021                     "resource-resolution-data": {
1022                         "capability-name": "RA Resolved",
1023                         "status": "SUCCESS"
1024                     }
1025                 },
1026                 {
1027                     "name": "vdns_name_0",
1028                     "value": "RegionOne_ONAP-NF_20191010T013003141Z_vdns_003",
1029                     "resource-resolution-data": {
1030                         "capability-name": "generate-name",
1031                         "resource-key": [
1032                             {
1033                                 "name": "resource-name",
1034                                 "value": "vdns_name_0"
1035                             },
1036                             {
1037                                 "name": "resource-value",
1038                                 "value": "${vdns_name_0}"
1039                             },
1040                             {
1041                                 "name": "naming-type",
1042                                 "value": "VNFC"
1043                             },
1044                             {
1045                                 "name": "VNF_NAME",
1046                                 "value": "RegionOne_ONAP-NF_20191010T013003141Z"
1047                             },
1048                             {
1049                                 "name": "external-key",
1050                                 "value": "793df714-106e-40a6-a28a-746b65f9e247_vdns_name_0"
1051                             },
1052                             {
1053                                 "name": "policy-instance-name",
1054                                 "value": "SDNC_Policy.Config_MS_ONAP_VNF_NAMING_TIMESTAMP"
1055                             },
1056                             {
1057                                 "name": "NFC_NAMING_CODE",
1058                                 "value": "vdns"
1059                             }
1060                         ],
1061                         "status": "SUCCESS"
1062                     }
1063                 },
1064                 {
1065                     "name": "vm-type",
1066                     "value": "vdns",
1067                     "resource-resolution-data": {
1068                         "capability-name": "RA Resolved",
1069                         "status": "SUCCESS"
1070                     }
1071                 },
1072                 {
1073                     "name": "vlb_int_pktgen_private_ip_0",
1074                     "value": "192.168.20.35",
1075                     "resource-resolution-data": {
1076                         "capability-name": "RA Resolved",
1077                         "status": "SUCCESS"
1078                     }
1079                 },
1080                 {
1081                     "name": "onap_private_net_id",
1082                     "value": "oam_network_qXyY",
1083                     "resource-resolution-data": {
1084                         "capability-name": "RA Resolved",
1085                         "status": "SUCCESS"
1086                     }
1087                 },
1088                 {
1089                     "name": "nb_api_version",
1090                     "value": "1.2.0",
1091                     "resource-resolution-data": {
1092                         "capability-name": "RA Resolved",
1093                         "status": "SUCCESS"
1094                     }
1095                 },
1096                 {
1097                     "name": "vdns_image_name",
1098                     "value": "${image_name}",
1099                     "resource-resolution-data": {
1100                         "capability-name": "RA Resolved",
1101                         "status": "SUCCESS"
1102                     }
1103                 },
1104                 {
1105                     "name": "vdns_onap_private_ip_0",
1106                     "value": "10.0.101.35",
1107                     "resource-resolution-data": {
1108                         "capability-name": "netbox-ip-assign",
1109                         "resource-key": [
1110                             {
1111                                 "name": "external_key",
1112                                 "value": "0e905228-c719-489a-9bcc-4470f3254e87-vdns_onap_private_ip_0"
1113                             },
1114                             {
1115                                 "name": "vnf-id",
1116                                 "value": "0e905228-c719-489a-9bcc-4470f3254e87"
1117                             },
1118                             {
1119                                 "name": "service-instance-id",
1120                                 "value": "4545562a-cbe3-409a-8227-0b863f5bc34e"
1121                             },
1122                             {
1123                                 "name": "prefix-id",
1124                                 "value": "3"
1125                             }
1126                         ],
1127                         "status": "SUCCESS"
1128                     }
1129                 },
1130                 {
1131                     "name": "aai-vf-module-put",
1132                     "value": "SUCCESS",
1133                     "resource-resolution-data": {
1134                         "capability-name": "aai-vf-module-put",
1135                         "resource-key": [
1136                             {
1137                                 "name": "vf-module",
1138                                 "value": "vf-module"
1139                             }
1140                         ],
1141                         "status": "SUCCESS"
1142                     }
1143                 },
1144                 {
1145                     "name": "aic-cloud-region",
1146                     "value": "${aic-cloud-region}",
1147                     "resource-resolution-data": {
1148                         "capability-name": "RA Resolved",
1149                         "status": "SUCCESS"
1150                     }
1151                 },
1152                 {
1153                     "name": "nfc-function",
1154                     "value": "${nf-role}",
1155                     "resource-resolution-data": {
1156                         "capability-name": "RA Resolved",
1157                         "status": "SUCCESS"
1158                     }
1159                 },
1160                 {
1161                     "name": "sec_group",
1162                     "value": "onap_sg_qXyY",
1163                     "resource-resolution-data": {
1164                         "capability-name": "RA Resolved",
1165                         "status": "SUCCESS"
1166                     }
1167                 },
1168                 {
1169                     "name": "vnf_name",
1170                     "value": "RegionOne_ONAP-NF_20191010T013003141Z",
1171                     "resource-resolution-data": {
1172                         "capability-name": "RA Resolved",
1173                         "status": "SUCCESS"
1174                     }
1175                 },
1176                 {
1177                     "name": "nexus_artifact_repo",
1178                     "value": "https://nexus.onap.org",
1179                     "resource-resolution-data": {
1180                         "capability-name": "RA Resolved",
1181                         "status": "SUCCESS"
1182                     }
1183                 },
1184                 {
1185                     "name": "public_net_id",
1186                     "value": "external",
1187                     "resource-resolution-data": {
1188                         "capability-name": "RA Resolved",
1189                         "status": "SUCCESS"
1190                     }
1191                 }
1192             ]
1193         },
1194         "tenant": "41d6d38489bd40b09ea8a6b6b852dcbd",
1195         "sdnc-generated-cloud-resources": true,
1196         "vf-module-topology-identifier": {
1197             "vf-module-id": "793df714-106e-40a6-a28a-746b65f9e247",
1198             "vf-module-name": "vfModuleName",
1199             "vf-module-type": "VlbCds..vdns..module-3"
1200         },
1201         "aic-cloud-region": "RegionOne"
1202     }}
1203
1204 Search for the reconfiguration parameters in the vf-module-topology.vf-module-parameters.param array. The user should count (starting from 0, as in most programming languages) the number of array elements to determine the exact location of the parameters of interest. For the VNF described in this documentation, the parameters of interest are "vdns_int_private_ip_0" and "vdns_onap_private_ip_0", which correspond to "ip-addr" and "onap-ip-addr" in the scale out request, respectively. As the user can see by counting the number of array locations (starting from 0), "vdns_int_private_ip_0" and "vdns_onap_private_ip_0" are stored at locations 16 and 30, respectively. As such, the complete resolution path to reconfiguration parameters for the VNF described in this documentation is:
1205
1206 ::
1207
1208     [{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[16].value","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[30].value"}]
1209
1210 In future releases, we plan to leverage CDS to model post scaling VNF reconfiguration, so as to remove the dependency from JSON paths and simplify the overall process.
1211
1212
1213 PART 2 - Scale Out Use Case Instantiation
1214 -----------------------------------------
1215
1216 Manual queries with POSTMAN
1217 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1218
1219 This step is only required if CDS is used, otherwise you can use VID to instantiate the service and the VNF.
1220 Note that the POSTMAN collection linked at the top of this page, does provide some level of automatic scripting that will automatically get values between requests and provision the following queries
1221
1222 You must enter in the postman config different variables:
1223 - "k8s" -> The k8s loadBalancer cluster node
1224 - "cds-service-model" -> The SDC service name distributed
1225 - "cds-instance-name" -> A name of your choice for the vnf instance (This must be changed each time you launch the instantiation)
1226
1227 These useful requests are:
1228 CDS#1 - SDC Catalog Service -> This gets the Sdc service and provision some variables
1229 CDS#2 - SO Catalog DB Service VNFs - CDS -> This gets info in SO and provision some variables for the instantiation
1230 CDS#3 - SO Self-Serve Service Assign & Activate -> This starts the Service/vnf instantiation
1231 Open the body and replace the values like tenantId, Owning entity, region, and all the openstack values everywhere in the payload
1232
1233 Note that you may have to add "onap_private_net_cidr":"10.0.0.0/16" in the "instanceParams" array depending of your openstack network configuration.
1234
1235 CDS#4 - SO infra Active Request -> Used to get the status of the previous query
1236
1237 Manual queries without POSTMAN
1238 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1239
1240 GET information from SDC catalogdb
1241
1242 ::
1243
1244   curl -X GET \
1245     'https://{{k8s}}:30204/sdc/v1/catalog/services' \
1246     -H 'Authorization: Basic dmlkOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=' \
1247     -H 'X-ECOMP-InstanceID: VID' \
1248     -H 'cache-control: no-cache'
1249
1250
1251 In the response you should find values for:
1252
1253 * service-uuid
1254 * service-invariantUUID
1255 * service-name
1256
1257
1258 GET informations from SO catalogdb.
1259
1260 ::
1261
1262   curl -X GET \
1263     'http://{{k8s}}:30744/ecomp/mso/catalog/v2/serviceVnfs?serviceModelName={{service-name}}' \
1264     -H 'Authorization: Basic YnBlbDpwYXNzd29yZDEk' \
1265     -H 'cache-control: no-cache'
1266
1267
1268 In the response you should find values for:
1269
1270 * vnf-modelinfo-modelname
1271 * vnf-modelinfo-modeluuid
1272 * vnf-modelinfo-modelinvariantuuid
1273 * vnf-modelinfo-modelcustomizationuuid
1274 * vnf-modelinfo-modelinstancename
1275 * vnf-vfmodule-0-modelinfo-modelname
1276 * vnf-vfmodule-0-modelinfo-modeluuid
1277 * vnf-vfmodule-0-modelinfo-modelinvariantuuid
1278 * vnf-vfmodule-0-modelinfo-modelcustomizationuuid
1279 * vnf-vfmodule-1-modelinfo-modelname
1280 * vnf-vfmodule-1-modelinfo-modeluuid
1281 * vnf-vfmodule-1-modelinfo-modelinvariantuuid
1282 * vnf-vfmodule-1-modelinfo-modelcustomizationuuid
1283 * vnf-vfmodule-2-modelinfo-modelname
1284 * vnf-vfmodule-2-modelinfo-modeluuid
1285 * vnf-vfmodule-2-modelinfo-modelinvariantuuid
1286 * vnf-vfmodule-2-modelinfo-modelcustomizationuuid
1287 * vnf-vfmodule-3-modelinfo-modelname
1288 * vnf-vfmodule-3-modelinfo-modeluuid
1289 * vnf-vfmodule-3-modelinfo-modelinvariantuuid
1290 * vnf-vfmodule-3-modelinfo-modelcustomizationuuid
1291
1292
1293 Note : all those informations are also available in the TOSCA service template in the SDC
1294
1295 You need after:
1296
1297 * the SSH public key value that will allow you to connect to the VM.
1298 * the cloudSite name and TenantId where to deploy the service
1299 * the name of the security group that will be used in the tenant for your service
1300 * the name of the network that will be used to connect your VM
1301 * the name of your OpenStack image
1302 * the name of your OpenStack VM flavor
1303
1304 We supposed here that we are using some already declared informations:
1305
1306 * customer named "Demonstration"
1307 * subscriptionServiceType named "vLB"
1308 * projectName named "Project-Demonstration"
1309 * owningEntityName named "OE-Demonstration"
1310 * platformName named "test"
1311 * lineOfBusinessName named "someValue"
1312
1313 Having all those information, you are now able to build the SO Macro request
1314 that will instantiate Service, VNF, VF modules and Heat stacks:
1315
1316 ::
1317
1318   curl -X POST \
1319   'http://{{k8s}}:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances' \
1320   -H 'Content-Type: application/json' \
1321   -H 'cache-control: no-cache' \
1322   -d '{
1323    "requestDetails":{
1324       "subscriberInfo":{
1325          "globalSubscriberId":"Demonstration"
1326       },
1327       "requestInfo":{
1328          "suppressRollback":false,
1329          "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
1330          "requestorId":"adt",
1331          "instanceName":"{{cds-instance-name}}",
1332          "source":"VID"
1333       },
1334       "cloudConfiguration":{
1335          "lcpCloudRegionId":"RegionOne",
1336          "tenantId":"41d6d38489bd40b09ea8a6b6b852dcbd",
1337          "cloudOwner":"CloudOwner"
1338       },
1339       "requestParameters":{
1340          "subscriptionServiceType":"vLB",
1341          "userParams":[
1342             {
1343                "Homing_Solution":"none"
1344             },
1345             {
1346                "service":{
1347                   "instanceParams":[
1348
1349                   ],
1350                   "instanceName":"{{cds-instance-name}}",
1351                   "resources":{
1352                      "vnfs":[
1353                         {
1354                            "modelInfo":{
1355                               "modelName":"{{vnf-modelinfo-modelname}}",
1356                               "modelVersionId":"{{vnf-modelinfo-modeluuid}}",
1357                               "modelInvariantUuid":"{{vnf-modelinfo-modelinvariantuuid}}",
1358                               "modelVersion":"1.0",
1359                               "modelCustomizationId":"{{vnf-modelinfo-modelcustomizationuuid}}",
1360                               "modelInstanceName":"{{vnf-modelinfo-modelinstancename}}"
1361                            },
1362                            "cloudConfiguration":{
1363                               "lcpCloudRegionId":"RegionOne",
1364                               "tenantId":"41d6d38489bd40b09ea8a6b6b852dcbd"
1365                            },
1366                            "platform":{
1367                               "platformName":"test"
1368                            },
1369                            "lineOfBusiness":{
1370                               "lineOfBusinessName":"LOB-Demonstration"
1371                            },
1372                            "productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
1373                            "instanceName":"{{vnf-modelinfo-modelinstancename}}",
1374                            "instanceParams":[
1375                               {
1376                                  "onap_private_net_id":"oam_network_qXyY",
1377                                  "dcae_collector_ip":"10.12.5.214",
1378                                  "onap_private_subnet_id":"oam_network_qXyY",
1379                                  "pub_key":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh",
1380                                  "sec_group":"onap_sg_qXyY",
1381                                  "install_script_version":"1.5.0",
1382                                  "demo_artifacts_version":"1.5.0",
1383                                  "cloud_env":"openstack",
1384                                  "flavor_name":"m1.medium",
1385                                  "public_net_id":"external",
1386                                  "image_name":"ubuntu-16-04-cloud-amd64"
1387                               }
1388                            ],
1389                            "vfModules":[
1390                               {
1391                                  "modelInfo":{
1392                                     "modelName":"{{vnf-vfmodule-0-modelinfo-modelname}}",
1393                                     "modelVersionId":"{{vnf-vfmodule-0-modelinfo-modeluuid}}",
1394                                     "modelInvariantUuid":"{{vnf-vfmodule-0-modelinfo-modelinvariantuuid}}",
1395                                     "modelVersion":"1",
1396                                     "modelCustomizationId":"{{vnf-vfmodule-0-modelinfo-modelcustomizationuuid}}"
1397                                  },
1398                                  "instanceName":"{{vnf-vfmodule-0-modelinfo-modelname}}",
1399                                  "instanceParams":[
1400                                     {
1401                                        "sec_group":"onap_sg_imAd",
1402                                        "public_net_id":"external"
1403                                     }
1404                                  ]
1405                               },
1406                               {
1407                                  "modelInfo":{
1408                                     "modelName":"{{vnf-vfmodule-1-modelinfo-modelname}}",
1409                                     "modelVersionId":"{{vnf-vfmodule-1-modelinfo-modeluuid}}",
1410                                     "modelInvariantUuid":"{{vnf-vfmodule-1-modelinfo-modelinvariantuuid}}",
1411                                     "modelVersion":"1",
1412                                     "modelCustomizationId":"{{vnf-vfmodule-1-modelinfo-modelcustomizationuuid}}"
1413                                  },
1414                                  "instanceName":"{{vnf-vfmodule-1-modelinfo-modelname}}",
1415                                  "instanceParams":[
1416                                     {
1417                                        "sec_group":"onap_sg_imAd",
1418                                        "public_net_id":"external"
1419                                     }
1420                                  ]
1421                               },
1422                               {
1423                                  "modelInfo":{
1424                                     "modelName":"{{vnf-vfmodule-2-modelinfo-modelname}}",
1425                                     "modelVersionId":"{{vnf-vfmodule-2-modelinfo-modeluuid}}",
1426                                     "modelInvariantUuid":"{{vnf-vfmodule-2-modelinfo-modelinvariantuuid}}",
1427                                     "modelVersion":"1",
1428                                     "modelCustomizationId":"{{vnf-vfmodule-2-modelinfo-modelcustomizationuuid}}"
1429                                  },
1430                                  "instanceName":"{{vnf-vfmodule-2-modelinfo-modelname}}",
1431                                  "instanceParams":[
1432                                     {
1433                                        "sec_group":"onap_sg_imAd",
1434                                        "public_net_id":"external"
1435                                     }
1436                                  ]
1437                               },
1438                               {
1439                                  "modelInfo":{
1440                                     "modelName":"{{vnf-vfmodule-3-modelinfo-modelname}}",
1441                                     "modelVersionId":"{{vnf-vfmodule-3-modelinfo-modeluuid}}",
1442                                     "modelInvariantUuid":"{{vnf-vfmodule-3-modelinfo-modelinvariantuuid}}",
1443                                     "modelVersion":"1",
1444                                     "modelCustomizationId":"{{vnf-vfmodule-3-modelinfo-modelcustomizationuuid}}"
1445                                  },
1446                                  "instanceName":"{{vnf-vfmodule-3-modelinfo-modelname}}",
1447                                  "instanceParams":[
1448                                     {
1449                                        "sec_group":"onap_sg_imAd",
1450                                        "public_net_id":"external"
1451                                     }
1452                                  ]
1453                               }
1454                            ]
1455                         }
1456                      ]
1457                   },
1458                   "modelInfo":{
1459                      "modelVersion":"1.0",
1460                      "modelVersionId":"{{service-uuid}}",
1461                      "modelInvariantId":"{{service-invariantUUID}}",
1462                      "modelName":"{{service-name}}",
1463                      "modelType":"service"
1464                   }
1465                }
1466             }
1467          ],
1468          "aLaCarte":false
1469       },
1470       "project":{
1471          "projectName":"Project-Demonstration"
1472       },
1473       "owningEntity":{
1474         "owningEntityId":"6f6c49d0-8a8c-4704-9174-321bcc526cc0",
1475         "owningEntityName":"OE-Demonstration"
1476       },
1477       "modelInfo":{
1478         "modelVersion":"1.0",
1479         "modelVersionId":"{{service-uuid}}",
1480         "modelInvariantId":"{{service-invariantUUID}}",
1481         "modelName":"{{service-name}}",
1482         "modelType":"service"}}}'
1483
1484 Note that the "dcae_collector_ip" parameter has to contain the IP address of one of the Kubernetes cluster nodes, 10.12.5.214 in the example above. In the response to the Macro request, the user will obtain a requestId that will be usefulto follow the instantiation request status in the ONAP SO:
1485
1486 ::
1487
1488   curl -X GET \
1489     'http://{{k8s}}:30086/infraActiveRequests/{{requestid}}' \
1490     -H 'cache-control: no-cache'
1491
1492
1493
1494
1495
1496 PART 3 - Post Instantiation Operations
1497 --------------------------------------
1498
1499 3-1 Post Instantiation VNF configuration
1500 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1501
1502 CDS executes post-instantiation VNF configuration if the "skip-post-instantiation" flag in the SDC service model is set to false, which is the default behavior. Manual post-instantiation configuration is necessary if the "skip-post-instantiation" flag in the service model is set to true or if the VNF is instantiated using the preload approach, which doesn't include CDS. Regardless, this step is NOT required during scale out operations, as VNF reconfiguration will be triggered by SO and executed by APPC.
1503
1504 If VNF post instantiation is executed manually, in order to change the state of the vLB the users should 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:
1505
1506 ::
1507
1508   curl -X PUT \
1509   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 \
1510   -H 'Accept: application/json' \
1511   -H 'Content-Type: application/json' \
1512   -H 'Postman-Token: a708b064-adb1-4804-89a7-ee604f5fe76f' \
1513   -H 'cache-control: no-cache' \
1514   -d '{
1515     "vdns-instance": [
1516         {
1517             "ip-addr": "192.168.10.59",
1518             "oam-ip-addr": "10.0.101.49",
1519             "enabled": true
1520         }
1521     ]
1522   }'
1523
1524 At this point, the VNF is fully set up.
1525
1526
1527 3-2 Updating AAI with VNF resources
1528 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1529
1530 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:
1531
1532 ::
1533
1534     ./demo-k8s.sh onap heatbridge <vLB stack_name in OpenStack> <service_instance_id> vLB vlb_onap_private_ip_0
1535
1536 Note that "vlb_onap_private_ip_0" used in the heatbridge call is the actual parameter name, not its value (e.g. the actual IP address). Heatbridge is needed for control loops because DCAE and Policy runs queries against AAI using vServer names as key.
1537
1538
1539 PART 4 - Triggering Scale Out Manually
1540 --------------------------------------
1541
1542 For scale out with manual trigger, VID is not supported at this time.
1543
1544 Manual queries with POSTMAN
1545 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1546
1547 Note that the POSTMAN collection linked at the top of this page, does provide some level of automatic scripting that will automatically get values between requests and provision the following queries
1548
1549 You must enter in the postman config different variables:
1550 - "k8s" -> The k8s loadBalancer cluster node
1551 - "cds-service-model" -> The SDC service name distributed
1552 - "cds-instance-name" -> A name of your choice for the vnf instance (This must be changed each time you launch the instantiation)
1553
1554 CDS#5 - SO ScaleOut -> This will initiate a Scaleout manually
1555 CDS#7 - SO ScaleIn -> This will initiate a ScaleIn manually
1556
1557 Manual queries without POSTMAN
1558 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1559
1560 Users can run the use case by directly calling SO APIs:
1561
1562 ::
1563
1564   curl -X POST \
1565   http://<Any_K8S_Node_IP_Address>:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/7d3ca782-c486-44b3-9fe5-39f322d8ee80/vnfs/9d33cf2d-d6aa-4b9e-a311-460a6be5a7de/vfModules/scaleOut \
1566   -H 'Accept: application/json' \
1567   -H 'Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==' \
1568   -H 'Cache-Control: no-cache' \
1569   -H 'Connection: keep-alive' \
1570   -H 'Content-Type: application/json' \
1571   -H 'Postman-Token: 12f2601a-4eb2-402c-a51a-f29502359501,9befda68-b2c9-4e7a-90ca-1be9c24ef664' \
1572   -H 'User-Agent: PostmanRuntime/7.15.0' \
1573   -H 'accept-encoding: gzip, deflate' \
1574   -H 'cache-control: no-cache' \
1575   -H 'content-length: 2422' \
1576   -H 'cookie: JSESSIONID=B3BA24216367F9D39E3DF5E8CBA4BC64' \
1577   -b JSESSIONID=B3BA24216367F9D39E3DF5E8CBA4BC64 \
1578   -d '{
1579     "requestDetails": {
1580         "modelInfo": {
1581             "modelCustomizationName": "VdnsloadbalancerCds..vdns..module-3",
1582             "modelCustomizationId": "ded42059-2f35-42d4-848b-16e1ab1ad197",
1583             "modelInvariantId": "2815d321-c6b4-4f21-b7f7-fa5adf8ed7d9",
1584             "modelVersionId": "524e34ed-9789-453e-ab73-8eff30eafef3",
1585             "modelName": "VdnsloadbalancerCds..vdns..module-3",
1586             "modelType": "vfModule",
1587             "modelVersion": "1"
1588         },
1589         "cloudConfiguration": {
1590             "lcpCloudRegionId": "RegionOne",
1591             "tenantId": "d570c718cbc545029f40e50b75eb13df",
1592             "cloudOwner": "CloudOwner"
1593         },
1594         "requestInfo": {
1595             "instanceName": "vDNS-VM-02",
1596             "source": "VID",
1597             "suppressRollback": false,
1598             "requestorId": "demo"
1599         },
1600         "requestParameters": {
1601             "userParams": []
1602         },
1603         "relatedInstanceList": [
1604             {
1605                 "relatedInstance": {
1606                     "instanceId": "7d3ca782-c486-44b3-9fe5-39f322d8ee80",
1607                     "modelInfo": {
1608                         "modelType": "service",
1609                         "modelInvariantId": "dfabdcae-cf50-4801-9885-9a3a9cc07e6f",
1610                         "modelVersionId": "ee55b537-7be5-4377-93c1-5d92931b6a78",
1611                         "modelName": "vLoadBalancerCDS",
1612                         "modelVersion": "1.0"
1613                     }
1614                 }
1615             },
1616             {
1617                 "relatedInstance": {
1618                     "instanceId": "9d33cf2d-d6aa-4b9e-a311-460a6be5a7de",
1619                     "modelInfo": {
1620                         "modelType": "vnf",
1621                         "modelInvariantId": "a77f9280-5c02-46cd-b1fc-855975db9df9",
1622                         "modelVersionId": "ff0e99ce-a521-44b5-b11b-da7e07ac83fc",
1623                         "modelName": "vLoadBalancerCDS",
1624                         "modelVersion": "1.0",
1625                         "modelCustomizationId": "b8b8a25d-19de-4581-bb63-f2dc8c0d79a7"
1626                     }
1627                 }
1628             }
1629         ],
1630         "configurationParameters": [
1631             {
1632                 "ip-addr": "$.vf-module-topology.vf-module-parameters.param[17].value",
1633                 "oam-ip-addr": "$.vf-module-topology.vf-module-parameters.param[31].value"
1634             }
1635         ]
1636     }
1637   }'
1638
1639
1640 To fill in the JSON object, users need to download the Service Model TOSCA template from the SDC Portal using one of the standard SDC users (for example user: cs0008, password: demo123456!). After logging to SDC, the user should select from the catalog the vLB service that they created, click the "TOSCA Artifacts" link on the left, and finally the download button on the right, as shown in the figure below:
1641
1642 .. figure:: files/scaleout/tosca_template_fig.png
1643    :align: center
1644
1645 For the example described below, users can refer to the TOSCA template linked 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.
1646
1647 The values of modelInvariantId, modelVersionId, and modelName in the relatedInstance item identified by "modelType": "service" in the JSON request to SO have to match invariantUUID, UUID, and name, respectively, in the TOSCA template:
1648 ::
1649
1650             {
1651                 "relatedInstance": {
1652                     "instanceId": "7d3ca782-c486-44b3-9fe5-39f322d8ee80",
1653                     "modelInfo": {
1654                         "modelType": "service",
1655                         "modelInvariantId": "dfabdcae-cf50-4801-9885-9a3a9cc07e6f",
1656                         "modelVersionId": "ee55b537-7be5-4377-93c1-5d92931b6a78",
1657                         "modelName": "vLoadBalancerCDS",
1658                         "modelVersion": "1.0"
1659                     }
1660                 }
1661             }
1662
1663 .. figure:: files/scaleout/service.png
1664    :align: center
1665
1666
1667 The values of modelInvariantId, modelVersionId, modelName, and modelVersion in the relatedInstance item identified by "modelType": "vnf" in the JSON request to SO have to match invariantUUID, UUID, name, and version, respectively, in the TOSCA template:
1668
1669 ::
1670
1671             {
1672                 "relatedInstance": {
1673                     "instanceId": "9d33cf2d-d6aa-4b9e-a311-460a6be5a7de",
1674                     "modelInfo": {
1675                         "modelType": "vnf",
1676                         "modelInvariantId": "a77f9280-5c02-46cd-b1fc-855975db9df9",
1677                         "modelVersionId": "ff0e99ce-a521-44b5-b11b-da7e07ac83fc",
1678                         "modelName": "vLoadBalancerCDS",
1679                         "modelVersion": "1.0",
1680                         "modelCustomizationId": "b8b8a25d-19de-4581-bb63-f2dc8c0d79a7"
1681                     }
1682                 }
1683             }
1684
1685 .. figure:: files/scaleout/vnf.png
1686    :align: center
1687
1688
1689 The modelCustomizationId, modelInvariantId, modelVersionId, modelName, and modelVersion in the modelInfo item identified by "modelType": "vfModule" in the JSON request to SO have to match vfModuleModelCustomizationUUID, vfModuleModelInvariantUUID, vfModuleModelUUID, vfModuleModelName, and vfModuleModelVersion, respectively, in the TOSCA template. The modelCustomizationName parameter in the SO object can be set as the modelName parameter in the same JSON object:
1690
1691 ::
1692
1693         "modelInfo": {
1694             "modelCustomizationName": "Vloadbalancercds..vdns..module-3",
1695             "modelCustomizationId": "ded42059-2f35-42d4-848b-16e1ab1ad197",
1696             "modelInvariantId": "2815d321-c6b4-4f21-b7f7-fa5adf8ed7d9",
1697             "modelVersionId": "524e34ed-9789-453e-ab73-8eff30eafef3",
1698             "modelName": "Vloadbalancercds..vdns..module-3",
1699             "modelType": "vfModule",
1700             "modelVersion": "1"
1701         }
1702
1703 The vLB-vDNS-vPacketGenerator VNF that we use to describe the scale out use case supports the scaling of the vDNS VF module only. As such, in the TOSCA template users should refer to the section identified by "vfModuleModelName": "Vloadbalancercds..vdns..module-3", as highlighted below:
1704
1705 .. figure:: files/scaleout/service.png
1706    :align: center
1707
1708
1709 Note that both Service and VNF related instances have a field called "instanceId" that represent the Service and VNF instance ID, respectively. These IDs are assigned at Service and VNF instantiation time and can be retrieved from AAI, querying for generic VNF objects:
1710
1711 ::
1712
1713     curl -k -X GET \
1714   https://<Any_K8S_Node_IP_Address>:30233/aai/v16/network/generic-vnfs \
1715   -H 'Accept: application/json' \
1716   -H 'Authorization: Basic QUFJOkFBSQ==' \
1717   -H 'Content-Type: application/json' \
1718   -H 'X-FromAppId: AAI' \
1719   -H 'X-TransactionId: get_aai_subscr'
1720
1721 From the list of VNFs reported by AAI, search for the name of the VNF that was previously instantiated, for example "vLB_VNF_01" in the example below:
1722
1723 ::
1724
1725         {
1726             "vnf-id": "9d33cf2d-d6aa-4b9e-a311-460a6be5a7de",
1727             "vnf-name": "vLB_VNF_01",
1728             "vnf-type": "vLoadBalancer/vLoadBalancer 0",
1729             "prov-status": "ACTIVE",
1730             "equipment-role": "",
1731             "orchestration-status": "Active",
1732             "ipv4-oam-address": "10.0.220.10",
1733             "in-maint": true,
1734             "is-closed-loop-disabled": false,
1735             "resource-version": "1565817789379",
1736             "model-invariant-id": "a77f9280-5c02-46cd-b1fc-855975db9df9",
1737             "model-version-id": "ff0e99ce-a521-44b5-b11b-da7e07ac83fc",
1738             "model-customization-id": "b8b8a25d-19de-4581-bb63-f2dc8c0d79a7",
1739             "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/7d3ca782-c486-44b3-9fe5-39f322d8ee80/service-data/vnfs/vnf/9d33cf2d-d6aa-4b9e-a311-460a6be5a7de/vnf-data/vnf-topology/",
1740             "relationship-list": {
1741                 "relationship": [
1742                     {
1743                         "related-to": "service-instance",
1744                         "relationship-label": "org.onap.relationships.inventory.ComposedOf",
1745                         "related-link": "/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vRAR/service-instances/service-instance/7d3ca782-c486-44b3-9fe5-39f322d8ee80",
1746                         "relationship-data": [
1747                             {
1748                                 "relationship-key": "customer.global-customer-id",
1749                                 "relationship-value": "Demonstration"
1750                             },
1751                             {
1752                                 "relationship-key": "service-subscription.service-type",
1753                                 "relationship-value": "vLB"
1754                             },
1755                             {
1756                                 "relationship-key": "service-instance.service-instance-id",
1757                                 "relationship-value": "7d3ca782-c486-44b3-9fe5-39f322d8ee80"
1758                             }
1759                         ],
1760                         "related-to-property": [
1761                             {
1762                                 "property-key": "service-instance.service-instance-name",
1763                                 "property-value": "vLB-Service-0814-1"
1764                             }
1765                         ]
1766                     }
1767                     ...
1768          }
1769
1770 To identify the VNF ID, look for the "vnf-id" parameter at the top of the JSON object, while to determine the Service ID, look for the "relationship-value" parameter corresponding to the "relationship-key": "service-instance.service-instance-id" item in the "relationship-data" list. In the example above, the Service instance ID is 7d3ca782-c486-44b3-9fe5-39f322d8ee80, while the VNF ID is 9d33cf2d-d6aa-4b9e-a311-460a6be5a7de.
1771
1772 These IDs are also used in the URL request to SO:
1773
1774 ::
1775
1776     http://<Any_K8S_Node_IP_Address>:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances/7d3ca782-c486-44b3-9fe5-39f322d8ee80/vnfs/9d33cf2d-d6aa-4b9e-a311-460a6be5a7de/vfModules/scaleOut
1777
1778
1779 Finally, the "configurationParameters" section in the JSON request to SO contains the parameters that will be used to reconfigure the VNF after scaling. Please see Section 1-7 for an in-depth description of how to set the parameters correctly.
1780
1781 ::
1782
1783     "configurationParameters": [
1784             {
1785                 "ip-addr": "$.vf-module-topology.vf-module-parameters.param[16].value",
1786                 "oam-ip-addr": "$.vf-module-topology.vf-module-parameters.param[30].value"
1787             }
1788     ]
1789
1790
1791 PART 5 - Running the Scale Out Use Case with Configuration Preload
1792 ------------------------------------------------------------------
1793
1794 While CDS can be used to model and automate the generation of cloud configuration for VNF instantiation, the manual preload approach is still supported for scale out with manual trigger (no closed loop). Note that preload operations must be executed before VF modules are created or scaled, as the instantiation process will use the preload to determine the VF module configuration.
1795
1796 The procedure is similar to one described above, with some minor changes:
1797
1798 1) **Service Design and Creation**: The heat template used to create a vendor software product in SDC is the same. However, during property assignment (Section 1-2) "sdnc_artifact_name", "sdnc_model_version", "sdnc_model_name" **must be** left blank, as they are used for CDS only.
1799
1800 2) As closed loop with preload is not supported for scale out, DCAE blueprint and Policy onboarding (Section 1-2), deployment of naming policy (Section 1-3), and closed loop design and deployment from CLAMP (Section 1-4) are not necessary.
1801
1802 3) **Creation of VNF template with CDT** works as described in Section 1-5.
1803
1804 4) **Controller type selection** in SO works as described in Section 1-6.
1805
1806 5) **VNF instantiation from VID**: users can use VID to create the service, the VNF, and instantiate the VF modules. In the VID main page, users should select GR API (this should be the default option).
1807
1808 .. figure:: files/scaleout/vid.png
1809    :align: center
1810
1811 Based on the Heat template structure, there are four VF modules:
1812
1813   * module-0: base module that contains resources, such as internal private networks and public key, shared across the VNF elements
1814   * module-1: vLB resource descriptor
1815   * module-2: vPacketGen resource descriptor
1816   * module-3: vDNS resource descriptor
1817
1818 These VF modules have to be installed in the following order, so as to satisfy heat dependencies: module-0, module-1, module-2, module-3. The parameters defined in the Heat environment files can be overridden by loading cloud configuration to SDNC before the VF modules are instantiated. See example of preloads below. They need to be customized based on the OpenStack cloud and execution environment in which the VF modules are going to be instantiated.
1819
1820 Module-0 Preload
1821 ~~~~~~~~~~~~~~~~
1822
1823 ::
1824
1825     curl -X POST \
1826   http://<Any_K8S_Node_IP_Address>:30202/restconf/operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation \
1827   -H 'Content-Type: application/json' \
1828   -H 'Postman-Token: 0a7abc62-9d8f-4f63-8b05-db7cc4c3e28b' \
1829   -H 'cache-control: no-cache' \
1830   -d '{
1831     "input": {
1832         "preload-vf-module-topology-information": {
1833             "vf-module-topology": {
1834                 "vf-module-topology-identifier": {
1835                     "vf-module-name": "vNetworks-0211-1"
1836                 },
1837                 "vf-module-parameters": {
1838                     "param": [
1839                         {
1840                             "name": "vlb_private_net_id",
1841                             "value": "vLBMS_zdfw1lb01_private_ms"
1842                         },
1843                         {
1844                             "name": "pktgen_private_net_id",
1845                             "value": "vLBMS_zdfw1pktgen01_private_ms"
1846                         },
1847                         {
1848                             "name": "vlb_private_net_cidr",
1849                             "value": "192.168.10.0/24"
1850                         },
1851                         {
1852                             "name": "pktgen_private_net_cidr",
1853                             "value": "192.168.9.0/24"
1854                         },
1855                         {
1856                             "name": "vlb_0_int_pktgen_private_port_0_mac",
1857                             "value": "fa:16:3e:00:01:10"
1858                         },
1859                         {
1860                             "name": "vpg_0_int_pktgen_private_port_0_mac",
1861                             "value": "fa:16:3e:00:01:20"
1862                         },
1863                         {
1864                             "name": "vnf_id",
1865                             "value": "vLoadBalancerMS"
1866                         },
1867                         {
1868                             "name": "vnf_name",
1869                             "value": "vLBMS"
1870                         },
1871                         {
1872                             "name": "key_name",
1873                             "value": "vlb_key"
1874                         },
1875                         {
1876                             "name": "pub_key",
1877                             "value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN"
1878                         }
1879                     ]
1880                 }
1881             },
1882             "vnf-topology-identifier-structure": {
1883                 "vnf-name": "vLoadBalancer-Vnf-0211-1",
1884                 "vnf-type": "vLoadBalancer/vLoadBalancer 0"
1885             },
1886             "vnf-resource-assignments": {
1887                 "availability-zones": {
1888                     "availability-zone": [
1889                         "nova"
1890                     ],
1891                     "max-count": 1
1892                 },
1893                 "vnf-networks": {
1894                     "vnf-network": []
1895                 }
1896             }
1897         },
1898         "request-information": {
1899             "request-id": "robot12",
1900             "order-version": "1",
1901             "notification-url": "openecomp.org",
1902             "order-number": "1",
1903             "request-action": "PreloadVfModuleRequest"
1904         },
1905         "sdnc-request-header": {
1906             "svc-request-id": "robot12",
1907             "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
1908             "svc-action": "reserve"
1909         }
1910     }
1911   }'
1912
1913
1914 Module-1 Preload
1915 ~~~~~~~~~~~~~~~~
1916
1917 ::
1918
1919     curl -X POST \
1920   http://<Any_K8S_Node_IP_Address>:30202/restconf/operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation \
1921   -H 'Content-Type: application/json' \
1922   -H 'Postman-Token: 662914ac-29fc-414d-8823-1691fb2c718a' \
1923   -H 'cache-control: no-cache' \
1924   -d '{
1925     "input": {
1926         "preload-vf-module-topology-information": {
1927             "vf-module-topology": {
1928                 "vf-module-topology-identifier": {
1929                     "vf-module-name": "vLoadBalancer-0211-1"
1930                 },
1931                 "vf-module-parameters": {
1932                     "param": [
1933                         {
1934                             "name": "vlb_image_name",
1935                             "value": "ubuntu-16-04-cloud-amd64"
1936                         },
1937                         {
1938                             "name": "vlb_flavor_name",
1939                             "value": "m1.medium"
1940                         },
1941                         {
1942                             "name": "public_net_id",
1943                             "value": "public"
1944                         },
1945                         {
1946                             "name": "int_private_net_id",
1947                             "value": "vLBMS_zdfw1lb01_private_ms"
1948                         },
1949                         {
1950                             "name": "int_private_subnet_id",
1951                             "value": "vLBMS_zdfw1lb01_private_sub_ms"
1952                         },
1953                         {
1954                             "name": "int_pktgen_private_net_id",
1955                             "value": "vLBMS_zdfw1pktgen01_private_ms"
1956                         },
1957                         {
1958                             "name": "int_pktgen_private_subnet_id",
1959                             "value": "vLBMS_zdfw1pktgen01_private_sub_ms"
1960                         },
1961                         {
1962                             "name": "onap_private_net_id",
1963                             "value": "oam_onap_vnf_test"
1964                         },
1965                         {
1966                             "name": "onap_private_subnet_id",
1967                             "value": "oam_onap_vnf_test"
1968                         },
1969                         {
1970                             "name": "vlb_private_net_cidr",
1971                             "value": "192.168.10.0/24"
1972                         },
1973                         {
1974                             "name": "pktgen_private_net_cidr",
1975                             "value": "192.168.9.0/24"
1976                         },
1977                         {
1978                             "name": "onap_private_net_cidr",
1979                             "value": "10.0.0.0/16"
1980                         },
1981                         {
1982                             "name": "vlb_int_private_ip_0",
1983                             "value": "192.168.10.111"
1984                         },
1985                         {
1986                             "name": "vlb_onap_private_ip_0",
1987                             "value": "10.0.150.1"
1988                         },
1989                         {
1990                             "name": "vlb_int_pktgen_private_ip_0",
1991                             "value": "192.168.9.111"
1992                         },
1993                         {
1994                             "name": "vdns_int_private_ip_0",
1995                             "value": "192.168.10.211"
1996                         },
1997                         {
1998                             "name": "vdns_onap_private_ip_0",
1999                             "value": "10.0.150.3"
2000                         },
2001                         {
2002                             "name": "vpg_int_pktgen_private_ip_0",
2003                             "value": "192.168.9.110"
2004                         },
2005                         {
2006                             "name": "vpg_onap_private_ip_0",
2007                             "value": "10.0.150.2"
2008                         },
2009                         {
2010                             "name": "vlb_name_0",
2011                             "value": "vlb-0211-1"
2012                         },
2013                         {
2014                             "name": "vlb_0_mac_address",
2015                             "value": "fa:16:3e:00:01:10"
2016                         },
2017                         {
2018                             "name": "vpg_0_mac_address",
2019                             "value": "fa:16:3e:00:01:20"
2020                         },
2021                         {
2022                             "name": "vip",
2023                             "value": "192.168.9.112"
2024                         },
2025                         {
2026                             "name": "gre_ipaddr",
2027                             "value": "192.168.10.112"
2028                         },
2029                         {
2030                             "name": "vnf_id",
2031                             "value": "vLoadBalancerMS"
2032                         },
2033                         {
2034                             "name": "vf_module_id",
2035                             "value": "vLoadBalancerMS"
2036                         },
2037                         {
2038                             "name": "vnf_name",
2039                             "value": "vLBMS"
2040                         },
2041                         {
2042                             "name": "dcae_collector_ip",
2043                             "value": "10.12.5.20"
2044                         },
2045                         {
2046                             "name": "dcae_collector_port",
2047                             "value": "30235"
2048                         },
2049                         {
2050                             "name": "demo_artifacts_version",
2051                             "value": "1.6.0-SNAPSHOT"
2052                         },
2053                         {
2054                             "name": "install_script_version",
2055                             "value": "1.6.0-SNAPSHOT"
2056                         },
2057                         {
2058                             "name": "nb_api_version",
2059                             "value": "1.2.0"
2060                         },
2061                         {
2062                             "name": "keypair",
2063                             "value": "vlb_key"
2064                         },
2065                         {
2066                             "name": "cloud_env",
2067                             "value": "openstack"
2068                         },
2069                         {
2070                             "name": "nexus_artifact_repo",
2071                             "value": "https://nexus.onap.org"
2072                         },
2073                         {
2074                             "name": "sec_group",
2075                             "value": "default"
2076                         }
2077                     ]
2078                 }
2079             },
2080             "vnf-topology-identifier-structure": {
2081                 "vnf-name": "vLoadBalancer-Vnf-0211-1",
2082                 "vnf-type": "vLoadBalancer/vLoadBalancer 0"
2083             },
2084             "vnf-resource-assignments": {
2085                 "availability-zones": {
2086                     "availability-zone": [
2087                         "nova"
2088                     ],
2089                     "max-count": 1
2090                 },
2091                 "vnf-networks": {
2092                     "vnf-network": []
2093                 }
2094             }
2095         },
2096         "request-information": {
2097             "request-id": "robot12",
2098             "order-version": "1",
2099             "notification-url": "openecomp.org",
2100             "order-number": "1",
2101             "request-action": "PreloadVfModuleRequest"
2102         },
2103         "sdnc-request-header": {
2104             "svc-request-id": "robot12",
2105             "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
2106             "svc-action": "reserve"
2107         }
2108     }
2109   }'
2110
2111
2112 Module-2 Preload
2113 ~~~~~~~~~~~~~~~~
2114
2115 ::
2116
2117
2118     curl -X POST \
2119   http://<Any_K8S_Node_IP_Address>:30202/restconf/operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation \
2120   -H 'Content-Type: application/json' \
2121   -H 'Postman-Token: 5f2490b3-6e4a-4512-9a0d-0aa6f6fa0ea8' \
2122   -H 'cache-control: no-cache' \
2123   -d '{
2124     "input": {
2125         "preload-vf-module-topology-information": {
2126             "vf-module-topology": {
2127                 "vf-module-topology-identifier": {
2128                     "vf-module-name": "vPacketGen-0211-1"
2129                 },
2130                 "vf-module-parameters": {
2131                     "param": [
2132                         {
2133                             "name": "vpg_image_name",
2134                             "value": "ubuntu-16-04-cloud-amd64"
2135                         },
2136                         {
2137                             "name": "vpg_flavor_name",
2138                             "value": "m1.medium"
2139                         },
2140                         {
2141                             "name": "public_net_id",
2142                             "value": "public"
2143                         },
2144                         {
2145                             "name": "int_pktgen_private_net_id",
2146                             "value": "vLBMS_zdfw1pktgen01_private_ms"
2147                         },
2148                         {
2149                             "name": "int_pktgen_private_subnet_id",
2150                             "value": "vLBMS_zdfw1pktgen01_private_sub_ms"
2151                         },
2152                         {
2153                             "name": "onap_private_net_id",
2154                             "value": "oam_onap_vnf_test"
2155                         },
2156                         {
2157                             "name": "onap_private_subnet_id",
2158                             "value": "oam_onap_vnf_test"
2159                         },
2160                         {
2161                             "name": "pktgen_private_net_cidr",
2162                             "value": "192.168.9.0/24"
2163                         },
2164                         {
2165                             "name": "onap_private_net_cidr",
2166                             "value": "10.0.0.0/16"
2167                         },
2168                         {
2169                             "name": "vlb_int_pktgen_private_ip_0",
2170                             "value": "192.168.9.111"
2171                         },
2172                         {
2173                             "name": "vpg_int_pktgen_private_ip_0",
2174                             "value": "192.168.9.110"
2175                         },
2176                         {
2177                             "name": "vpg_onap_private_ip_0",
2178                             "value": "10.0.150.2"
2179                         },
2180                         {
2181                             "name": "vpg_name_0",
2182                             "value": "vpg-0211-1"
2183                         },
2184                         {
2185                             "name": "vlb_0_mac_address",
2186                             "value": "fa:16:3e:00:01:10"
2187                         },
2188                         {
2189                             "name": "vpg_0_mac_address",
2190                             "value": "fa:16:3e:00:01:20"
2191                         },
2192                         {
2193                             "name": "pg_int",
2194                             "value": "192.168.9.109"
2195                         },
2196                         {
2197                             "name": "vnf_id",
2198                             "value": "vLoadBalancerMS"
2199                         },
2200                         {
2201                             "name": "vf_module_id",
2202                             "value": "vLoadBalancerMS"
2203                         },
2204                         {
2205                             "name": "vnf_name",
2206                             "value": "vLBMS"
2207                         },
2208                         {
2209                             "name": "demo_artifacts_version",
2210                             "value": "1.6.0-SNAPSHOT"
2211                         },
2212                         {
2213                             "name": "install_script_version",
2214                             "value": "1.6.0-SNAPSHOT"
2215                         },
2216                         {
2217                             "name": "nb_api_version",
2218                             "value": "1.2.0"
2219                         },
2220                         {
2221                             "name": "keypair",
2222                             "value": "vlb_key"
2223                         },
2224                         {
2225                             "name": "cloud_env",
2226                             "value": "openstack"
2227                         },
2228                         {
2229                             "name": "nexus_artifact_repo",
2230                             "value": "https://nexus.onap.org"
2231                         },
2232                         {
2233                             "name": "sec_group",
2234                             "value": "default"
2235                         }
2236                     ]
2237                 }
2238             },
2239             "vnf-topology-identifier-structure": {
2240                 "vnf-name": "vLoadBalancer-Vnf-0211-1",
2241                 "vnf-type": "vLoadBalancer/vLoadBalancer 0"
2242             },
2243             "vnf-resource-assignments": {
2244                 "availability-zones": {
2245                     "availability-zone": [
2246                         "nova"
2247                     ],
2248                     "max-count": 1
2249                 },
2250                 "vnf-networks": {
2251                     "vnf-network": []
2252                 }
2253             }
2254         },
2255         "request-information": {
2256             "request-id": "robot12",
2257             "order-version": "1",
2258             "notification-url": "openecomp.org",
2259             "order-number": "1",
2260             "request-action": "PreloadVfModuleRequest"
2261         },
2262         "sdnc-request-header": {
2263             "svc-request-id": "robot12",
2264             "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
2265             "svc-action": "reserve"
2266         }
2267     }
2268  }'
2269
2270
2271 Module-3 Preload
2272 ~~~~~~~~~~~~~~~~
2273
2274 ::
2275
2276     curl -X POST \
2277   http://<Any_K8S_Node_IP_Address>:30202/restconf/operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation \
2278   -H 'Content-Type: application/json' \
2279   -H 'Postman-Token: fd0a4706-f955-490a-875e-08ddd8fe002e' \
2280   -H 'cache-control: no-cache' \
2281   -d '{
2282     "input": {
2283         "preload-vf-module-topology-information": {
2284             "vf-module-topology": {
2285                 "vf-module-topology-identifier": {
2286                     "vf-module-name": "vDNS-0125-1"
2287                 },
2288                 "vf-module-parameters": {
2289                     "param": [
2290                         {
2291                             "name": "vdns_image_name",
2292                             "value": "ubuntu-16-04-cloud-amd64"
2293                         },
2294                         {
2295                             "name": "vdns_flavor_name",
2296                             "value": "m1.medium"
2297                         },
2298                         {
2299                             "name": "public_net_id",
2300                             "value": "public"
2301                         },
2302                         {
2303                             "name": "int_private_net_id",
2304                             "value": "vLBMS_zdfw1lb01_private"
2305                         },
2306                         {
2307                             "name": "int_private_subnet_id",
2308                             "value": "vLBMS_zdfw1lb01_private_sub_ms"
2309                         },
2310                         {
2311                             "name": "onap_private_net_id",
2312                             "value": "oam_onap_vnf_test"
2313                         },
2314                         {
2315                             "name": "onap_private_subnet_id",
2316                             "value": "oam_onap_vnf_test"
2317                         },
2318                         {
2319                             "name": "vlb_private_net_cidr",
2320                             "value": "192.168.10.0/24"
2321                         },
2322                         {
2323                             "name": "onap_private_net_cidr",
2324                             "value": "10.0.0.0/16"
2325                         },
2326                         {
2327                             "name": "vlb_int_private_ip_0",
2328                             "value": "192.168.10.111"
2329                         },
2330                         {
2331                             "name": "vlb_onap_private_ip_0",
2332                             "value": "10.0.150.1"
2333                         },
2334                         {
2335                             "name": "vlb_int_pktgen_private_ip_0",
2336                             "value": "192.168.9.111"
2337                         },
2338                         {
2339                             "name": "vdns_int_private_ip_0",
2340                             "value": "192.168.10.212"
2341                         },
2342                         {
2343                             "name": "vdns_onap_private_ip_0",
2344                             "value": "10.0.150.4"
2345                         },
2346                         {
2347                             "name": "vdns_name_0",
2348                             "value": "vdns-0211-1"
2349                         },
2350                         {
2351                             "name": "vnf_id",
2352                             "value": "vLoadBalancerMS"
2353                         },
2354                         {
2355                             "name": "vf_module_id",
2356                             "value": "vLoadBalancerMS"
2357                         },
2358                         {
2359                             "name": "vnf_name",
2360                             "value": "vLBMS"
2361                         },
2362                         {
2363                             "name": "install_script_version",
2364                             "value": "1.6.0-SNAPSHOT"
2365                         },
2366                         {
2367                             "name": "nb_api_version",
2368                             "value": "1.2.0"
2369                         },
2370                         {
2371                             "name": "keypair",
2372                             "value": "vlb_key"
2373                         },
2374                         {
2375                             "name": "cloud_env",
2376                             "value": "openstack"
2377                         },
2378                         {
2379                             "name": "sec_group",
2380                             "value": "default"
2381                         },
2382                         {
2383                             "name": "nexus_artifact_repo",
2384                             "value": "https://nexus.onap.org"
2385                         }
2386                     ]
2387                 }
2388             },
2389             "vnf-topology-identifier-structure": {
2390                 "vnf-name": "vLoadBalancer-Vnf-0125-1",
2391                 "vnf-type": "vLoadBalancer/vLoadBalancer 0"
2392             },
2393             "vnf-resource-assignments": {
2394                 "availability-zones": {
2395                     "availability-zone": [
2396                         "nova"
2397                     ],
2398                     "max-count": 1
2399                 },
2400                 "vnf-networks": {
2401                     "vnf-network": []
2402                 }
2403             }
2404         },
2405         "request-information": {
2406             "request-id": "robot12",
2407             "order-version": "1",
2408             "notification-url": "openecomp.org",
2409             "order-number": "1",
2410             "request-action": "PreloadVfModuleRequest"
2411         },
2412         "sdnc-request-header": {
2413             "svc-request-id": "robot12",
2414             "svc-notification-url": "http://openecomp.org:8080/adapters/rest/SDNCNotify",
2415             "svc-action": "reserve"
2416         }
2417     }
2418  }'
2419
2420 The Heat environment files already set many parameters used for VF module instantiation. Those parameters can be reused in the SDNC preload too, while placeholders like "PUT THE IP ADDRESS HERE" or "PUT THE PUBLIC KEY HERE" must be overridden.
2421
2422 To instantiate VF modules, please refer to this wiki page: https://wiki.onap.org/display/DW/Tutorial+vIMS%3A+VID+Instantiate+the+VNF using vLB as ServiceType.
2423
2424 6) **Post Instantiation Actions**: Please refer to Sections 3-1 for vLB configuration and Section 3-2 for resource orchestration with heatbridge.
2425
2426 7) **Triggering Scale Out Manually**: Please refer to Section 4 to trigger scale out manually with direct API call to SO.
2427
2428
2429 PART 6 - Known Issues and Resolutions
2430 -------------------------------------
2431
2432    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
2433
2434 Resolution: Change TCA configuration for the old vLB/vDNS use case
2435
2436 - Connect to Consul: http://ANY_K8S_IP:30270 and click on "Key/Value" → "dcae-tca-analytics"
2437 - Change "eventName" in the vLB default policy to something different, for example "vLB" instead of the default value "vLoadBalancer"
2438 - Change "subscriberConsumerGroup" in the TCA configuration to something different, for example "OpenDCAE-c13" instead of the default value "OpenDCAE-c12"
2439 - Click "UPDATE" to upload the new TCA configuration
2440
2441 2) During Guilin testing, it has been noticed that there is an issue between SO and APPC for Healthcheck queries, this does not prevent the use case to proceed but limit APPC capabilities