project document refactoring
[bottlenecks.git] / docs / userguide / vstf / vstf_installation.rst
1 ===================================
2 Bottlenecks VSTF Installation Guide
3 ===================================
4
5
6 VSTF Introduction
7 ====================
8 VSTF(Virtual Switch Test Framework) is a system-level testing framework in the
9 area of network virtualization, and it could help you estimate the system switch
10 ability and find out the network bottlenecks by main KPIs(bandwidth, latency,
11 resource usage and so on), VSTF owns a methodology to define the test scenario and
12 testcases, Now we could support Tu testcases in the Openstack environment, More
13 scenarios and cases will be added.
14
15 VSTF TestScenario
16 -----------------
17 1. Tu - VM to VM
18 2. Tn - Physical Nic loopback
19 3. TnV - VNF loopback
20 4. Ti - VM to Physical Nic
21
22 Pre-install Packages on the ubuntu 14.04 VM
23 ===========================================
24 VSTF VM Preparation Steps
25 -------------------------
26 1. Create a ubuntu 14.04 VM
27 2. Install dependency inside VM
28 3. Install vstf python package inside VM
29
30 VM preparation
31 --------------
32 Install python2.7 version and git
33
34 ::
35
36   sudo apt-get install python2.7
37   sudo apt-get install git
38
39 Download Bottlenecks package
40
41 ::
42
43   sudo cd /home/
44   sudo git clone https://gerrit.opnfv.org/gerrit/bottlenecks
45
46 Install the dependency
47
48 ::
49
50   sudo apt-get install python-pip
51   sudo pip install --upgrade pip
52   sudo dpkg-reconfigure dash
53   sudo apt-get install libjpeg-dev
54   sudo apt-get install libpng-dev
55   sudo apt-get install python-dev
56   sudo apt-get install python-testrepository
57   sudo apt-get install git
58   sudo apt-get install python-pika
59   sudo apt-get install python-oslo.config
60   sudo pip install -r /home/bottlenecks/vstf/requirements.txt
61
62 Install vstf package
63
64 ::
65
66   sudo mkdir -p /var/log/vstf/
67   sudo cp -r /home/bottlenecks/vstf/etc/vstf/ /etc/
68   sudo mkdir -p /opt/vstf/
69   sudo cd /home/bottlenecks;sudo rm -rf build/
70   sudo python setup.py install
71
72 Image on the Cloud
73 ------------------
74 +-----------+-------------------------------------------------------------+
75 |    Name   | vstf-image                                                  |
76 +===========+=============================================================+
77 |    URL    | http://artifacts.opnfv.org/bottlenecks/vstf-manager-new.img |
78 +-----------+-------------------------------------------------------------+
79 |   Format  | QCOW2                                                       |
80 +-----------+-------------------------------------------------------------+
81 |    Size   | 5G                                                          |
82 +-----------+-------------------------------------------------------------+
83 |    User   | root                                                        |
84 +-----------+-------------------------------------------------------------+
85 |   Passwd  | root                                                        |
86 +-----------+-------------------------------------------------------------+
87 There is a complete vstf image on the cloud ,you could download it and use it to
88 deploy and run cases ,but do not need VM preparation steps.
89
90
91 How is VSTF Integrated into Installers
92 ========================================
93 VM requirements
94 ---------------
95 +------------------+----------+--------------------+-----------------------------------------------------+
96 |        Name      |  FLAVOR  |     IMAGE_NAME     | NETWORK                                             |
97 +==================+==========+====================+=====================================================+
98 |   vstf-manager   | m1.large |     vstf-image     | control-plane=XX.XX.XX.XX                           |
99 +------------------+----------+--------------------+-----------------------------------------------------+
100 |   vstf-tester    | m1.large |     vstf-image     | control-plane(eth0)=XX.XX.XX.XX                     |
101 |                  |          |                    | test-plane(eth1)=XX.XX.XX.XX                        |
102 +------------------+----------+--------------------+-----------------------------------------------------+
103 |   vstf-target    | m1.large |     vstf-image     | control-plane(eth0)=XX.XX.XX.XX                     |
104 |                  |          |                    | test-plane(eth1)=XX.XX.XX.XX                        |
105 +------------------+----------+--------------------+-----------------------------------------------------+
106 m1.large means 4U4G for the target image Size 5GB
107 For the network used by VMs,network need two plane ,one plane is control plane and the other plane is test plane.
108
109 OPNFV community Usage in the CI system
110 --------------------------------------
111 +---------------------------------------+---------------------------------------+
112 | Project Name                          | Project Categoty                      |
113 +=======================================+=======================================+
114 | bottlenecks-daily-fuel-vstf-lf-master | bottlenecks                           |
115 +---------------------------------------+---------------------------------------+
116 OPNFV community jenkins Project info
117
118 Main Entrance for the ci test:
119
120 ::
121
122   cd /home/bottlenecks/ci;
123   bash -x vstf_run.sh
124
125 Test on local(Openstack Environment)
126 ------------------------------------
127 download the image file
128
129 ::
130
131   curl --connect-timeout 10 -o /tmp/vstf-manager.img \
132        http://artifacts.opnfv.org/bottlenecks/vstf-manager-new.img -v
133
134 create the image file by the glance
135
136 ::
137
138   glance image-create --name $MANAGER_IMAGE_NAME \
139         --disk-format qcow2 \
140         --container-format bare \
141         --file /tmp/vstf-manager.img
142
143 create the keypair for the image(anyone will be ok)
144
145 ::
146
147   cd /home/bottlenecks/utils/infra_setup/bottlenecks_key
148   nova keypair-add --pub_key $KEY_PATH/bottlenecks_key.pub $KEY_NAME
149
150 create the vstf three VMs in the openstack by heat
151
152 ::
153
154   cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
155   heat stack-create vstf -f bottleneck_vstf.yaml
156
157 launch the vstf process inside the vstf-manager vstf-tester vstf-target VMs
158
159 ::
160
161   cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
162   bash -x launch_vstf.sh
163
164 edit the test scenario and test packet list in the vstf_test.sh, now support the Tu-1/2/3
165
166 ::
167
168   function fn_testing_scenario(){
169       ...
170       local test_length_list="64 128 256 512 1024"
171       local test_scenario_list="Tu-1 Tu-3"
172       ...
173   }
174
175 launch the vstf script
176
177 ::
178
179   cd /home/bottlenecks/utils/infra_setup/heat_template/vstf_heat_template
180   bash -x vstf_test.sh
181
182 Test Result Description
183 =======================
184 Result Format
185 -------------
186 For example after the test, The result will display as the following format
187
188 ::
189
190   { u'64': { u'AverageLatency': 0.063,
191              u'Bandwidth': 0.239,
192              u'CPU': 0.0,
193              u'Duration': 20,
194              u'MaximumLatency': 0.063,
195              u'MinimumLatency': 0.063,
196              u'MppspGhz': 0,
197              u'OfferedLoad': 100.0,
198              u'PercentLoss': 22.42,
199              u'RxFrameCount': 4309750.0,
200              u'RxMbps': 198.28,
201              u'TxFrameCount': 5555436.0,
202              u'TxMbps': 230.03}}
203
204 Option Description
205 ------------------
206 +---------------------+---------------------------------------------------+
207 |     Option Name     |                 Description                       |
208 +=====================+===================================================+
209 |    AverageLatency   | The average latency data during the packet        |
210 |                     | transmission (Unit:microsecond)                   |
211 +---------------------+---------------------------------------------------+
212 |      Bandwidth      | Network bandwidth(Unit:Million packets per second)|
213 +---------------------+---------------------------------------------------+
214 |         CPU         | Total Resource Cpu usage(Unit: Ghz)               |
215 +---------------------+---------------------------------------------------+
216 |      Duration       | Test time(Unit: second)                           |
217 +---------------------+---------------------------------------------------+
218 |   MaximumLatency    | The maximum packet latency during the packet      |
219 |                     | transmission (Unit:microsecond)                   |
220 +---------------------+---------------------------------------------------+
221 |   MinimumLatency    | The maximum packet latency during the packet      |
222 |                     | transmission (Unit:microsecond)                   |
223 +---------------------+---------------------------------------------------+
224 |      MppspGhz       | Million Packets per second with per CPU           |
225 |                     | resource Ghz(Unit: Mpps/Ghz)                      |
226 +---------------------+---------------------------------------------------+
227 |    OfferedLoad      | The load of network offered                       |
228 +---------------------+---------------------------------------------------+
229 |    PercentLoss      | The percent of frame loss rate                    |
230 +---------------------+---------------------------------------------------+
231 |    RxFrameCount     | The total frame on Nic rx                         |
232 +---------------------+---------------------------------------------------+
233 |       RxMbps        | The received bandwidth per second                 |
234 +---------------------+---------------------------------------------------+
235 |    TxFrameCount     | The total frame on Nic rx                         |
236 +---------------------+---------------------------------------------------+
237 |       TxMbps        | The send bandwidth per second                     |
238 +---------------------+---------------------------------------------------+