cc940fc6072c7e796ac9032a2338bfc84f676cb9
[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 One option is to create a qcow2 image in the same directory with the
26 following characteristics:
27 * Name of the qcow2 file should be: rapidVM.qcow2
28   This default name can be overruled on the rapid command line (--image_file)
29 * Should have DPDK and PROX installed. PROX should be in /root/prox/ directory
30 * Image should have cloud-init installed
31 * /mnt/huge should exist to support a command that is executed at startup of the VM: 'mount  -t hugetlbfs nodev /mnt/huge'
32 * Compile prox with 'make crc=soft'. This is a workaround for some cases where the crc calculation offload is not working as expected.
33 * Compile dpdk to support AESN-NI Multi Buffer Crypto Poll Mode Driver: http://dpdk.org/doc/guides/cryptodevs/aesni_mb.html
34
35 Alternatively, you can create an image in OpenStack using Packer and then specify
36 the image to be used as a parameter to createrapid.py. First step is to upload an
37 existing CentOs cloud image from the internet into OpenStack.
38 Check out: https://cloud.centos.org/centos/7/images/
39 You should now source the proper .rc file so Packer can connect to your OpenStack.
40 There are 2 files: centos.json and deploycentos.sh, allowing you to create
41 an image automatically. Run
42   # packer build centos.json
43 Note that this procedure is not only installing the necessary tools to run PROX,
44 but also does some system optimizations (tuned).
45
46 Now that the image exists in OpenStack, source the openrc file of the OpenStack
47 environment so that the OpenStack CLI commands can be run:
48   # source openrc
49 Now you can run the createrapid.py file. Use help for more info on the usage:
50   # ./createrapid.py --help
51
52 createrapid.py will use the OpenStack CLI to create the flavor, key-pair, network, image,
53 servers, ...
54 It will create a <STACK>.env file containing all info that will be used by runrapid.py
55 to actually run the tests. Logging can be found in the CREATE<STACK>.log file
56 You can use floating IP addresses by specifying the floating IP network
57 --floating_network NETWORK
58 or directly connect throught the INTERNAL_NETWORK by using the following parameter:
59 --floating_network NO
60 /etc/resolv.conf will contain DNS info from the "best" interface. Since we are
61 deploying VMs with multiple interface on different networks, this info might be
62 taken from the "wrong" network (e.g. the dataplane network). It is good to provide
63 also a working DNS on that network.
64
65 Now you can run the runrapid.py file. Use help for more info on the usage:
66   # ./runrapid.py --help
67 The script will connect to all machines that have been instantiated and it will launch
68 PROX in all machines. This will be done through the admin IP assigned to the machines.
69 Once that is done it will connect to the PROX tcp socket and start sending
70 commands to run the actual test.
71 It will print test results on the screen while running.
72 The actual test that is running is described in <TEST>.test.
73
74 Notes about prox_user_data.sh script:
75 - The script contains commands that will be executed using cloud-init at
76   startup of the VMs.
77 - The script also assumes some specific DPDK directory and tools which might
78   change over different DPDK release. This release has been tested with DPDK-17.02.
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 creater needed for runrapid are:
108 * all info in the [Mx] sections
109 * the key information in the [OpenStack] section
110 * the total_number_of_vms information in the [rapid] section
111
112 [DEFAULT]
113 admin_ip = none
114
115 [M1]
116 admin_ip = 192.168.4.130
117 dp_ip = 10.10.10.6
118 dp_mac = fa:16:3e:3c:1e:12
119
120 [M2]
121 admin_ip = 192.168.4.140
122 dp_ip = 10.10.10.9
123 dp_mac = fa:16:3e:2a:00:5d
124
125 [M3]
126 admin_ip = 192.168.4.138
127 dp_ip = 10.10.10.11
128 dp_mac = fa:16:3e:ae:fa:86
129
130 [OpenStack]
131 stack = rapid
132 yaml = 3VMrapid.yaml
133 key = prox
134 flavor = prox_flavor
135 image = rapidVM
136 image_file = rapidVM.qcow2
137 dataplane_network = dataplane-network
138 subnet = dpdk-subnet
139 subnet_cidr = 10.10.10.0/24
140 internal_network = admin_internal_net
141 floating_network = admin_floating_net
142
143 [rapid]
144 loglevel = DEBUG
145 version = 17.10.25
146 total_number_of_vms = 3
147