summaryrefslogtreecommitdiffstats
path: root/docker/storperf-master
diff options
context:
space:
mode:
Diffstat (limited to 'docker/storperf-master')
-rw-r--r--docker/storperf-master/rest_server.py5
-rw-r--r--docker/storperf-master/storperf/storperf_master.py21
2 files changed, 20 insertions, 6 deletions
diff --git a/docker/storperf-master/rest_server.py b/docker/storperf-master/rest_server.py
index 1b66af3..839ea81 100644
--- a/docker/storperf-master/rest_server.py
+++ b/docker/storperf-master/rest_server.py
@@ -37,6 +37,7 @@ class ReverseProxied(object):
:param app: the WSGI application
'''
+
def __init__(self, app):
self.app = app
@@ -117,7 +118,8 @@ class ConfigurationResponseModel:
'stack_id': fields.String,
'volume_count': fields.Integer,
'volume_size': fields.Integer,
- 'availability_zone': fields.String
+ 'availability_zone': fields.String,
+ 'slave_addresses': fields.Nested
}
@@ -141,6 +143,7 @@ class Configure(Resource):
'volume_size': storperf.volume_size,
'stack_created': storperf.is_stack_created,
'availability_zone': storperf.availability_zone,
+ 'slave_addresses': storperf.slave_addresses,
'stack_id': storperf.stack_id})
@swagger.operation(
diff --git a/docker/storperf-master/storperf/storperf_master.py b/docker/storperf-master/storperf/storperf_master.py
index d54fea3..044cbb2 100644
--- a/docker/storperf-master/storperf/storperf_master.py
+++ b/docker/storperf-master/storperf/storperf_master.py
@@ -16,13 +16,13 @@ from time import sleep
import paramiko
from scp import SCPClient
+
from snaps.config.stack import StackConfig
from snaps.openstack.create_stack import OpenStackHeatStack
from snaps.openstack.os_credentials import OSCreds
-
+from snaps.openstack.utils import heat_utils, cinder_utils, glance_utils
from storperf.db.job_db import JobDB
from storperf.test_executor import TestExecutor
-from snaps.openstack.utils import heat_utils, cinder_utils, glance_utils
class ParameterError(Exception):
@@ -68,6 +68,7 @@ class StorPerfMaster(object):
self._volume_size = 1
self._cached_stack_id = None
self._last_snaps_check_time = None
+ self._slave_addresses = []
@property
def volume_count(self):
@@ -142,6 +143,10 @@ class StorPerfMaster(object):
self._agent_flavor = value
@property
+ def slave_addresses(self):
+ return self._slave_addresses
+
+ @property
def stack_id(self):
self._get_stack_info()
return self._cached_stack_id
@@ -167,6 +172,12 @@ class StorPerfMaster(object):
vm1.instance_settings.availability_zone
self._agent_flavor = vm1.instance_settings.flavor.name
+ self._slave_addresses = []
+ for instance in vm_inst_creators:
+ floating_ip = instance.get_floating_ip()
+ self._slave_addresses.append(floating_ip.ip)
+ self.logger.debug("Found VM at %s" % floating_ip.ip)
+
server = vm1.get_vm_inst()
image_id = server.image_id
@@ -251,7 +262,8 @@ class StorPerfMaster(object):
@property
def is_stack_created(self):
return (self.stack_id is not None and
- self.heat_stack.get_status() == u'CREATE_COMPLETE')
+ (self.heat_stack.get_status() == u'CREATE_COMPLETE' or
+ self.heat_stack.get_status() == u'UPDATE_COMPLETE'))
@property
def workloads(self):
@@ -328,8 +340,7 @@ class StorPerfMaster(object):
raise Exception("ERROR: Job {} is already running".format(
self._test_executor.job_id))
- outputs = self.heat_stack.get_outputs()
- slaves = outputs[0].value
+ slaves = self._slave_addresses
setup_threads = []