dbbcc5d69776a62db77bedae3a09bd048322555f
[functest.git] / docs / userguide / troubleshooting.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 Troubleshooting
5 ===============
6
7 This section gives some guidelines about how to troubleshoot the test cases
8 owned by Functest.
9
10 **IMPORTANT**: As in the previous section, the steps defined below must be
11 executed inside the Functest Docker container and after sourcing the OpenStack
12 credentials::
13
14     . $creds
15
16 or::
17
18     source /home/opnfv/functest/conf/openstack.creds
19
20 VIM
21 ---
22
23 This section covers the test cases related to the VIM (healthcheck, vping_ssh,
24 vping_userdata, tempest_smoke_serial, tempest_full_parallel, rally_sanity,
25 rally_full).
26
27 vPing common
28 ^^^^^^^^^^^^
29 For both vPing test cases (**vPing_ssh**, and **vPing_userdata**), the first steps are
30 similar:
31
32     * Create Glance image
33     * Create Network
34     * Create Security Group
35     * Create Instances
36
37 After these actions, the test cases differ and will be explained in their
38 respective section.
39
40 These test cases can be run inside the container, using new Functest CLI as follows::
41
42     $ functest testcase run vping_ssh
43     $ functest testcase run vping_userdata
44
45 The Functest CLI is designed to route a call to the corresponding internal
46 python scripts, located in paths:
47 *$repos_dir/functest/testcases/vPing/CI/libraries/vPing_ssh.py* and
48 *$repos_dir/functest/testcases/vPing/CI/libraries/vPing_userdata.py*
49
50 Notes:
51   #. In this Colorado Funtest Userguide, the use of the Functest CLI is
52      emphasized. The Functest CLI replaces the earlier Bash shell script
53      *run_tests.sh*.
54
55   #. There is one difference, between the Functest CLI based test case
56      execution compared to the earlier used Bash shell script, which is
57      relevant to point out in troubleshooting scenarios:
58
59          The Functest CLI does **not yet** support the option to suppress
60          clean-up of the generated OpenStack resources, following the execution
61          of a test case.
62
63      Explanation: After finishing the test execution, the corresponding
64      script will remove, by default, all created resources in OpenStack
65      (image, instances, network and security group). When troubleshooting,
66      it is advisable sometimes to keep those resources in case the test
67      fails and a manual testing is needed.
68
69      It is actually still possible to invoke test execution, with suppression
70      of OpenStack resource cleanup, however this requires invocation of a
71      **specific Python script:** '/home/opnfv/repos/functest/ci/run_test.py'.
72      The `OPNFV Functest Developer Guide`_ provides guidance on the use of that
73      Python script in such troubleshooting cases.
74
75 Some of the common errors that can appear in this test case are::
76
77     vPing_ssh- ERROR - There has been a problem when creating the neutron network....
78
79 This means that there has been some problems with Neutron, even before creating the
80 instances. Try to create manually a Neutron network and a Subnet to see if that works.
81 The debug messages will also help to see when it failed (subnet and router creation).
82 Example of Neutron commands (using 10.6.0.0/24 range for example)::
83
84     neutron net-create net-test
85     neutron subnet-create --name subnet-test --allocation-pool start=10.6.0.2,end=10.6.0.100 \
86     --gateway 10.6.0.254 net-test 10.6.0.0/24
87     neutron router-create test_router
88     neutron router-interface-add <ROUTER_ID> test_subnet
89     neutron router-gateway-set <ROUTER_ID> <EXT_NET_NAME>
90
91 Another related error can occur while creating the Security Groups for the instances::
92
93     vPing_ssh- ERROR - Failed to create the security group...
94
95 In this case, proceed to create it manually. These are some hints::
96
97     neutron security-group-create sg-test
98     neutron security-group-rule-create sg-test --direction ingress --protocol icmp \
99     --remote-ip-prefix 0.0.0.0/0
100     neutron security-group-rule-create sg-test --direction ingress --ethertype IPv4 \
101     --protocol tcp --port-range-min 80 --port-range-max 80 --remote-ip-prefix 0.0.0.0/0
102     neutron security-group-rule-create sg-test --direction egress --ethertype IPv4 \
103     --protocol tcp --port-range-min 80 --port-range-max 80 --remote-ip-prefix 0.0.0.0/0
104
105 The next step is to create the instances. The image used is located in
106 */home/opnfv/functest/data/cirros-0.3.4-x86_64-disk.img* and a Glance image is created
107 with the name **functest-vping**. If booting the instances fails (i.e. the status
108 is not **ACTIVE**), you can check why it failed by doing::
109
110     nova list
111     nova show <INSTANCE_ID>
112
113 It might show some messages about the booting failure. To try that manually::
114
115     nova boot --flavor m1.small --image functest-vping --nic net-id=<NET_ID> nova-test
116
117 This will spawn a VM using the network created previously manually.
118 In all the OPNFV tested scenarios from CI, it never has been a problem with the
119 previous actions. Further possible problems are explained in the following sections.
120
121
122 vPing_SSH
123 ^^^^^^^^^
124 This test case creates a floating IP on the external network and assigns it to
125 the second instance **opnfv-vping-2**. The purpose of this is to establish
126 a SSH connection to that instance and SCP a script that will ping the first
127 instance. This script is located in the repository under
128 *$repos_dir/functest/testcases/OpenStack/vPing/ping.sh* and takes an IP as
129 a parameter. When the SCP is completed, the test will do an SSH call to that script
130 inside the second instance. Some problems can happen here::
131
132     vPing_ssh- ERROR - Cannot establish connection to IP xxx.xxx.xxx.xxx. Aborting
133
134 If this is displayed, stop the test or wait for it to finish, if you have used
135 the special method of test invocation with specific supression of OpenStack
136 resource clean-up, as explained earler. It means that the Container can not
137 reach the Public/External IP assigned to the instance **opnfv-vping-2**. There
138 are many possible reasons, and they really depend on the chosen scenario. For
139 most of the ODL-L3 and ONOS scenarios this has been noticed and it is a known
140 limitation.
141
142 First, make sure that the instance **opnfv-vping-2** succeeded to get an IP
143 from the DHCP agent. It can be checked by doing::
144
145     nova console-log opnfv-vping-2
146
147 If the message *Sending discover* and *No lease, failing* is shown, it probably
148 means that the Neutron dhcp-agent failed to assign an IP or even that it was not
149 responding. At this point it does not make sense to try to ping the floating IP.
150
151 If the instance got an IP properly, try to ping manually the VM from the container::
152
153     nova list
154     <grab the public IP>
155     ping <public IP>
156
157 If the ping does not return anything, try to ping from the Host where the Docker
158 container is running. If that solves the problem, check the iptable rules because
159 there might be some rules rejecting ICMP or TCP traffic coming/going from/to the
160 container.
161
162 At this point, if the ping does not work either, try to reproduce the test
163 manually with the steps described above in the vPing common section with the
164 addition::
165
166     neutron floatingip-create <EXT_NET_NAME>
167     nova floating-ip-associate nova-test <FLOATING_IP>
168
169
170 Further troubleshooting is out of scope of this document, as it might be due to
171 problems with the SDN controller. Contact the installer team members or send an
172 email to the corresponding OPNFV mailing list for more information.
173
174
175
176 vPing_userdata
177 ^^^^^^^^^^^^^^
178 This test case does not create any floating IP neither establishes an SSH
179 connection. Instead, it uses nova-metadata service when creating an instance
180 to pass the same script as before (ping.sh) but as 1-line text. This script
181 will be executed automatically when the second instance **opnfv-vping-2** is booted.
182
183 The only known problem here for this test to fail is mainly the lack of support
184 of cloud-init (nova-metadata service). Check the console of the instance::
185
186     nova console-log opnfv-vping-2
187
188 If this text or similar is shown::
189
190     checking http://169.254.169.254/2009-04-04/instance-id
191     failed 1/20: up 1.13. request failed
192     failed 2/20: up 13.18. request failed
193     failed 3/20: up 25.20. request failed
194     failed 4/20: up 37.23. request failed
195     failed 5/20: up 49.25. request failed
196     failed 6/20: up 61.27. request failed
197     failed 7/20: up 73.29. request failed
198     failed 8/20: up 85.32. request failed
199     failed 9/20: up 97.34. request failed
200     failed 10/20: up 109.36. request failed
201     failed 11/20: up 121.38. request failed
202     failed 12/20: up 133.40. request failed
203     failed 13/20: up 145.43. request failed
204     failed 14/20: up 157.45. request failed
205     failed 15/20: up 169.48. request failed
206     failed 16/20: up 181.50. request failed
207     failed 17/20: up 193.52. request failed
208     failed 18/20: up 205.54. request failed
209     failed 19/20: up 217.56. request failed
210     failed 20/20: up 229.58. request failed
211     failed to read iid from metadata. tried 20
212
213 it means that the instance failed to read from the metadata service. Contact
214 the Functest or installer teams for more information.
215
216 NOTE: Cloud-init in not supported on scenarios dealing with ONOS and the tests
217 have been excluded from CI in those scenarios.
218
219
220 Tempest
221 ^^^^^^^
222
223 In the upstream OpenStack CI all the Tempest test cases are supposed to pass.
224 If some test cases fail in an OPNFV deployment, the reason is very probably one
225 of the following
226
227 +-----------------------------+-----------------------------------------------------+
228 | Error                       | Details                                             |
229 +=============================+=====================================================+
230 | Resources required for test | Such resources could be e.g. an external network    |
231 | case execution are missing  | and access to the management subnet (adminURL) from |
232 |                             | the Functest docker container.                      |
233 +-----------------------------+-----------------------------------------------------+
234 | OpenStack components or     | Check running services in the controller and compute|
235 | services are missing or not | nodes (e.g. with "systemctl" or "service" commands).|
236 | configured properly         | Configuration parameters can be verified from the   |
237 |                             | related .conf files located under '/etc/<component>'|
238 |                             | directories.                                        |
239 +-----------------------------+-----------------------------------------------------+
240 | Some resources required for | The tempest.conf file, automatically generated by   |
241 | execution test cases are    | Rally in Functest, does not contain all the needed  |
242 | missing                     | parameters or some parameters are not set properly. |
243 |                             | The tempest.conf file is located in directory       |
244 |                             | '/home/opnfv/.rally/tempest/for-deployment-<UUID>'  |
245 |                             | in the Functest Docker container. Use the "rally    |
246 |                             | deployment list" command in order to check the UUID |
247 |                             | the UUID of the current deployment.                 |
248 +-----------------------------+-----------------------------------------------------+
249
250
251 When some Tempest test case fails, captured traceback and possibly also the
252 related REST API requests/responses are output to the console. More detailed debug
253 information can be found from tempest.log file stored into related Rally deployment
254 folder.
255
256
257 Rally
258 ^^^^^
259
260 The same error causes which were mentioned above for Tempest test cases, may also
261 lead to errors in Rally as well.
262
263 It is possible to run only one Rally scenario, instead of the whole suite.
264 To do that, call the alternative python script as follows::
265
266   python $repos_dir/functest/testcases/OpenStack/rally/run_rally-cert.py -h
267   usage: run_rally-cert.py [-h] [-d] [-r] [-s] [-v] [-n] test_name
268
269   positional arguments:
270     test_name      Module name to be tested. Possible values are : [
271                    authenticate | glance | cinder | heat | keystone | neutron |
272                    nova | quotas | requests | vm | all ] The 'all' value
273                    performs all possible test scenarios
274
275   optional arguments:
276     -h, --help     show this help message and exit
277     -d, --debug    Debug mode
278     -r, --report   Create json result file
279     -s, --smoke    Smoke test mode
280     -v, --verbose  Print verbose info about the progress
281     -n, --noclean  Don't clean the created resources for this test.
282
283 For example, to run the Glance scenario with debug information::
284
285   python $repos_dir/functest/testcases/OpenStack/rally/run_rally-cert.py -d glance
286
287 Possible scenarios are:
288  * authenticate
289  * glance
290  * cinder
291  * heat
292  * keystone
293  * neutron
294  * nova
295  * quotas
296  * requests
297  * vm
298
299 To know more about what those scenarios are doing, they are defined in directory:
300 *$repos_dir/functest/testcases/OpenStack/rally/scenario*
301 For more info about Rally scenario definition please refer to the Rally official
302 documentation. `[3]`_
303
304 If the flag *all* is specified, it will run all the scenarios one by one. Please
305 note that this might take some time (~1,5hr), taking around 1 hour alone to
306 complete the Nova scenario.
307
308 To check any possible problems with Rally, the logs are stored under
309 */home/opnfv/functest/results/rally/* in the Functest Docker container.
310
311
312 Controllers
313 -----------
314
315 Opendaylight
316 ^^^^^^^^^^^^
317
318 If the Basic Restconf test suite fails, check that the ODL controller is
319 reachable and its Restconf module has been installed.
320
321 If the Neutron Reachability test fails, verify that the modules
322 implementing Neutron requirements have been properly installed.
323
324 If any of the other test cases fails, check that Neutron and ODL have
325 been correctly configured to work together. Check Neutron configuration
326 files, accounts, IP addresses etc.).
327
328
329 ONOS
330 ^^^^
331
332 Please refer to the ONOS documentation. `ONOSFW User Guide`_ .
333
334
335 Features
336 --------
337
338 Please refer to the dedicated feature user guides for details.
339
340
341 security_scan
342 ^^^^^^^^^^^^^
343
344 See OpenSCAP web site: https://www.open-scap.org/
345
346
347
348 NFV
349 ---
350
351 vIMS
352 ^^^^
353 vIMS deployment may fail for several reasons, the most frequent ones are
354 described in the following table:
355
356 +-----------------------------------+------------------------------------+
357 | Error                             |  Comments                          |
358 +===================================+====================================+
359 | Keystone admin API  not reachable | Impossible to create vIMS user and |
360 |                                   | tenant                             |
361 +-----------------------------------+------------------------------------+
362 | Impossible to retrieve admin role | Impossible to create vIMS user and |
363 | id                                | tenant                             |
364 +-----------------------------------+------------------------------------+
365 | Error when uploading image from   | impossible to deploy VNF           |
366 | OpenStack to glance               |                                    |
367 +-----------------------------------+------------------------------------+
368 | Cinder quota cannot be updated    | Default quotas not sufficient, they|
369 |                                   | are adapted in the script          |
370 +-----------------------------------+------------------------------------+
371 | Impossible to create a volume     | VNF cannot be deployed             |
372 +-----------------------------------+------------------------------------+
373 | SSH connection issue between the  | if vPing test fails, vIMS test will|
374 | Test Docker container and the VM  | fail...                            |
375 +-----------------------------------+------------------------------------+
376 | No Internet access from the VM    | the VMs of the VNF must have an    |
377 |                                   | external access to Internet        |
378 +-----------------------------------+------------------------------------+
379 | No access to OpenStack API from   | Orchestrator can be installed but  |
380 | the VM                            | the vIMS VNF installation fails    |
381 +-----------------------------------+------------------------------------+
382
383
384 parser
385 ^^^^^^
386
387 For now log info is the only way to do trouble shooting
388
389
390 .. _`OPNFV Functest Developer Guide`:  http://artifacts.opnfv.org/functest/docs/devguide/#