Add io_file_size for running storage test

1. Add io_file_size for running storage test;
2. Use fio itself to generate io files instead of using dd with /dev/zero;

Change-Id: I1c3c81f9d6676813c7db443a56848908ee4052be
This commit is contained in:
Yichen Wang 2016-03-04 14:31:36 -08:00
parent f858288df9
commit 0f73b7a946
3 changed files with 18 additions and 7 deletions

View File

@ -116,12 +116,13 @@ class KB_Instance(object):
# Init volume
@staticmethod
def init_volume(size):
def init_volume(dest_path, size):
cmd = 'if [ ! -e /mnt/volume ]; then\n'
cmd += 'mkfs.xfs /dev/vdb && '
cmd += 'mkdir -p /mnt/volume && '
cmd += 'mount /dev/vdb /mnt/volume && '
cmd += 'dd if=/dev/zero of=/mnt/volume/kb_storage_test.bin bs=%s count=1\n' % size
cmd += '%s --name=create_file --filename=/mnt/volume/kb_storage_test.bin '\
'--size=%s --create_only=1\n' % (dest_path, size)
cmd += 'fi'
return cmd
@ -328,7 +329,7 @@ class KBA_Storage_Client(KBA_Client):
return json.dumps(p_output)
def exec_init_volume(self, size):
self.last_cmd = KB_Instance.init_volume(size)
self.last_cmd = KB_Instance.init_volume('/usr/local/bin/fio', size)
return self.exec_command(self.last_cmd)
def exec_run_storage_test(self, fio_configs):

View File

@ -111,6 +111,7 @@ client:
# e.g. KloudBuster will run iterations on below sequences:
# {'vm_start': 1, 'vm_multiple': 2}: 1, 2, 4, 6, 8... [DEFAULT]
# {'vm_start': 1, 'vm_multiple': 5}: 1, 5, 10, 15, 20...
# {'vm_start': 0, 'vm_multiple': 1}: 1, 2, 3, 4, 5...
# {'vm_start': 0, 'vm_multiple': 5}: 5, 10, 15, 20...
vm_multiple: 2
# The stop condition for HTTP benchmarking, it is used for KloudBuster to
@ -211,11 +212,13 @@ client:
# Storage tool specific configs (per VM)
# Multiple factors can impact the storage performance numbers, and KloudBuster is defining
# a default profile which consists of four testing scenarios:
# a default profile which consists of six testing scenarios:
# (1) Random read
# (2) Random write
# (3) Sequential read
# (4) Sequential write
# (3) Random mixed read/write
# (4) Sequential read
# (5) Sequential write
# (6) Sequential mixed read/write
#
# Accepted testing parameters for each scenario:
# description: (Required)
@ -281,5 +284,12 @@ client:
# Will effect only in storage testing mode
volume_size: 1
# The size of the test file for doing IO tests in GiB
# Note: Due to the unit calculation difference and the overhead of the
# filesystem, the actual available space for data will be smaller than the
# volume size. So we picked GiB as the unit for laying out the test file,
# which normally should be fine.
io_file_size: 1
# Prompt before running benchmarking tools
prompt_before_run: False

View File

@ -72,7 +72,7 @@ class KBRunner_Storage(KBRunner):
def init_volume(self, active_range, timeout=30):
func = {'cmd': 'init_volume', 'active_range': active_range,
'parameter': str(self.config.volume_size) + 'GB'}
'parameter': str(self.config.io_file_size) + 'GiB'}
self.send_cmd('EXEC', 'storage', func)
cnt_succ = self.polling_vms(timeout)[0]
if cnt_succ != len(self.client_dict):