diff options
author | Mark Beierl <mark.beierl@dell.com> | 2018-07-13 17:34:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-07-13 17:34:42 +0000 |
commit | f96c968bb5e8149354a3f31c6e704ce821e5d813 (patch) | |
tree | ac9a742080ac8edf652efd1ce8e599fe4d8469bf /docker/storperf-master | |
parent | 57951825e36f7eeb81c26ce6dca2f0cace7c919f (diff) | |
parent | 65f7a44701322be2217116368da8041b96da1250 (diff) |
Merge "Collect slave info"
Diffstat (limited to 'docker/storperf-master')
-rw-r--r-- | docker/storperf-master/storperf/storperf_master.py | 13 | ||||
-rw-r--r-- | docker/storperf-master/storperf/test_executor.py | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/docker/storperf-master/storperf/storperf_master.py b/docker/storperf-master/storperf/storperf_master.py index 88802b1..b17dae9 100644 --- a/docker/storperf-master/storperf/storperf_master.py +++ b/docker/storperf-master/storperf/storperf_master.py @@ -24,6 +24,7 @@ from snaps.openstack.utils import heat_utils, cinder_utils, glance_utils from snaps.thread_utils import worker_pool from storperf.db.job_db import JobDB from storperf.test_executor import TestExecutor +import json class ParameterError(Exception): @@ -79,6 +80,7 @@ class StorPerfMaster(object): self._block_sizes = [512, 4096, 16384] self._workload_modules = [] self._custom_workloads = [] + self.slave_info = {} @property def volume_count(self): @@ -429,12 +431,14 @@ class StorPerfMaster(object): params['public_network'] = self.public_network params['volume_count'] = self.volume_count params['volume_size'] = self.volume_size + params['agent_info'] = json.dumps(self.slave_info) if self.volume_type is not None: params['volume_type'] = self.volume_type if self.username and self.password: params['username'] = self.username params['password'] = self.password job_id = self._test_executor.execute(params) + self.slave_info = {} return job_id @@ -524,6 +528,11 @@ class StorPerfMaster(object): key_filename='storperf/resources/ssh/storperf_rsa', timeout=2) + uname = self._get_uname(ssh) + logger.debug("Slave uname is %s" % uname) + self.slave_info[slave] = {} + self.slave_info[slave]['uname'] = uname + available = self._check_root_fs(ssh) logger.debug("Available space on / is %s" % available) if available < 65536: @@ -541,6 +550,10 @@ class StorPerfMaster(object): logger.debug("Transferring fio to %s" % slave) scp.put('/usr/local/bin/fio', '~/') + def _get_uname(self, ssh): + (_, stdout, _) = ssh.exec_command("uname -a") + return stdout.readline() + def _check_root_fs(self, ssh): (_, stdout, _) = ssh.exec_command("df /") stdout.readline() diff --git a/docker/storperf-master/storperf/test_executor.py b/docker/storperf-master/storperf/test_executor.py index 38e052e..0ab5698 100644 --- a/docker/storperf-master/storperf/test_executor.py +++ b/docker/storperf-master/storperf/test_executor.py @@ -69,7 +69,7 @@ class TestExecutor(object): try: installer = os.environ['INSTALLER_TYPE'] except KeyError: - self.logger.error("Cannot determine installer") + self.logger.warn("Cannot determine installer") installer = "Unknown_installer" self.metadata = {} |