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