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