helenc878 | a794a8e | 2018-11-28 21:01:55 -0800 | [diff] [blame] | 1 | .. _docs_vlb: |
| 2 | |
Marco Platania | 75281da | 2018-11-28 15:33:47 -0500 | [diff] [blame] | 3 | vLoadBalancer Use Case |
| 4 | ---------------------- |
| 5 | |
| 6 | Source files |
| 7 | ~~~~~~~~~~~~ |
| 8 | |
| 9 | - Base VNF template file: https://git.onap.org/demo/plain/heat/vLB/base_vlb.yaml |
| 10 | - Base VNF environment file: https://git.onap.org/demo/plain/heat/vLB/base_vlb.env |
| 11 | |
| 12 | - VF module scaling template file: https://git.onap.org/demo/plain/heat/vLB/dnsscaling.yaml |
| 13 | - VF module scaling environment file: https://git.onap.org/demo/plain/heat/vLB/dnsscaling.env |
| 14 | |
| 15 | |
| 16 | Description |
| 17 | ~~~~~~~~~~~ |
| 18 | The use case is composed of three VFs: packet generator, load balancer, and DNS server. These VFs run in three separate VMs. The packet generator issues DNS lookup queries that reach the DNS server via the load balancer. DNS replies reach the packet generator via the load balancer as well. The load balancer reports the average amount of traffic per DNS over a time interval to the DCAE collector. When the average amount of traffic per DNS server crosses a predefined threshold, the closed-loop is triggered and a new DNS server is instantiated. |
| 19 | |
| 20 | To test the application, make sure that the security group in OpenStack has ingress/egress entries for protocol 47 (GRE). The user can run a DNS query from the packet generator VM: |
| 21 | |
| 22 | :: |
| 23 | |
| 24 | dig @vLoadBalancer_IP host1.dnsdemo.onap.org |
| 25 | |
| 26 | The output below means that the load balancer has been set up correctly, has forwarded the DNS queries to one DNS instance, and the packet generator has received the DNS reply message. |
| 27 | |
| 28 | :: |
| 29 | |
| 30 | ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @192.168.9.111 host1.dnsdemo.onap.org |
| 31 | ; (1 server found) |
| 32 | ;; global options: +cmd |
| 33 | ;; Got answer: |
| 34 | ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31892 |
| 35 | ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2 |
| 36 | ;; WARNING: recursion requested but not available |
| 37 | |
| 38 | ;; OPT PSEUDOSECTION: |
| 39 | ; EDNS: version: 0, flags:; udp: 4096 |
| 40 | ;; QUESTION SECTION: |
| 41 | ;host1.dnsdemo.onap.org. IN A |
| 42 | |
| 43 | ;; ANSWER SECTION: |
| 44 | host1.dnsdemo.onap.org. 604800 IN A 10.0.100.101 |
| 45 | |
| 46 | ;; AUTHORITY SECTION: |
| 47 | dnsdemo.onap.org. 604800 IN NS dnsdemo.onap.org. |
| 48 | |
| 49 | ;; ADDITIONAL SECTION: |
| 50 | dnsdemo.onap.org. 604800 IN A 10.0.100.100 |
| 51 | |
| 52 | ;; Query time: 0 msec |
| 53 | ;; SERVER: 192.168.9.111#53(192.168.9.111) |
| 54 | ;; WHEN: Fri Nov 10 17:39:12 UTC 2017 |
| 55 | ;; MSG SIZE rcvd: 97 |
| 56 | |
| 57 | |
| 58 | Closedloop for vLoadBalancer/vDNS |
| 59 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 60 | |
| 61 | Through the Policy Portal (accessible via the ONAP Portal), we can find the configuration and operation policies that are enabled by default for the vLoadBalancer/vDNS application: |
| 62 | |
| 63 | - The configuration policy sets the thresholds for generating an onset event from DCAE to the Policy engine. Currently, the threshold is set to 200 packets, while the measurement interval is set to 10 seconds; |
| 64 | - Once the threshold is crossed (e.g. the number of received packets is above 200 packets per 10 seconds), the Policy Engine executes the operational policy. The Policy engine queries A&AI to fetch the VNF UUID and sends a request to the Service Orchestrator (SO) to spin up a new DNS instance for the VNF identified by that UUID; |
| 65 | - SO spins up a new DNS instance. |
| 66 | |
| 67 | |
| 68 | To change the volume of queries generated by the packet generator, run the following command in a shell, replacing PacketGen_IP in the HTTP argument with localhost (if you run it in the packet generator VM) or the packet generator IP address: |
| 69 | |
| 70 | :: |
| 71 | |
| 72 | |
| 73 | curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"pg-streams":{"pg-stream": [{"id":"dns1", "is-enabled":"true"}]}}' "http://PacketGen_IP:8183/restconf/config/sample-plugin:sample-plugin/pg-streams" |
| 74 | |
| 75 | - {"id":"dns1", "is-enabled":"true"} shows the stream "dns1" is enabled. The packet generator sends requests in the rate of 100 packets per 10 seconds; |
| 76 | - To increase the amount of traffic, you can enable more streams. The packet generator has 10 streams, "dns1", "dns2", "dns3" to "dns10". Each of them generates 100 packets per 10 seconds. To enable the streams, please add {"id":"dnsX", "is-enabled":"true"} to the pg-stream bracket of the curl command, where X is the stream ID. |
| 77 | |
| 78 | For example, if you want to enable 3 streams, the curl command will be: |
| 79 | |
| 80 | :: |
| 81 | |
| 82 | curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"pg-streams":{"pg-stream": [{"id":"dns1", "is-enabled":"true"}, {"id":"dns2", "is-enabled":"true"},{"id":"dns3", "is-enabled":"true"}]}}' "http://PacketGen_IP:8183/restconf/config/sample-plugin:sample-plugin/pg-streams" |
| 83 | |
| 84 | When the VNF starts, the packet generator is automatically configured to run 5 streams. |
| 85 | |
| 86 | |
| 87 | Running the Use Case |
| 88 | ~~~~~~~~~~~~~~~~~~~~ |
| 89 | Automated closed loop via Robot Framework is not supported at this time. For documentation about running the use case manually for previous releases, please look at the videos and the material available at this `wiki page`__. |
| 90 | |
| 91 | __ https://wiki.onap.org/display/DW/Running+the+ONAP+Demos |
| 92 | |
| 93 | Although videos are still valid, users are encouraged to use the Heat templates linked at the top of this page rather than the old Heat templates in that wiki page. |
| 94 | |
| 95 | Known issues and resolution |
| 96 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 97 | 1) The packet generator may become unresponsive and stop generating traffic. To solve the problem, reboot the packet generator. |
| 98 | |
| 99 | 2) The base and scaling VF module names need to follow a specific naming convention: |
| 100 | |
| 101 | a) The base VF module name must be "Vfmodule\_xyz" |
| 102 | |
| 103 | b) The SDNC preload for the scaling VF module must set the VF module name to "vDNS\_xyz", where "xyz" is the same as the base module. This is required because during closed loop Policy looks for "Vfmodule\_" and replaces it with "vDNS\_" |
| 104 | |
| 105 | 3) Only one scaling operation is supported. |