blob: d9352895997e21be8fa9822d92ac8cd5584091d6 [file] [log] [blame]
David Kranz6308ec22012-02-22 09:36:48 -05001Quanta Research Cambridge OpenStack Stress Test System
2======================================================
3
4Nova is a distributed, asynchronous system that is prone to race condition
5bugs. These bugs will not be easily found during
David Kranzd10601c2012-03-15 15:58:28 -04006functional testing but will be encountered by users in large deployments in a
David Kranz6308ec22012-02-22 09:36:48 -05007way that is hard to debug. The stress test tries to cause these bugs to happen
8in a more controlled environment.
9
David Kranzd10601c2012-03-15 15:58:28 -040010The basic idea of the test is that there are a number of actions, roughly
David Kranz6308ec22012-02-22 09:36:48 -050011corresponding to the Compute API, that are fired pseudo-randomly at a nova
12cluster as fast as possible. These actions consist of what to do, how to
13verify success, and a state filter to make sure that the operation makes sense.
14For example, if the action is to reboot a server and none are active, nothing
15should be done. A test case is a set of actions to be performed and the
David Kranzd10601c2012-03-15 15:58:28 -040016probability that each action should be selected. There are also parameters
David Kranz6308ec22012-02-22 09:36:48 -050017controlling rate of fire and stuff like that.
18
19This test framework is designed to stress test a Nova cluster. Hence,
David Kranz73cb6a72012-04-26 15:19:50 -040020you must have a working Nova cluster with rate limiting turned off.
David Kranz6308ec22012-02-22 09:36:48 -050021
22Environment
23------------
24This particular framework assumes your working Nova cluster understands Nova
25API 2.0. The stress tests can read the logs from the cluster. To enable this
David Kranz30fe84a2012-03-20 16:25:47 -040026you have to provide the hostname to call 'nova-manage' and
27the private key and user name for ssh to the cluster in the
David Kranz6308ec22012-02-22 09:36:48 -050028[stress] section of tempest.conf. You also need to provide the
29value of --logdir in nova.conf:
30
31 host_private_key_path=<path to private ssh key>
32 host_admin_user=<name of user for ssh command>
33 nova_logdir=<value of --logdir in nova.conf>
David Kranz30fe84a2012-03-20 16:25:47 -040034 controller=<hostname for calling nova-manage>
David Kranz180fed12012-03-27 14:31:29 -040035 max_instances=<limit on instances that will be created>
David Kranz6308ec22012-02-22 09:36:48 -050036
David Kranz73cb6a72012-04-26 15:19:50 -040037Also, make sure to set
38
39log_level=CRITICAL
40
41so that the API client does not log failed calls which are expected while
42running stress tests.
43
David Kranz6308ec22012-02-22 09:36:48 -050044The stress test needs the top-level tempest directory to be on PYTHONPATH
45if you are not using nosetests to run.
46
David Kranz6308ec22012-02-22 09:36:48 -050047
48Running the sample test
49-----------------------
50
51To test your installation, do the following (from the tempest directory):
52
53 PYTHONPATH=. python stress/tests/user_script_sample.py
54
55This sample test tries to create a few VMs and kill a few VMs.
56
57
58Additional Tools
59----------------
60
61Sometimes the tests don't finish, or there are failures. In these
62cases, you may want to clean out the nova cluster. We have provided
63some scripts to do this in the ``tools`` subdirectory. To use these
64tools, you will need to install python-novaclient.
65You can then use the following script to destroy any keypairs,
66floating ips, and servers::
67
68stress/tools/nova_destroy_all.py