Test improvements and fixes for image creation
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / openstackrapid / README
1 ##
2 ## Copyright (c) 2010-2017 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 environment.
22
23 Copy the files in a directory on a machine that can run the OpenStack CLI
24 commands and that can reach the OpenStack public network.
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 deploycentos1.sh
29 and deploycentos2.sh file.
30 The default name of the qcow2 file should is rapidVM.qcow2
31
32 When using the packer tool, the first step is to upload an
33 existing CentOs cloud image from the internet into OpenStack.
34 Check out: https://cloud.centos.org/centos/7/images/
35 You should now source the proper .rc file so Packer can connect to your OpenStack.
36 There are 3 files: centos.json, deploycentos1.sh and deploycentos2.sh, allowing you to create
37 an image automatically. Run
38   # packer build centos.json
39 Note that this procedure is not only installing the necessary tools to run PROX,
40 but also does some system optimizations (tuned).
41
42 Now that the image exists in OpenStack, source the openrc file of the OpenStack
43 environment so that the OpenStack CLI commands can be run:
44   # source openrc
45 Now you can run the createrapid.py file. Use help for more info on the usage:
46   # ./createrapid.py --help
47
48 createrapid.py will use the OpenStack CLI to create the flavor, key-pair, network, image,
49 servers, ...
50 It will create a <STACK>.env file containing all info that will be used by runrapid.py
51 to actually run the tests. Logging can be found in the CREATE<STACK>.log file
52 You can use floating IP addresses by specifying the floating IP network
53 --floating_network NETWORK
54 or directly connect throught the INTERNAL_NETWORK by using the following parameter:
55 --floating_network NO
56 /etc/resolv.conf will contain DNS info from the "best" interface. Since we are
57 deploying VMs with multiple interface on different networks, this info might be
58 taken from the "wrong" network (e.g. the dataplane network). It is good to provide
59 also a working DNS on that network.
60
61 Now you can run the runrapid.py file. Use help for more info on the usage:
62   # ./runrapid.py --help
63 The script will connect to all machines that have been instantiated and it will launch
64 PROX in all machines. This will be done through the admin IP assigned to the machines.
65 Once that is done it will connect to the PROX tcp socket and start sending
66 commands to run the actual test.
67 It will print test results on the screen while running.
68 The actual test that is running is described in <TEST>.test.
69
70 Notes about prox_user_data.sh script:
71 - The script contains commands that will be executed using cloud-init at
72   startup of the VMs.
73 - The script also assumes some specific DPDK directory and tools which might
74   change over different DPDK release. This release has been tested with DPDK-17.02.
75 - huge pages are allocated for DPDK on node 0 (hard-coded) in the VM.
76
77 Note on using SRIOV ports:
78 Before running createrapid, make sure the network, subnet and ports are already created
79 This can be done as follows (change the parameters to your needs):
80 openstack network create --share --external --provider-network-type flat --provider-physical-network physnet2 fast-network
81 openstack subnet create --network  fast-network  --subnet-range 20.20.20.0/24 --gateway none fast-subnet
82 openstack port create --network fast-network --vnic-type direct --fixed-ip subnet=fast-subnet Port1
83 openstack port create --network fast-network --vnic-type direct --fixed-ip subnet=fast-subnet Port2
84 openstack port create --network fast-network --vnic-type direct --fixed-ip subnet=fast-subnet Port3
85 Make sure to use the network and subnet in the createrapid parameters list. Port1, Port2 and Port3
86 are being used in the *.env file.
87
88 Note when doing tests using the gateway functionality on OVS:
89 When a GW VM is sending packets on behalf of another VM (e.g. the generator), we need to make sure the OVS
90 will allow those packets to go through. Therefore you need to the IP address of the generator in the
91 "allowed address pairs" of the GW VM.
92
93 Note when doing tests using encryption on OVS:
94 Your OVS configuration might block encrypted packets. To allow packets to go through,
95 you can disable port_security. You can do this by using the following commands
96 neutron port-update xxxxxx --no-security-groups
97 neutron port-update xxxxxx --port_security_enabled=False
98
99 An example of the env file generated by createrapid.py can be found below.
100 Note that this file can be created manually in case the stack is created in a
101 different way (not using the createrapid.py). This can be useful in case you are
102 not using OpenStack as a VIM or when using special configurations that cannot be
103 achieved using creater needed for runrapid are:
104 * all info in the [Mx] sections
105 * the key information in the [OpenStack] section
106 * the total_number_of_vms information in the [rapid] section
107
108 [DEFAULT]
109 admin_ip = none
110
111 [M1]
112 admin_ip = 192.168.4.130
113 dp_ip = 10.10.10.6
114 dp_mac = fa:16:3e:3c:1e:12
115
116 [M2]
117 admin_ip = 192.168.4.140
118 dp_ip = 10.10.10.9
119 dp_mac = fa:16:3e:2a:00:5d
120
121 [M3]
122 admin_ip = 192.168.4.138
123 dp_ip = 10.10.10.11
124 dp_mac = fa:16:3e:ae:fa:86
125
126 [OpenStack]
127 stack = rapid
128 yaml = 3VMrapid.yaml
129 key = prox
130 flavor = prox_flavor
131 image = rapidVM
132 image_file = rapidVM.qcow2
133 dataplane_network = dataplane-network
134 subnet = dpdk-subnet
135 subnet_cidr = 10.10.10.0/24
136 internal_network = admin_internal_net
137 floating_network = admin_floating_net
138
139 [rapid]
140 loglevel = DEBUG
141 version = 17.10.25
142 total_number_of_vms = 3
143