Update yardstick framework architecture in userguide
[yardstick.git] / docs / testing / user / userguide / 12-nsb_installation.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International
2 .. License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, 2016-2017 Intel Corporation.
5
6 Yardstick - NSB Testing -Installation
7 =====================================
8
9 Abstract
10 --------
11
12 The Network Service Benchmarking (NSB) extends the yardstick framework to do
13 VNF characterization and benchmarking in three different execution
14 environments viz., bare metal i.e. native Linux environment, standalone virtual
15 environment and managed virtualized environment (e.g. Open stack etc.).
16 It also brings in the capability to interact with external traffic generators
17 both hardware & software based for triggering and validating the traffic
18 according to user defined profiles.
19
20 The steps needed to run Yardstick with NSB testing are:
21
22 * Install Yardstick (NSB Testing).
23 * Setup pod.yaml describing Test topology
24 * Create the test configuration yaml file.
25 * Run the test case.
26
27
28 Prerequisites
29 -------------
30
31 Refer chapter Yardstick Instalaltion for more information on yardstick
32 prerequisites
33
34 Several prerequisites are needed for Yardstick(VNF testing):
35
36 - Python Modules: pyzmq, pika.
37
38 - flex
39
40 - bison
41
42 - build-essential
43
44 - automake
45
46 - libtool
47
48 - librabbitmq-dev
49
50 - rabbitmq-server
51
52 - collectd
53
54 - intel-cmt-cat
55
56 Installing Yardstick on Ubuntu 14.04
57 ------------------------------------
58
59 .. _install-framework:
60
61 You can install Yardstick framework directly on Ubuntu 14.04 or in an Ubuntu
62 14.04 Docker image. No matter which way you choose to install Yardstick
63 framework, the following installation steps are identical.
64
65 If you choose to use the Ubuntu 14.04 Docker image, You can pull the Ubuntu
66 14.04 Docker image from Docker hub:
67
68 ::
69
70   docker pull ubuntu:14.04
71
72 Installing Yardstick framework
73 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74 Download source code and install Yardstick framework:
75
76 ::
77
78   git clone https://gerrit.opnfv.org/gerrit/yardstick
79   cd yardstick
80   ./nsb_setup.sh
81
82 It will also automatically download all the packages needed for NSB Testing setup.
83
84 System Topology:
85 -----------------
86
87 .. code-block:: console
88
89   +----------+              +----------+
90   |          |              |          |
91   |          | (0)----->(0) |   Ping/  |
92   |    TG1   |              |   vPE/   |
93   |          |              |   2Trex  |
94   |          | (1)<-----(1) |          |
95   +----------+              +----------+
96   trafficgen_1                   vnf
97
98
99 OpenStack parameters and credentials
100 ------------------------------------
101
102 Environment variables
103 ^^^^^^^^^^^^^^^^^^^^^
104
105 Before running Yardstick (NSB Testing) it is necessary to export traffic
106 generator libraries.
107
108 ::
109
110     source ~/.bash_profile
111
112 Config yardstick conf
113 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114
115 ::
116
117     cp ./etc/yardstick/yardstick.conf.sample /etc/yardstick/yardstick.conf
118     vi /etc/yardstick/yardstick.conf
119
120 Add trex_path and bin_path in 'nsb' section.
121
122 ::
123
124   [DEFAULT]
125   debug = True
126   dispatcher = influxdb
127
128   [dispatcher_influxdb]
129   timeout = 5
130   target = http://{YOUR_IP_HERE}:8086
131   db_name = yardstick
132   username = root
133   password = root
134
135   [nsb]
136   trex_path=/opt/nsb_bin/trex/scripts
137   bin_path=/opt/nsb_bin
138
139
140 Config pod.yaml describing Topology
141 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142
143 Before executing Yardstick test cases, make sure that pod.yaml reflects the
144 topology and update all the required fields.
145
146 ::
147
148     cp /etc/yardstick/nodes/pod.yaml.nsb.sample /etc/yardstick/nodes/pod.yaml
149
150 Config pod.yaml
151 ::
152     nodes:
153     -
154         name: trafficgen_1
155         role: TrafficGen
156         ip: 1.1.1.1
157         user: root
158         password: r00t
159         interfaces:
160             xe0:  # logical name from topology.yaml and vnfd.yaml
161                 vpci:      "0000:07:00.0"
162                 driver:    i40e # default kernel driver
163                 dpdk_port_num: 0
164                 local_ip: "152.16.100.20"
165                 netmask:   "255.255.255.0"
166                 local_mac: "00:00:00:00:00:01"
167             xe1:  # logical name from topology.yaml and vnfd.yaml
168                 vpci:      "0000:07:00.1"
169                 driver:    i40e # default kernel driver
170                 dpdk_port_num: 1
171                 local_ip: "152.16.40.20"
172                 netmask:   "255.255.255.0"
173                 local_mac: "00:00.00:00:00:02"
174
175     -
176         name: vnf
177         role: vnf
178         ip: 1.1.1.2
179         user: root
180         password: r00t
181         host: 1.1.1.2 #BM - host == ip, virtualized env - Host - compute node
182         interfaces:
183             xe0:  # logical name from topology.yaml and vnfd.yaml
184                 vpci:      "0000:07:00.0"
185                 driver:    i40e # default kernel driver
186                 dpdk_port_num: 0
187                 local_ip: "152.16.100.19"
188                 netmask:   "255.255.255.0"
189                 local_mac: "00:00:00:00:00:03"
190
191             xe1:  # logical name from topology.yaml and vnfd.yaml
192                 vpci:      "0000:07:00.1"
193                 driver:    i40e # default kernel driver
194                 dpdk_port_num: 1
195                 local_ip: "152.16.40.19"
196                 netmask:   "255.255.255.0"
197                 local_mac: "00:00:00:00:00:04"
198         routing_table:
199         - network: "152.16.100.20"
200           netmask: "255.255.255.0"
201           gateway: "152.16.100.20"
202           if: "xe0"
203         - network: "152.16.40.20"
204           netmask: "255.255.255.0"
205           gateway: "152.16.40.20"
206           if: "xe1"
207         nd_route_tbl:
208         - network: "0064:ff9b:0:0:0:0:9810:6414"
209           netmask: "112"
210           gateway: "0064:ff9b:0:0:0:0:9810:6414"
211           if: "xe0"
212         - network: "0064:ff9b:0:0:0:0:9810:2814"
213           netmask: "112"
214           gateway: "0064:ff9b:0:0:0:0:9810:2814"
215           if: "xe1"
216
217 Enable yardstick virtual environment
218 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
219
220 Before executing yardstick test cases, make sure to activate yardstick
221 python virtual environment
222
223 ::
224     source /opt/nsb_bin/yardstick_venv/bin/activate
225
226
227 Examples and verifying the install
228 ----------------------------------
229
230 It is recommended to verify that Yardstick was installed successfully
231 by executing some simple commands and test samples. Before executing yardstick
232 test cases make sure yardstick flavor and building yardstick-trusty-server
233 image can be found in glance and openrc file is sourced. Below is an example
234 invocation of yardstick help command and ping.py test sample:
235 ::
236
237   yardstick -h
238   yardstick task start samples/ping.yaml
239
240 Each testing tool supported by Yardstick has a sample configuration file.
241 These configuration files can be found in the **samples** directory.
242
243 Default location for the output is ``/tmp/yardstick.out``.
244
245
246 Run Yardstick - Network Service Testcases
247 -----------------------------------------
248
249 NS testing - using NSBperf CLI
250 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
251 ::
252
253   source /opt/nsb_setup/yardstick_venv/bin/activate
254   PYTHONPATH: ". ~/.bash_profile"
255   cd <yardstick_repo>/yardstick/cmd
256   Execute command: ./NSPerf.py -h
257       ./NSBperf.py --vnf <selected vnf> --test <rfc test>
258       eg: ./NSBperf.py --vnf vpe --test tc_baremetal_rfc2544_ipv4_1flow_64B.yaml
259
260 NS testing - using yardstick CLI
261 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
262 ::
263
264   source /opt/nsb_setup/yardstick_venv/bin/activate
265   PYTHONPATH: ". ~/.bash_profile"
266   Go to test case forlder type we want to execute.
267       e.g. <yardstick repo>/samples/vnf_samples/nsut/<vnf>/
268       run: yardstick --debug task start <test_case.yaml>