Allow to specify how many compute nodes need to be used

Change-Id: I84ab43437b8c67ac19042233a28c552b8586560c
This commit is contained in:
Ilya Shakhat 2015-03-19 00:10:44 +03:00
parent b54f5ede47
commit 44f30011b7
4 changed files with 64 additions and 25 deletions

View File

@ -0,0 +1,21 @@
description:
This scenario launches several pairs of VMs on pair of compute nodes.
VM are plugged into the same private network. Useful for testing performance
degradation when the number of VMs grows.
deployment:
template: l2.hot
vm_accommodation: [pair, double_room, density: 8, compute_nodes: 2]
execution:
size: 'quadratic_progression'
tests:
-
title: Iperf TCP test
class: iperf_graph
time: 60
-
title: Netperf TCP_STREAM
class: netperf
method: TCP_STREAM
time: 60

View File

@ -1,20 +0,0 @@
description:
This scenario launches pairs of VMs in the same private network. Every VM is
hosted on a separate compute node.
deployment:
template: l2.hot
vm_accommodation: [pair, double_room, density: 2]
execution:
size: 'linear_progression'
tests:
-
title: Iperf TCP test
class: iperf_graph
time: 60
-
title: Netperf TCP_STREAM
class: netperf
method: TCP_STREAM
time: 60

View File

@ -27,12 +27,15 @@ LOG = logging.getLogger(__name__)
def generate_agents(compute_nodes, vm_accommodation, unique):
cn_count = len(compute_nodes)
iterations = cn_count
density = 1
for s in vm_accommodation:
if isinstance(s, dict) and s.get('density'):
iterations *= s.get('density')
if isinstance(s, dict):
density = s.get('density', 1)
if s.get('compute_nodes'):
compute_nodes = compute_nodes[:s.get('compute_nodes')]
cn_count = len(compute_nodes)
iterations = cn_count * density
if 'single_room' in vm_accommodation and 'pair' in vm_accommodation:
iterations //= 2

View File

@ -141,6 +141,41 @@ class TestDeploy(testtools.TestCase):
unique)
self.assertEqual(expected, actual)
def test_generate_agents_alone_single_room_compute_nodes(self):
unique = 'UU1D'
expected = {
'UU1D_agent_0': {
'id': 'UU1D_agent_0',
'mode': 'alone',
'node': 'uno'},
'UU1D_agent_1': {
'id': 'UU1D_agent_1',
'mode': 'alone',
'node': 'duo'},
}
actual = deploy.generate_agents(['uno', 'duo', 'tre'],
['single_room', {'compute_nodes': 2}],
unique)
self.assertEqual(expected, actual)
def test_generate_agents_alone_single_room_density_compute_nodes(self):
unique = 'UU1D'
expected = {
'UU1D_agent_0': {
'id': 'UU1D_agent_0',
'mode': 'alone',
'node': 'uno'},
'UU1D_agent_1': {
'id': 'UU1D_agent_1',
'mode': 'alone',
'node': 'uno'},
}
actual = deploy.generate_agents(['uno', 'duo', 'tre'],
['single_room', {'compute_nodes': 1},
{'density': 2}],
unique)
self.assertEqual(expected, actual)
def test_filter_agents_all_deployed(self):
agents = {
'UU1D_agent_0': {