diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index f88eb6b..673dc90 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -mkdir -p /opt/rally/plugins/ +mkdir -p /opt/rally/plugins cp rally-scenarios/* /opt/rally/plugins/ cp rally-contexts/* /opt/rally/plugins/ -export PYTHONPATH=PYTHONPATH;/opt/rally/plugins/ \ No newline at end of file +export PYTHONPATH=/opt/rally/plugins/ diff --git a/rally-contexts/cloud_nodes_context.py b/rally-contexts/cloud_nodes_context.py index ddb76f0..9c74f79 100644 --- a/rally-contexts/cloud_nodes_context.py +++ b/rally-contexts/cloud_nodes_context.py @@ -22,6 +22,14 @@ class CloudNodesContext(base.Context): "power_control_node": { "type": "object", "default": {} + }, + "shaker_image": { + "type": "string", + "default": "TestVM" + }, + "default_flavor": { + "type": "string", + "default": "m1.micro" } } } diff --git a/rally-scenarios/base_disaster_scenario.py b/rally-scenarios/base_disaster_scenario.py index 7fa897d..3f925cd 100644 --- a/rally-scenarios/base_disaster_scenario.py +++ b/rally-scenarios/base_disaster_scenario.py @@ -16,9 +16,11 @@ class BaseDisasterScenario(base.Scenario): **kwargs) return vm - def run_command(self, node, command, recover_command=None): + def run_command(self, node, command, recover_command=None, + recover_timeout=0): if recover_cmd is not None: - action = {"node": node, "command": command} + action = {"node": node, "command": command, + "timeout": recover_timeout} self.context["recover_commands"].append(action) r = requests.post("http://{0}/run_command".format(node), diff --git a/samples/tasks/scenarios/SampleScenario.json b/samples/tasks/scenarios/SampleScenario.json index 7d16e84..90a8ee9 100644 --- a/samples/tasks/scenarios/SampleScenario.json +++ b/samples/tasks/scenarios/SampleScenario.json @@ -12,32 +12,32 @@ "cloud_nodes": { "controllers": [ { - "shaker_agent_id": "1", - "hardware_power_on_cmd": "VBoxManage startvm fuel-slave-1", - "hardware_power_off_cmd": "VBoxManage controlvm fuel-slave-1 poweroff", - "power_off_timeout": 20, - "power_on_timeout": 30 - }, - { - "shaker_agent_id": "2", + "shaker_agent_id": "172.16.0.4:1000", "hardware_power_on_cmd": "VBoxManage startvm fuel-slave-2", "hardware_power_off_cmd": "VBoxManage controlvm fuel-slave-2 poweroff", "power_off_timeout": 20, "power_on_timeout": 30 }, { - "shaker_agent_id": "3", - "hardware_power_on_cmd": "VBoxManage startvm fuel-slave-3", - "hardware_power_off_cmd": "VBoxManage controlvm fuel-slave-3 poweroff", + "shaker_agent_id": "172.16.0.5:1000", + "hardware_power_on_cmd": "VBoxManage startvm fuel-slave-5", + "hardware_power_off_cmd": "VBoxManage controlvm fuel-slave-5 poweroff", + "power_off_timeout": 20, + "power_on_timeout": 30 + }, + { + "shaker_agent_id": "172.16.0.6:1000", + "hardware_power_on_cmd": "VBoxManage startvm fuel-slave-4", + "hardware_power_off_cmd": "VBoxManage controlvm fuel-slave-4 poweroff", "power_off_timeout": 20, "power_on_timeout": 30 } ], "power_control_node": { - "shaker_agent_id": "localhost" + "shaker_agent_id": "localhost:1000" } } } } ] -} \ No newline at end of file +}