Merge changes from topic 'june_release'
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / rapid / README
1 ##
2 ## Copyright (c) 2010-2019 Intel Corporation
3 ##
4 ## Licensed under the Apache License, Version 2.0 (the "License");
5 ## you may not use this file except in compliance with the License.
6 ## You may obtain a copy of the License at
7 ##
8 ##     http://www.apache.org/licenses/LICENSE-2.0
9 ##
10 ## Unless required by applicable law or agreed to in writing, software
11 ## distributed under the License is distributed on an "AS IS" BASIS,
12 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ## See the License for the specific language governing permissions and
14 ## limitations under the License.
15 ##
16
17 rapid (Rapid Automated Performance Indication for Dataplane)
18 ************************************************************
19
20 rapid is a set of files offering an easy way to do a sanity check of the
21 dataplane performance of an OpenStack or container environment.
22
23 In case of OpenStack, copy the files in a directory on a machine that can run the OpenStack CLI
24 commands and that can reach the networks to connect to the VMs.
25
26 You will need an image that has the PROX tool installed.
27 A good way to do this is to use the packer tool to build an image for a target of your choice.
28 You can also build this image manually by executing all the commands described in the deploycentostools.sh.
29 The default name of the qcow2 file is rapidVM.qcow2
30
31 When using the packer tool, the first step is to upload an
32 existing CentOS cloud image from the internet into OpenStack.
33 Check out: https://cloud.centos.org/centos/7/images/
34 You should now source the proper .rc file so Packer can connect to your OpenStack.
35 There are 2 files: centos.json and deploycentostools.sh, allowing you to create
36 an image automatically. Run
37   # packer build centos.json
38 Edit centos.json to reflect the settings of your environment: The following fields need to
39 be the ID's of your system:
40   - "source_image": Needs to be the id of the Centos cloud image
41   - "flavor": Needs to be the ID of the flavor existing in your OpenStack environment that will be used
42     to start the VM in which we will install all tools
43   - "networks": ID of the network that will be used for the VM
44   - "use_floating_ip": true or false
45   - "floating_ip_pool": ID of the floating ip pool in case floating ip are being used
46   - "security_groups": ID of the security group being used
47
48 Note that this procedure is not only installing the necessary tools to run PROX,
49 but also does some system optimizations (tuned). Check deploycentostools.sh for more details.
50
51 Now you can run the createrapid.py file. Use help for more info on the usage:
52   # ./createrapid.py --help
53
54 createrapid.py will use the OpenStack CLI to create the flavor, key-pair, network, image,
55 servers, ...
56 It will create a <STACK>.env file containing all info that will be used by runrapid.py
57 to actually run the tests. Logging can be found in the CREATE<STACK>.log file
58 You can use floating IP addresses by specifying the floating IP network
59 --floating_network NETWORK
60 or directly connect through the INTERNAL_NETWORK by using the following parameter:
61 --floating_network NO
62 /etc/resolv.conf will contain DNS info from the "best" interface. Since we are
63 deploying VMs with multiple interface on different networks, this info might be
64 taken from the "wrong" network (e.g. the dataplane network).
65
66 Now you can run the runrapid.py file. Use help for more info on the usage:
67   # ./runrapid.py --help
68 The script will connect to all machines that have been instantiated and it will launch
69 PROX in all machines. This will be done through the admin IP assigned to the machines.
70 Once that is done it will connect to the PROX tcp socket and start sending
71 commands to run the actual test.
72 Make sure the security groups allow for tcp access (ssh & prox port).
73 It will print test results on the screen while running.
74 The actual test that is running is described in <TEST>.test.
75
76 Notes about prox_user_data.sh script:
77 - The script contains commands that will be executed using cloud-init at
78   startup of the VMs.
79 - huge pages are allocated for DPDK on node 0 (hard-coded) in the VM.
80
81 Note on using SRIOV ports:
82 Before running createrapid, make sure the network, subnet and ports are already created
83 This can be done as follows (change the parameters to your needs):
84 openstack network create --share --external --provider-network-type flat --provider-physical-network physnet2 fast-network
85 openstack subnet create --network  fast-network  --subnet-range 20.20.20.0/24 --gateway none fast-subnet
86 openstack port create --network fast-network --vnic-type direct --fixed-ip subnet=fast-subnet Port1
87 openstack port create --network fast-network --vnic-type direct --fixed-ip subnet=fast-subnet Port2
88 openstack port create --network fast-network --vnic-type direct --fixed-ip subnet=fast-subnet Port3
89 Make sure to use the network and subnet in the createrapid parameters list. Port1, Port2 and Port3
90 are being used in the *.env file.
91
92 Note when doing tests using the gateway functionality on OVS:
93 When a GW VM is sending packets on behalf of another VM (e.g. the generator), we need to make sure the OVS
94 will allow those packets to go through. Therefore you need to the IP address of the generator in the
95 "allowed address pairs" of the GW VM.
96
97 Note when doing tests using encryption on OVS:
98 Your OVS configuration might block encrypted packets. To allow packets to go through,
99 you can disable port_security. You can do this by using the following commands
100 neutron port-update xxxxxx --no-security-groups
101 neutron port-update xxxxxx --port_security_enabled=False
102
103 An example of the env file generated by createrapid.py can be found below.
104 Note that this file can be created manually in case the stack is created in a
105 different way (not using the createrapid.py). This can be useful in case you are
106 not using OpenStack as a VIM or when using special configurations that cannot be
107 achieved using createrapid.py. Fields needed for runrapid are:
108 * all info in the [Mx] sections
109 * the key information in the [ssh] section
110 * the total_number_of_vms information in the [rapid] section
111
112 [rapid]
113 loglevel = DEBUG
114 version = 19.6.30
115 total_number_of_machines = 3
116
117 [M1]
118 name = rapid-VM1
119 admin_ip = 10.25.1.109
120 dp_ip = 10.10.10.4
121 dp_mac = fa:16:3e:25:be:25
122
123 [M2]
124 name = rapid-VM2
125 admin_ip = 10.25.1.110
126 dp_ip = 10.10.10.7
127 dp_mac = fa:16:3e:72:bf:e8
128
129 [M3]
130 name = rapid-VM3
131 admin_ip = 10.25.1.125
132 dp_ip = 10.10.10.15
133 dp_mac = fa:16:3e:69:f3:e7
134
135 [ssh]
136 key = prox
137
138 [Varia]
139 vim = OpenStack
140 stack = rapid
141 vms = rapidVMs.vms
142 image = rapidVM
143 image_file = rapidVM.qcow2
144 dataplane_network = dataplane-network
145 subnet = dpdk-subnet
146 subnet_cidr = 10.10.10.0/24
147 internal_network = admin_internal_net
148 floating_network = admin_floating_net