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 KVMFORNFV Scenario-Description
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 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 Environment Setup
102 -----------------
103
104 **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 **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 Scenario Testing
150 ----------------
151
152 There are three ways of performing scenario testing,
153     - 1 Fuel
154     - 2 OPNFV-Playground
155     - 3 Jenkins Project
156
157 Fuel
158 ~~~~
159
160 **1 Clone the fuel repo :**
161
162 .. code:: bash
163
164    $ git clone https://gerrit.opnfv.org/gerrit/fuel.git
165
166 **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  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 **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
212 The deployment configuration file should contain configuration metadata as stated below:
213
214 .. code:: bash
215
216               deployment-scenario-metadata:
217                       title:
218                       version:
219                       created:
220
221 ``(iii). “stack-extentions” Module``
222
223 To include fuel plugins in the deployment configuration file, use the “stack-extentions” key:
224
225 .. code:: bash
226
227              Example:
228                      stack-extensions:
229                         - module: fuel-plugin-collectd-ceilometer
230                           module-config-name: fuel-barometer
231                           module-config-version: 1.0.0
232                           module-config-override:
233                           #module-config overrides
234
235 **Note:**
236 The “module-config-name” and “module-config-version” should be same as the name of plugin configuration file.
237
238 The “module-config-override” is used to configure the plugin by overrriding the corresponding keys in
239 the plugin config yaml file present in ~/fuel/deploy/config/plugins/.
240
241 ``(iv).  “dea-override-config” Module``
242
243 To configure the HA/No-HA mode, network segmentation types and role to node assignments, use the “dea-override-config” key.
244
245 .. code:: bash
246
247         Example:
248         dea-override-config:
249                environment:
250                    mode: ha
251                    net_segment_type: tun
252                nodes:
253                - id: 1
254                   interfaces: interfaces_1
255                   role: mongo,controller,opendaylight
256                - id: 2
257                  interfaces: interfaces_1
258                  role: mongo,controller
259                - id: 3
260                   interfaces: interfaces_1
261                   role: mongo,controller
262                - id: 4
263                   interfaces: interfaces_1
264                   role: ceph-osd,compute
265                - id: 5
266                   interfaces: interfaces_1
267                   role: ceph-osd,compute
268         settings:
269             editable:
270                 storage:
271                      ephemeral_ceph:
272                               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).
273                               label: Ceph RBD for ephemeral volumes (Nova)
274                               type: checkbox
275                               value: true
276                               weight: 75
277                      images_ceph:
278                               description: Configures Glance to use the Ceph RBD backend to store images.If enabled, this option will prevent Swift from installing.
279                               label: Ceph RBD for images (Glance)
280                               restrictions:
281                               - settings:storage.images_vcenter.value == true: Only one Glance backend could be selected.
282                               type: checkbox
283                               value: true
284                               weight: 30
285
286 Under the “dea-override-config” should provide atleast {environment:{mode:'value},{net_segment_type:'value'}
287 and {nodes:1,2,...} and can also enable additional stack features such ceph,heat which overrides
288 corresponding keys in the dea_base.yaml and dea_pod_override.yaml.
289
290 ``(v). “dha-override-config”  Module``
291
292 In order to configure the pod dha definition, use the “dha-override-config” key.
293 This is an optional key present at the ending of the scenario file.
294
295 ``(vi). Mapping to short scenario name``
296
297 The scenario.yaml file is used to map the short names of scenario's to the one or more deployment scenario configuration yaml files.
298 The short scenario names should follow the scheme below:
299
300 .. code:: bash
301
302                [os]-[controller]-[feature]-[mode]-[option]
303
304         [os]: mandatory
305         possible value: os
306
307 Please note that this field is needed in order to select parent jobs to list and do blocking relations between them.
308
309 .. code:: bash
310
311
312     [controller]: mandatory
313     example values: nosdn, ocl, odl, onos
314
315     [mode]: mandatory
316     possible values: ha, noha
317
318     [option]: optional
319
320 Used for the scenarios those do not fit into naming scheme.
321 Optional field in the short scenario name should not be included if there is no optional scenario.
322
323 .. code:: bash
324
325             Example:
326                 1. os-nosdn-kvm-noha
327                 2. os-nosdn-kvm_ovs_dpdk_bar-ha
328
329
330 Example of how short scenario names are mapped to configuration yaml files:
331
332 .. code:: bash
333
334                   os-nosdn-kvm_ovs_dpdk-ha:
335                       configfile: ha_nfv-kvm_nfv-ovs-dpdk_heat_ceilometer_scenario.yaml
336
337 Note:
338
339 - ( - )  used for separator of fields. [os-nosdn-kvm_ovs_dpdk-ha]
340
341 - ( _ ) used to separate the values belong to the same field. [os-nosdn-kvm_ovs_bar-ha].
342
343 **5 Deploying the scenario**
344
345 Command to deploy the os-nosdn-kvm_ovs_dpdk-ha scenario:
346
347 .. code:: bash
348
349         $ cd ~/fuel/ci/
350         $ 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
351
352 where,
353     ``-b`` is used to specify the configuration directory
354
355     ``-f`` is used to re-deploy on the existing deployment
356
357     ``-i`` is used to specify the image downloaded from artifacts.
358
359     ``-l`` is used to specify the lab name
360
361     ``-p`` is used to specify POD name
362
363     ``-s`` is used to specify the scenario file
364
365 **Note:**
366
367 .. code:: bash
368
369            Check $ sudo ./deploy.sh -h for further information.
370
371
372 OPNFV-Playground
373 ~~~~~~~~~~~~~~~~
374
375 Install OPNFV-playground (the tool chain to deploy/test CI scenarios in fuel@opnfv, ):
376
377 .. code:: bash
378
379     $ cd ~
380     $ git clone https://github.com/jonasbjurel/OPNFV-Playground.git
381     $ cd OPNFV-Playground/ci_fuel_opnfv/
382
383 - Follow the README.rst in this ~/OPNFV-Playground/ci_fuel_opnfv sub-holder to complete all necessary installation and setup.
384 - Section “RUNNING THE PIPELINE” in README.rst explain how to use this ci_pipeline to deploy/test CI test scenarios, you can also use
385
386 .. code:: bash
387
388     ./ci_pipeline.sh --help  ##to learn more options.
389
390
391
392 ``1 Downgrade paramiko package from 2.x.x to 1.10.0``
393
394 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.
395
396 Check paramiko package version by following below steps in your system:
397
398 .. code:: bash
399
400    $ python
401    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.
402
403    >>> import paramiko
404    >>> print paramiko.__version__
405    >>> exit()
406
407 You will get the current paramiko package version, if it is 2.x.x, uninstall this version by
408
409 .. code:: bash
410
411     $  sudo pip uninstall paramiko
412
413 Ubuntu 14.04 LTS has python-paramiko package (1.10.0), install it by
414
415 .. code:: bash
416
417     $ sudo apt-get install python-paramiko
418
419
420 Verify it by following:
421
422 .. code:: bash
423
424    $ python
425    >>> import paramiko
426    >>> print paramiko.__version__
427    >>> exit()
428
429
430 ``2  Clone the fuel@opnfv``
431
432 Check out the specific version of specific branch of fuel@opnfv
433
434 .. code:: bash
435
436    $ cd ~
437    $ git clone https://gerrit.opnfv.org/gerrit/fuel.git
438    $ cd fuel
439    By default it will be master branch, in-order to deploy on the Colorado/Danube branch, do:
440    $ git checkout stable/Danube
441
442
443 ``3 Creating the scenario``
444
445 Implement the scenario file as described in 3.1.4
446
447 ``4 Deploying the scenario``
448
449 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
450
451 .. code:: bash
452
453    $ cd ~/OPNFV-Playground/ci_fuel_opnfv/
454
455 For os-nosdn-kvm_ovs_dpdk-ha :
456
457 .. code:: bash
458
459    $ ./ci_pipeline.sh -r ~/fuel -i /root/fuel.iso -B -n intel-sc -s os-nosdn-kvm_ovs_dpdk-ha
460
461 For os-nosdn-kvm_ovs_dpdk_bar-ha:
462
463 .. code:: bash
464
465    $ ./ci_pipeline.sh -r ~/fuel -i /root/fuel.iso -B -n intel-sc -s os-nosdn-kvm_ovs_dpdk_bar-ha
466
467 The “ci_pipeline.sh” first clones the local fuel repo, then deploys the
468 os-nosdn-kvm_ovs_dpdk-ha/os-nosdn-kvm_ovs_dpdk_bar-ha scenario from the given ISO, and run Functest
469 and Yarstick test.  The log of the deployment/test (ci.log)  can be found in
470 ~/OPNFV-Playground/ci_fuel_opnfv/artifact/master/YYYY-MM-DD—HH.mm, where YYYY-MM-DD—HH.mm is the
471 date/time you start the “ci_pipeline.sh”.
472
473 Note:
474
475 .. code:: bash
476
477    Check $ ./ci_pipeline.sh -h for further information.
478
479
480 Jenkins Project
481 ~~~~~~~~~~~~~~~
482
483 os-nosdn-kvm_ovs_dpdk-(no)ha and os-nosdn-kvm_ovs_dpdk_bar-(no)ha scenario can be executed from the jenkins project :
484
485     ``HA scenarios:``
486         1.  "fuel-os-nosdn-kvm_ovs_dpdk-ha-baremetal-daily-master" (os-nosdn-kvm_ovs_dpdk-ha)
487         2.  "fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-baremetal-daily-master" (os-nosdn-kvm_ovs_dpdk_bar-ha)
488
489     ``NOHA scenarios:``
490        1.  "fuel-os-nosdn-kvm_ovs_dpdk-noha-virtual-daily-master" (os-nosdn-kvm_ovs_dpdk-noha)
491        2.  "fuel-os-nosdn-kvm_ovs_dpdk_bar-noha-virtual-daily-master" (os-nosdn-kvm_ovs_dpdk_bar-noha)