5113 Commits

Author SHA1 Message Date
Maksym Iarmak
b4e7cec59b Switch sshutils.SSH from subprocess to paramiko
Methods for executing commands/scripts and upload
files to remote host via ssh of sshutils.SSH class
were rewritten using the paramiko lib.

Related: blueprint serverdto-ssh

Change-Id: I1786d5c4d4b6e9c661ec84785dd9255ab39de4aa
2013-11-25 17:16:53 +02:00
Ilya Kharin
b510482e83 Introduce the deployment
This patch involves the deployment as a new entity that represents all
operations on an installation. Also, this patch only introduce the
deployment on several levels and keeps the legacy logic of the task
workflow. So, it's not the separation but only preparation for that.

The copy of log_task_wrapper was created to use the legacy approach of
logging.

Removed unused statuses from the class rally.consts._TaskStatus, some of
them moved to the rallyconsts._DeployStatus.

Change-Id: Ibb90977e68dcd8ba1224b1ff6951d2c0bd7dbf9e
Implements: blueprint independent-deploy
2013-11-23 23:58:48 +04:00
Jenkins
14757c1fd7 Merge "Refactor nova scenarios benchmark tests" 2013-11-23 18:01:24 +00:00
Mikhail Dubov
4ebff7618e Change benchmark config format
The patch improves the benchmark config format in that it moves some technical
parameters for each scenario run (like "times", "tenants" etc.) in a special
"config" section and also renames the "concurrent" parameter to "active_users",
which is way more clear for the end-user.

A typical benchmark config now would look like this:

"benchmark": {
    "NovaServers.boot_and_delete_server": [
        {"args": {"flavor_id": 1,
                  "image_id": "73257560-c59b-4275-a1ec-ab140e5b9979"},
         "execution": "continuous",
         "config": {"times": 10, "active_users": 2,
                    "tenants": 3, "users_per_tenant": 2}}
    ]
}

The new mandatory "execution" parameter indicates the means of scenario
execution and can now be set to only one value, namely "continuous". Another
execution type, "periodic", will be implemented in another patch.

The patch also improves unittest coverage for possible benchmark config issues
and replaces some nested mock calls with a better wrapper syntax.

Blueprint flexible-benchmark-config
Change-Id: Iabc90838aa8ad9cb44d73892852ed21c652ad274
2013-11-22 06:27:27 +04:00
Boris Pavlovic
9aaa6503ca Refactor nova scenarios benchmark tests
Use @mock.patch instanead of with mock.patch() statement
to avoid horrible nasting

Change-Id: I0140bf0565cc6a9f17a60ed10b7dbe39a2085946
2013-11-22 05:41:42 +04:00
Ilya Kharin
e8d17c5fdf Proper update of objects
This patch fixes of updating rally.objects.{Task|Deployment} objects.
Now, objects have got a correct update of an encapsulated value of
internal representation of objects.

Change-Id: Iad775974c75bf28a83631753894eceafef06f6ab
Implements: blueprint independent-deploy
2013-11-20 16:40:11 +04:00
Ilya Kharin
a94279e2e8 Make Deploy and Task objects similar
The objects have got a similar interface methods: __init__, get, delete,
delete_by_uuid. The API of DB was also changed.

Change-Id: I7c5962c14b2dd701b9c474d8c5cd8b5198621dd5
Implements: blueprint independent-deploy
2013-11-20 12:47:46 +04:00
Ilya Kharin
001830524f Add tests for rally.objects.task.Task
Change-Id: I706a50b52d27a118dd6b7c98e2430a44a4c7dd6b
Implements: blueprint independent-deploy
2013-11-20 12:47:46 +04:00
Ilya Kharin
44e81c10d8 Move task and deploy modules in rally.objects
Change-Id: I144d02333b6f8cb42a6a13e38de5d58b755bc890
Implements: blueprint independent-deploy
2013-11-20 12:47:43 +04:00
Ilya Kharin
2fcdb8e3f7 Fail task when engine not found
The task failed when engine not found at EngineFactory.get_engine.

Change-Id: Ic0837977573b23d47bec44d2c40839c9a5d2b8c2
Implements: blueprint independent-deploy
2013-11-20 11:57:32 +04:00
Jenkins
642f4cd604 Merge "Remove old sshutils functions" 2013-11-19 18:19:35 +00:00
Jenkins
3e187339a0 Merge "Cover rally.orchestrator.api by unit tests" 2013-11-19 16:18:31 +00:00
Sergey Skripnick
318bf44e5e Remove old sshutils functions
These functions aren't used anymore

blueprint serverdto-ssh

Change-Id: Ie16ce79c07f4029bdb27cf060e2044662a7e845c
2013-11-19 17:52:17 +02:00
Sergey Skripnick
2bf065089a Fix debian/ubuntu related issues
In course of time, apt database goes outdated, and 404 errors occured
when attempting to apt-get install. So, before doing apt-get install,
apt-get update is needed.

Change-Id: Ibe79b692d33e641d8c521c4ef58c5db7e991536a
2013-11-19 12:07:59 +02:00
Ilya Kharin
2a96178be9 Cover rally.orchestrator.api by unit tests
Change-Id: Ia2e06cc3c2d1e27a5a1116da3274d0ed3496dd67
Implements: blueprint independent-deploy
2013-11-19 01:45:56 +04:00
Ilya Kharin
3a7615b18f Fix typo in name of the orchestration test file
The file with tests also moved in new location.

Change-Id: I470c664ac7e2d95f02092ad8ba592b1fd78b4369
2013-11-16 05:13:09 +04:00
Jenkins
8efe36632c Merge "Add btrfs support to LxcContainer" 2013-11-15 16:46:11 +00:00
Ilya Kharin
554a0993e6 Abstract out DB operations on deploys in db.deploy
The db.deploy module contains the Deployment class with an abstract
methods. Those methods provides high levels operations on the
deployments.

Change-Id: Ibca797832ebbc96247703cdfc8b0958d10a71ddd
Implements: blueprint independent-deploy
2013-11-15 13:23:39 +04:00
Ilya Kharin
c67e472541 Added Deployment model
This patch is the first step of the separation of deployments from
tasks. The Deployment model represents an installation of OpenStack.
This model is related with the Task model through a many-to-one
relation. Now the relattion is optional because Task.deployment_uuid can
be nullable. It will be fixed in next patches.

The db.api was extended by a deployment function. The functions provide
operations to create, get, update and delete deployments.

This patch also adds index for the field uuid of the Task model.

Change-Id: I41bef0ccebdc27cd97b1db663ff3d8a9f0a5509d
Implements: blueprint independent-deploy
2013-11-15 13:23:39 +04:00
Ilya Kharin
2ef1f31e49 Canonical form of the test_db_api.py filename
Change-Id: I03dd9ebb3c27899ef4ba5cdd9f4e5d3a250dd931
2013-11-15 13:23:39 +04:00
Ilya Kharin
0e3a7ad989 Fix incorrect TaskCommandsTestCase.test_start test
This patch fixes the broken "test_start" test that not cleans a monkey
patched of rally.orchestartor.api.start_task method.

Change-Id: Ic38f98c2b651b19a7ddf10cec98a86ec700b089a
Closes-Bug: #1250981
2013-11-15 13:23:23 +04:00
Sergey Skripnick
1d376133d3 Add btrfs support to LxcContainer
Btrfs snapshots will provide fast cloning with very small
initial disk usage.

blueprint lxc-engine

Change-Id: I9d7524c67e5f16be6419fca6c968f50f53c900f6
2013-11-13 20:29:01 +02:00
Sergey Skripnick
48c411ff3e LxcProvider refactoring
Move prepare_host method from LxcProvider to LxcContainer.
Also make code some more clean.

Added configure_container.sh script which make initial
configuration within container.

Removed LxcProviderStaticIpTestCase. Now all provider's code
is covered in LxcProviderTestCase.

blueprint multihost-deploy

Change-Id: Icfe483d61deeadf3afae2eef2b74cdb1770c2a70
2013-11-13 20:28:49 +02:00
Sergey Skripnick
f3436a91ee Switch LxcProvider from sshutils
blueprint serverdto-ssh

Change-Id: I4cc4dada8744175545742fcf0571269ff96e3905
2013-11-08 10:45:37 +02:00
Mikhail Dubov
eb76ecdad7 Improve sample configs
1) Rename sample-task.json to sample-task-boot-and-delete.json to be more
   specific; also restructure it a bit to bring it into compliance with
   sample-task-soft-reboot.json;
2) Add sample-cloud-verification.json that shows how to use verification.

Blueprint rally-docs

Change-Id: I8fa4f92c74ec49d8637cba131c9cd309028dc73a
2013-11-07 13:42:19 +04:00
Ilya Kharin
edece060de Delete task by command
The task is removed together with related results. In addition to the
removal operation the change contains atomistic DB API method to
retrieve results of a task.

bp cli-task-improve

Change-Id: I58f10e28a8d12a63f903bb26b2ef464719ad8f0b
2013-11-06 15:23:08 +04:00
Jenkins
17763e9a0f Merge "Fedora/CentOS specific fixes in devstack engine" 2013-11-06 01:01:43 +00:00
Mikhail Dubov
b2d55835d7 Add sleep_between() method to benchmark scenarios
This patch adds a helper sleep_between() method to the base.Scenario class
thus enabling the subscenarios to use it. The method performs a time.sleep()
call for a random amount of seconds from the given range and also counts the
amount of seconds slept to take them to account while calculating the running
time of a scenario.

Here also the NovaServers.boot_and_delete_server gets changed using the new
sleep_between method(): it can now (optionally) perform a sleep between
booting and deleting a server.

Blueprint benchmark-scenarios

Change-Id: I2a76dadbd8413cef0650c2af7cf5125188cb35ba
2013-11-05 11:45:39 +04:00
Sergey Skripnick
9e1d8985c9 Fedora/CentOS specific fixes in devstack engine
Got following issues with Fedora and CentOS:

 * only tcp port 22 is open by default
 * requiretty is true in sudoers
 * no /sbin in $PATH

Change-Id: I7467864059512c1aee2645c0cba46a80db7a055b
2013-11-01 18:14:55 +02:00
boden
5f86d7258e Fixes rally boot_server benchmark bug
Fixes rally NovaServers.boot_server benchmark bug which occurs due to
invalid attribute reference of the classes nova client. This bug appears
to have been introduced when rally switched a dict based set of clients.

The updates herein also permit the boot_server benchmark to function if
no networks are created on the Cloud. In this case the boot call does
not pass down a nic to provision.

This commit also includes boot_server unit tests to provide (obviously)
missing coverage for the benchmark method.

Closes-Bug: #1246407

Change-Id: Id8ca25f5060074a57ff97f1bfa54454dcc30654f
2013-10-31 16:29:54 -04:00
boden
de35253f15 Benchmark scenario to boot server and bounce it N times
Implements a benchmark scenario which will boot a server and then
"bounce" it with specified operations: stop/start, soft reboot and hard
reboot.

A builder utility class is also provided which permits callers define,
bind, validate and build wrapper functions which encapsulate
calling an action method 1 or more times.

Partial implementation of blueprint benchmark-scenarios

Change-Id: I3cfba5c1ad1aff614027f52c13ebb63a420f4a2b
2013-10-30 13:13:34 -04:00
Ilya Kharin
df702334c3 Delete objects completely
The soft deletion of objects in data store is not suitable for the
benchmark. The testing results became irrelevant after removal.

The rally.db.api.task_list ceases to support the active parameter.

Implements: blueprint rally-hard-delete

Change-Id: Ia9477423cebd26499e968f923961ee0f29685d8a
2013-10-30 16:08:53 +04:00
Mikhail Dubov
ee578b6ae8 Optimize the scenario runner
1. Create openstack clients in the ScenarioRunner.run method, i.e. one time
   for all scenario loops (speedup);
2. Get rid of the useless Scenario.class_init() method
3. Move cleanup inside the scenario loop run to enable the cleanup
   implementations to delete the user's resources the scenario was run with;

Blueprint test-engine

Change-Id: I7f8d439baaf4a86539e6cebe7ac83d8fddcd4a47
2013-10-29 15:04:28 +04:00
Jenkins
c95eafd28b Merge "Use ServerDTO.ssh in devstack engine" 2013-10-29 10:32:29 +00:00
boden
b1284101e6 Fix intermitten py test failure
Fixes an internmitten py test failure related to File
"tests/serverprovider/test_provider.py", line 64, in
test_get_available_providers. The issue causes the gate jobs to fail on
a patch submission and appears to be a timing error with respect to when
the "inner" test classes ProviderA, ProviderB and ProviderC are visable
in the py runtime.

Change-Id: I74555693135cd69f2d5771de24c410c0bed25244
2013-10-28 09:56:29 -04:00
Ilya Kharin
9e052a910f Use a dash in --task-id argument
Change-Id: I861de307d92703c24bb41fec4d331644e6afbae6
2013-10-28 17:24:37 +04:00
Sergey Skripnick
a801ddc06b Use ServerDTO.ssh in devstack engine
blueprint serverdto-ssh

Change-Id: I049f9ba009895fffeddae77e26e903c80314c00d
2013-10-28 15:22:19 +02:00
Sergey Skripnick
7d588447cc Add ssh object to ServerDTO
With this change servers is easy accessible with ssh:

server = ServerDTO(...)
server.ssh.wait()  # wait for ssh is available
server.ssh.execute("reboot")

blueprint serverdto-ssh

Change-Id: I15a962927331cec80b63d759a2717b171ca41e6f
2013-10-28 14:49:49 +02:00
Sergey Skripnick
f7557fa6f9 Add SSH class to rally.sshutils
Following methods added:

 * execute: execute command
 * execute_script: execute local script on remote host
 * upload: upload file
 * wait: wait for ssh is available

Added exceptions SSHException and SSHTimeout

blueprint serverdto-ssh

Change-Id: Ibb261e0561e4104f4b41414b53d5a67d8b267a01
2013-10-28 14:49:38 +02:00
Boris Pavlovic
45f204272e Cleanup logging
Remove start/stop logging message from buisness logic.
Use rally.utils.log_task_wrapper for such purpose.

Implement bp logging

Change-Id: I87b5679d34e3a69d5f6fcf3829e73cce73ca9416
2013-10-27 21:38:08 +04:00
Sergey Skripnick
5d43729530 Rename NoDBTestCase to TestCase
It is more clear to use TestCase for all tests, and DBTestCase for DB tests.
Also removed some strange code from rally/tests.py

Change-Id: Ib0ea34850c4dd5d6671b00114d570650190d09a4
2013-10-25 11:49:01 +03:00
Jenkins
79f5dd8286 Merge "Enable different tenants in the scenario runner" 2013-10-24 11:29:33 +00:00
Jenkins
9c3c1b0ab5 Merge "Fully initialize the keystone client in osclients" 2013-10-24 11:24:50 +00:00
Mikhail Dubov
f3740997be Enable different tenants in the scenario runner
The current implementation of the scenario runner runs all the benchmark
scenarios from the admin account returned in the endpoints config from the
deploy engine. It uses thus only one tenant and one user to emulate all the
load on the cloud which is a bit unrealistic.

This patch allows the user to add "tenants" and "users_per_tenant" parameters
to the test config, like:

"NovaServers.boot_and_delete_server": [
 {"args": {"flavor_id": 1,
           "image_id": "73257560-c59b-4275-a1ec-ab140e5b9979"},
  "times": 10, "concurrent": 2,
  "tenants": 3, "users_per_tenant": 2}
]

The scenario runner then creates the necessary amount of temporary tenants and
users and uses them randomly while executing benchmark scenarios.

Blueprint test-engine

Change-Id: I5a85a344ed73242d5b33f7af88e222c049f95dd4
2013-10-24 13:22:51 +04:00
Mikhail Dubov
65ae2f3996 Fix local test case failure for test_lxc_install()
test_lxc_install() testcase eventually fails while running on a local machine
because of a path string issue. This patch fixes this by using os.path.abspath.

Change-Id: I9507469f725772a41378379bf23cbaae1741dcea
2013-10-24 13:09:53 +04:00
Jenkins
5a0e8ed847 Merge "Catch proper exception on MissignArgs error" 2013-10-24 08:27:23 +00:00
Mikhail Dubov
8997770a4a Fully initialize the keystone client in osclients
To be able to perform some administrative tasks like listing/creating tenants
etc., the keystone client needs to use a public address which is not guaranteed
in case of using the "auth_url" parameter only. This patch adds the "endpoint"
parameter to the input of the keystone client constructor + authenticates the
client on this URL so that it gets fully functional.

Change-Id: I50ef23d4f916de8596aa2fea6f1babdb7742798f
Closes-Bug: #1243273
2013-10-23 23:27:22 +04:00
Boris Pavlovic
c31170cb6d Use random network in boot_server scenario
In this scneario we are going to run a lot of VMs one by one.
Usually one network has about 500 fixed ips (or we will get performance issues)

So if we are going to run 2k vms we should use at least 4 networks.

To simplify configuration of this test. We will by default chose
random network to get ip for vm.

Change-Id: If5d8c52b4f02315be2bcc542baf43cdcc0989316
2013-10-23 17:23:41 +04:00
boden
90dc0298f1 Performance changes for UTs
Mocks unit test sleep to return immediately mitigating any unit test
sleep time taken for the cleanup tests.

Change-Id: I16aead4bbeeb5e90740f6b9bddcff627c8a33cc2
2013-10-22 13:17:43 -04:00
Sergey Skripnick
b73ea9499a Add lxc provider
Provide lxc containers on host created by another provider.

blueprint lxc-provider

Change-Id: I29d99817d3a001f2da8392c514af196d8097432a
2013-10-22 15:24:19 +03:00