This patch is used to update the documents of D-release.
[kvmfornfv.git] / docs / scenarios / kvmfornfv.scenarios.description.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2
3 .. http://creativecommons.org/licenses/by/4.0
4
5 ========================
6 KVM4NFV SCENARIO-TESTING
7 ========================
8
9 ABSTRACT
10 --------
11
12 This document describes the procedure to deploy/test KVM4NFV scenarios in a nested virtualization
13 environment. This has been verified with os-nosdn-kvm-ha, os-nosdn-kvm-noha,os-nosdn-kvm_ovs_dpdk-ha,
14 os-nosdn-kvm_ovs_dpdk-noha and os-nosdn-kvm_ovs_dpdk_bar-ha test scenarios.
15
16 Version Features
17 ----------------
18
19 +-----------------------------+---------------------------------------------+
20 |                             |                                             |
21 |      **Release**            |               **Features**                  |
22 |                             |                                             |
23 +=============================+=============================================+
24 |                             | - Scenario Testing feature was not part of  |
25 |       Colorado              |   the Colorado release of KVMFORNFV         |
26 |                             |                                             |
27 +-----------------------------+---------------------------------------------+
28 |                             | - High Availability/No-High Availability    |
29 |                             |   deployment configuration of KVMFORNFV     |
30 |                             |   software suite                            |
31 |        Danube               | - Multi-node setup with 3 controller and    |
32 |                             |   2 compute nodes are deployed for HA       |
33 |                             | - Multi-node setup with 1 controller and    |
34 |                             |   3 compute nodes are deployed for NO-HA    |
35 |                             | - Scenarios os-nosdn-kvm_ovs_dpdk-ha,       |
36 |                             |   os-nosdn-kvm_ovs_dpdk_bar-ha,             |
37 |                             |   os-nosdn-kvm_ovs_dpdk-noha,               |
38 |                             |   os-nosdn-kvm_ovs_dpdk_bar-noha            |
39 |                             |   are supported                             |
40 +-----------------------------+---------------------------------------------+
41
42
43 INTRODUCTION
44 ------------
45 The purpose of os-nosdn-kvm_ovs_dpdk-ha,os-nosdn-kvm_ovs_dpdk_bar-ha and
46 os-nosdn-kvm_ovs_dpdk-noha,os-nosdn-kvm_ovs_dpdk_bar-noha scenarios testing is to
47 test the High Availability/No-High Availability deployment and configuration of
48 OPNFV software suite with OpenStack and without SDN software.
49
50 This OPNFV software suite includes OPNFV KVMFORNFV latest software packages
51 for Linux Kernel and QEMU patches for achieving low latency and also OPNFV Barometer for traffic,
52 performance and platform monitoring.
53
54 High Availability feature is achieved by deploying OpenStack
55 multi-node setup with 1 Fuel-Master,3 controllers and 2 computes nodes.
56
57 No-High Availability feature is achieved by deploying OpenStack
58 multi-node setup with 1 Fuel-Master,1 controllers and 3 computes nodes.
59
60 KVMFORNFV packages will be installed on compute nodes as part of deployment.
61 The scenario testcase deploys a multi-node setup by using OPNFV Fuel deployer.
62
63 1. System pre-requisites
64 ------------------------
65
66 - RAM - Minimum 16GB
67 - HARD DISK - Minimum 500GB
68 - Linux OS installed and running
69 - Nested Virtualization enabled, which can be checked by,
70
71 .. code:: bash
72
73         $ cat /sys/module/kvm_intel/parameters/nested
74           Y
75
76         $ cat /proc/cpuinfo | grep vmx
77
78 *Note:*
79 If Nested virtualization is disabled, enable it by,
80
81 .. code:: bash
82
83      For Ubuntu:
84      $ modeprobe kvm_intel
85      $ echo Y > /sys/module/kvm_intel/parameters/nested
86      $ sudo reboot
87
88      For RHEL:
89      $ cat << EOF > /etc/modprobe.d/kvm_intel.conf
90        options kvm-intel nested=1
91        options kvm-intel enable_shadow_vmcs=1
92        options kvm-intel enable_apicv=1
93        options kvm-intel ept=1
94        EOF
95      $ cat << EOF > /etc/sysctl.d/98-rp-filter.conf
96        net.ipv4.conf.default.rp_filter = 0
97        net.ipv4.conf.all.rp_filter = 0
98        EOF
99      $ sudo reboot
100
101 2. Environment Setup
102 --------------------
103
104 **2.1  Configuring Proxy**
105 ~~~~~~~~~~~~~~~~~~~~~~~~~~
106
107 For **Ubuntu**.,
108 Create an apt.conf file in /etc/apt if it doesn't exist. Used to set proxy for apt-get if working behind a proxy server.
109
110 .. code:: bash
111
112    Acquire::http::proxy "http://<username>:<password>@<proxy>:<port>/";
113    Acquire::https::proxy "https://<username>:<password>@<proxy>:<port>/";
114    Acquire::ftp::proxy "ftp://<username>:<password>@<proxy>:<port>/";
115    Acquire::socks::proxy "socks://<username>:<password>@<proxy>:<port>/";
116
117 For **CentOS**.,
118 Edit /etc/yum.conf to work behind a proxy server by adding the below line.
119
120 .. code:: bash
121
122    $ echo "proxy=http://<username>:<password>@<proxy>:<port>/" >> /etc/yum.conf
123
124 **2.2 Network Time Protocol (NTP) setup and configuration**
125 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126
127 Install ntp by:
128
129 .. code:: bash
130
131     $ sudo apt-get update
132     $ sudo apt-get install -y ntp
133
134 Insert the following two lines after  “server ntp.ubuntu.com” line and before “ # Access control configuration; see `link`_ for” line in /etc/ntp.conf file:
135
136 .. _link: /usr/share/doc/ntp-doc/html/accopt.html
137
138 .. code:: bash
139
140    server 127.127.1.0
141    fudge 127.127.1.0 stratum 10
142
143 Restart the ntp server to apply the changes
144
145 .. code:: bash
146
147     $ sudo service ntp restart
148
149 3. Scenario Testing
150 -------------------
151
152 There are three ways of performing scenario testing,
153     - 3.1 Fuel
154     - 3.2 OPNFV-Playground
155     - 3.3 Jenkins Project
156
157 3.1 Fuel
158 ~~~~~~~~
159
160 **3.1.1 Clone the fuel repo :**
161
162 .. code:: bash
163
164    $ git clone https://gerrit.opnfv.org/gerrit/fuel.git
165
166 **3.1.2 Checkout to the specific version of the branch to deploy by:**
167
168 The default branch is master, to use a stable release-version use the below.,
169
170 .. code:: bash
171     To check the current branch
172     $ git branch
173
174     To check out a specific branch
175     $ git checkout stable/Colorado
176
177 **3.1.3  Building the Fuel iso :**
178
179 .. code:: bash
180
181               $ cd ~/fuel/ci/
182               $ ./build.sh -h
183
184 Provide the necessary options that are required to build an iso.
185 Create a ``customized iso`` as per the deployment needs.
186
187 .. code:: bash
188
189               $ cd ~/fuel/build/
190               $ make
191
192 (OR) Other way is to download the latest stable fuel iso from `here`_.
193
194 .. _here: http://artifacts.opnfv.org/fuel.html
195
196 .. code:: bash
197
198    http://artifacts.opnfv.org/fuel.html
199
200 **3.1.4 Creating a new deployment scenario**
201
202 ``(i). Naming the scenario file:``
203
204 Include the new deployment scenario yaml file in ~/fuel/deploy/scenario/. The file name should adhere to the following format:
205
206 .. code:: bash
207
208     <ha | no-ha>_<SDN Controller>_<feature-1>_..._<feature-n>.yaml
209
210 ``(ii). Meta data``
211 The deployment configuration file should contain configuration metadata as stated below:
212
213 .. code:: bash
214
215               deployment-scenario-metadata:
216                       title:
217                       version:
218                       created:
219
220 ``(iii). “stack-extentions” Module``
221  To include fuel plugins in the deployment configuration file, use the “stack-extentions” key:
222
223 .. code:: bash
224
225              Example:
226                      stack-extensions:
227                         - module: fuel-plugin-collectd-ceilometer
228                           module-config-name: fuel-barometer
229                           module-config-version: 1.0.0
230                           module-config-override:
231                           #module-config overrides
232
233 **Note:**
234 The “module-config-name” and “module-config-version” should be same as the name of plugin configuration file.
235
236 The “module-config-override” is used to configure the plugin by overrriding the corresponding keys in the plugin config yaml file present in ~/fuel/deploy/config/plugins/.
237
238 ``(iv).  “dea-override-config” Module``
239 To configure the HA/No-HA mode, network segmentation types and role to node assignments, use the “dea-override-config” key.
240
241 .. code:: bash
242
243         Example:
244         dea-override-config:
245                environment:
246                    mode: ha
247                    net_segment_type: tun
248                nodes:
249                - id: 1
250                   interfaces: interfaces_1
251                   role: mongo,controller,opendaylight
252                - id: 2
253                  interfaces: interfaces_1
254                  role: mongo,controller
255                - id: 3
256                   interfaces: interfaces_1
257                   role: mongo,controller
258                - id: 4
259                   interfaces: interfaces_1
260                   role: ceph-osd,compute
261                - id: 5
262                   interfaces: interfaces_1
263                   role: ceph-osd,compute
264         settings:
265             editable:
266                 storage:
267                      ephemeral_ceph:
268                               description: Configures Nova to store ephemeral volumes in RBD. This works best if Ceph is enabled for volumes and images, too. Enables live migration of all types of Ceph backed VMs (without this option, live migration will only work with VMs launched from Cinder volumes).
269                               label: Ceph RBD for ephemeral volumes (Nova)
270                               type: checkbox
271                               value: true
272                               weight: 75
273                      images_ceph:
274                               description: Configures Glance to use the Ceph RBD backend to store images.If enabled, this option will prevent Swift from installing.
275                               label: Ceph RBD for images (Glance)
276                               restrictions:
277                               - settings:storage.images_vcenter.value == true: Only one Glance backend could be selected.
278                               type: checkbox
279                               value: true
280                               weight: 30
281
282 Under the “dea-override-config” should provide atleast {environment:{mode:'value},{net_segment_type:'value'}
283 and {nodes:1,2,...} and can also enable additional stack features such ceph,heat which overrides
284 corresponding keys in the dea_base.yaml and dea_pod_override.yaml.
285
286 ``(v). “dha-override-config”  Module``
287 In order to configure the pod dha definition, use the “dha-override-config” key.
288 This is an optional key present at the ending of the scenario file.
289
290 ``(vi). Mapping to short scenario name``
291 The scenario.yaml file is used to map the short names of scenario's to the one or more deployment scenario configuration yaml files.
292 The short scenario names should follow the scheme below:
293
294 .. code:: bash
295
296                [os]-[controller]-[feature]-[mode]-[option]
297
298         [os]: mandatory
299         possible value: os
300
301 Please note that this field is needed in order to select parent jobs to list and do blocking relations between them.
302
303 .. code:: bash
304
305
306     [controller]: mandatory
307     example values: nosdn, ocl, odl, onos
308
309     [mode]: mandatory
310     possible values: ha, noha
311
312     [option]: optional
313
314 Used for the scenarios those do not fit into naming scheme.
315 Optional field in the short scenario name should not be included if there is no optional scenario.
316
317 .. code:: bash
318
319             Example:
320                 1. os-nosdn-kvm-noha
321                 2. os-nosdn-kvm_ovs_dpdk_bar-ha
322
323
324 Example of how short scenario names are mapped to configuration yaml files:
325
326 .. code:: bash
327
328                   os-nosdn-kvm_ovs_dpdk-ha:
329                       configfile: ha_nfv-kvm_nfv-ovs-dpdk_heat_ceilometer_scenario.yaml
330
331 Note:
332
333 - ( - )  used for separator of fields. [os-nosdn-kvm_ovs_dpdk-ha]
334
335 - ( _ ) used to separate the values belong to the same field. [os-nosdn-kvm_ovs_bar-ha].
336
337 **3.1.5 Deploying the scenario**
338
339
340 Command to deploy the os-nosdn-kvm_ovs_dpdk-ha scenario:
341
342 .. code:: bash
343
344         $ cd ~/fuel/ci/
345         $ sudo ./deploy.sh -f -b file:///tmp/opnfv-fuel/deploy/config -l devel-pipeline -p default -s ha_nfv-kvm_nfv-ovs-dpdk_heat_ceilometer_scenario.yaml -i file:///tmp/opnfv.iso
346
347 where,
348     ``-b`` is used to specify the configuration directory
349
350     ``-f`` is used to re-deploy on the existing deployment
351
352     ``-i`` is used to specify the image downloaded from artifacts.
353
354     ``-l`` is used to specify the lab name
355
356     ``-p`` is used to specify POD name
357
358     ``-s`` is used to specify the scenario file
359
360 **Note:**
361
362 .. code:: bash
363
364            Check $ sudo ./deploy.sh -h for further information.
365
366
367 3.2 OPNFV-Playground
368 ~~~~~~~~~~~~~~~~~~~~
369
370 Install OPNFV-playground (the tool chain to deploy/test CI scenarios in fuel@opnfv, ):
371
372 .. code:: bash
373
374     $ cd ~
375     $ git clone https://github.com/jonasbjurel/OPNFV-Playground.git
376     $ cd OPNFV-Playground/ci_fuel_opnfv/
377
378 - Follow the README.rst in this ~/OPNFV-Playground/ci_fuel_opnfv sub-holder to complete all necessary installation and setup.
379 - Section “RUNNING THE PIPELINE” in README.rst explain how to use this ci_pipeline to deploy/test CI test scenarios, you can also use
380
381 .. code:: bash
382
383     ./ci_pipeline.sh --help  ##to learn more options.
384
385
386
387 ``3.2.1 Downgrade paramiko package from 2.x.x to 1.10.0``
388
389 The paramiko package 2.x.x doesn’t work with OPNFV-playground  tool chain now, Jira ticket FUEL - 188 has been raised for the same.
390
391 Check paramiko package version by following below steps in your system:
392
393 $ python
394 Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.
395 >>> import paramiko
396 >>> print paramiko.__version__
397 >>> exit()
398
399 You will get the current paramiko package version, if it is 2.x.x, uninstall this version by
400
401 .. code:: bash
402
403     $  sudo pip uninstall paramiko
404
405 Ubuntu 14.04 LTS has python-paramiko package (1.10.0), install it by
406
407 .. code:: bash
408
409     $ sudo apt-get install python-paramiko
410
411
412 Verify it by following:
413
414 .. code:: bash
415
416    $ python
417    >>> import paramiko
418    >>> print paramiko.__version__
419    >>> exit()
420
421
422 ``3.2.2  Clone the fuel@opnfv``
423
424 Check out the specific version of specific branch of fuel@opnfv
425
426 .. code:: bash
427
428    $ cd ~
429    $ git clone https://gerrit.opnfv.org/gerrit/fuel.git
430    $ cd fuel
431    By default it will be master branch, in-order to deploy on the Colorado/Danube branch, do:
432    $ git checkout stable/Danube
433
434
435 ``3.2.3 Creating the scenario``
436
437 Implement the scenario file as described in 3.1.4
438
439 ``3.2.4 Deploying the scenario``
440
441 You can use the following command to deploy/test os-nosdn kvm_ovs_dpdk-(no)ha and os-nosdn-kvm_ovs_dpdk_bar-(no)ha scenario
442
443 .. code:: bash
444
445    $ cd ~/OPNFV-Playground/ci_fuel_opnfv/
446
447 For os-nosdn-kvm_ovs_dpdk-ha :
448
449 .. code:: bash
450
451    $ ./ci_pipeline.sh -r ~/fuel -i /root/fuel.iso -B -n intel-sc -s os-nosdn-kvm_ovs_dpdk-ha
452
453 For os-nosdn-kvm_ovs_dpdk_bar-ha:
454
455 .. code:: bash
456
457    $ ./ci_pipeline.sh -r ~/fuel -i /root/fuel.iso -B -n intel-sc -s os-nosdn-kvm_ovs_dpdk_bar-ha
458
459 The “ci_pipeline.sh” first clones the local fuel repo, then deploys the
460 os-nosdn-kvm_ovs_dpdk-ha/os-nosdn-kvm_ovs_dpdk_bar-ha scenario from the given ISO, and run Functest
461 and Yarstick test.  The log of the deployment/test (ci.log)  can be found in
462 ~/OPNFV-Playground/ci_fuel_opnfv/artifact/master/YYYY-MM-DD—HH.mm, where YYYY-MM-DD—HH.mm is the
463 date/time you start the “ci_pipeline.sh”.
464
465 Note:
466
467 .. code:: bash
468
469    Check $ ./ci_pipeline.sh -h for further information.
470
471
472 3.3 Jenkins Project
473 ~~~~~~~~~~~~~~~~~~~
474
475 os-nosdn-kvm_ovs_dpdk-(no)ha and os-nosdn-kvm_ovs_dpdk_bar-(no)ha scenario can be executed from the jenkins project :
476
477     HA scenarios:
478         1.  "fuel-os-nosdn-kvm_ovs_dpdk-ha-baremetal-daily-master" (os-nosdn-kvm_ovs_dpdk-ha)
479         2.  "fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-baremetal-daily-master" (os-nosdn-kvm_ovs_dpdk_bar-ha)
480
481     NOHA scenarios:
482        1.  "fuel-os-nosdn-kvm_ovs_dpdk-noha-baremetal-daily-master" (os-nosdn-kvm_ovs_dpdk-noha)
483        2.  "fuel-os-nosdn-kvm_ovs_dpdk_bar-noha-baremetal-daily-master" (os-nosdn-kvm_ovs_dpdk_bar-noha)