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