From 9d09061d96f1bcc1fc553a1554fd8dd52e15c034 Mon Sep 17 00:00:00 2001 From: Yichen Wang Date: Thu, 3 Dec 2015 15:19:50 -0800 Subject: [PATCH] Bug fixes for alpha releases 1. Document enhancements on stand profiling; 2. Synchornize polling interval with report interval when calling from Web UI; 3. Fix the bug which prevent doing multiple progression runs; 4. Isolate logs from different sessions if multiple are running; Change-Id: Ie2b8a499a942f95a5c7ec80405ce2db10cc8ebdc --- doc/source/usage.rst | 48 ++++++++++++++++++- .../kloudbuster/post-install.d/01-kb-script | 1 + kb_server/kb_server/controllers/api_cfg.py | 7 +++ kloudbuster/kb_runner.py | 1 + kloudbuster/kloudbuster.py | 3 +- kloudbuster/log.py | 9 ++-- 6 files changed, 61 insertions(+), 8 deletions(-) diff --git a/doc/source/usage.rst b/doc/source/usage.rst index ed476b6..f0702ef 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -387,4 +387,50 @@ KloudBuster can run to. As a reference, for a Kilo OpenStack deployment (LinuxBridge + VLAN) with Packstack, using an 10GE NIC card for data plane traffic, KloudBuster can run -up to 18 VMs and achieve approximately 5 GBps throughput. +apprximately 21 VMs and achieve approximately 5 GBps throughput. + +How-to +^^^^^^ + +In order to run KloudBuster Standard Profiling, you have to set up below +configurations: + +1. Enable progression runs: + + Running from CLI: Edit the config file, and set + **client:progression:enabled** to True + + Running from Web UI: Navigate to "Interactive Mode" from the top menu + bar, unfold the left panel for detail settings, under "Progression Test" + section, and check the "Progression Test" checkbox. + +2. Set up the max scale: + + The max scale basically means the max VM counts that KloudBuster will + try to reach. For a typical 10GE NIC card with VLAN encapsulation, + 25 will be a good value. Adjust it to a reasonable value based on + your deployment details. + + Running from CLI: Edit the config file, and set **server:vms_per_network** + to a proper value. + + Running from Web UI: Navigate to "Interactive Mode" from the top menu + bar, unfold the left panel for detail settings, under "Staging Settings" + section, and set "VMs/Network" to a proper value. + + +Intepret the results +^^^^^^^^^^^^^^^^^^^^ + +From the CLI, check the log and find the warning that KloudBuster gave, +similar to this:: + + WARNING KloudBuster is stopping the iteration because the result reaches the stop limit. + +One line before is the json output of last successful run, which has the +number in the "total_server_vms" field. + +From the Web UI, in ihe "Interactive Mode" tab, you will see how many sets +of data are you getting. The second last set of data shows the last successful +run, which has the number in the "Server VMs" column. + diff --git a/kb_dib/elements/kloudbuster/post-install.d/01-kb-script b/kb_dib/elements/kloudbuster/post-install.d/01-kb-script index a2cb683..9b0508a 100755 --- a/kb_dib/elements/kloudbuster/post-install.d/01-kb-script +++ b/kb_dib/elements/kloudbuster/post-install.d/01-kb-script @@ -90,6 +90,7 @@ npm install -g grunt-cli bower npm install bower install --allow-root --config.interactive=false --force grunt build +rm -rf ../kb_server/public/ui/* mv dist/* ../kb_server/public/ui diff --git a/kb_server/kb_server/controllers/api_cfg.py b/kb_server/kb_server/controllers/api_cfg.py index 323efcf..f8af7a9 100644 --- a/kb_server/kb_server/controllers/api_cfg.py +++ b/kb_server/kb_server/controllers/api_cfg.py @@ -70,6 +70,13 @@ class ConfigController(object): tenants_list = AttrDict(user_config['tenants_list'])\ if 'tenants_list' in user_config else None + # Synchronize the polling interval with report interval + try: + alt_config['kb_cfg']['client']['polling_interval'] = \ + alt_config['kb_cfg']['client']['http_tool_config']['report_interval'] + except Exception: + pass + key = ['alt_cfg', 'topo_cfg', 'tenants_list'] val = [alt_config, topo_cfg, tenants_list] kwargs = dict([(k, v) for k, v in zip(key, val) if v]) diff --git a/kloudbuster/kb_runner.py b/kloudbuster/kb_runner.py index f81c419..5f26afe 100644 --- a/kloudbuster/kb_runner.py +++ b/kloudbuster/kb_runner.py @@ -306,6 +306,7 @@ class KBRunner(object): raise KBException("Some VMs failed to start.") if self.config.progression.enabled: + self.tool_result = {} start = self.config.progression.vm_start step = self.config.progression.vm_step limit = self.config.progression.stop_limit diff --git a/kloudbuster/kloudbuster.py b/kloudbuster/kloudbuster.py index fed7d7c..a30103a 100755 --- a/kloudbuster/kloudbuster.py +++ b/kloudbuster/kloudbuster.py @@ -505,7 +505,8 @@ class KloudBuster(object): def dispose(self): if self.fp_logfile: self.fp_logfile.close() - logging.delete_logfile('kloudbuster') + logging.delete_logfile('kloudbuster', self.fp_logfile.name) + self.fp_logfile = None def get_tenant_vm_count(self, config): return (config['routers_per_tenant'] * config['networks_per_router'] * diff --git a/kloudbuster/log.py b/kloudbuster/log.py index 72efaa8..502774a 100644 --- a/kloudbuster/log.py +++ b/kloudbuster/log.py @@ -52,7 +52,6 @@ def setup(product_name, logfile=None): if logfile: if os.path.exists(logfile): os.remove(logfile) - CONF.log_file = logfile fmt = logging.Formatter(fmt=CONF.logging_default_format_string) hdlr = logging.FileHandler(logfile) hdlr.setFormatter(fmt) @@ -73,11 +72,9 @@ def getLogger(name="unknown", version="unknown"): return oslogging._loggers[name] -def delete_logfile(product_name): - if CONF.log_file and os.path.exists(CONF.log_file): - os.remove(CONF.log_file) - CONF.log_file = None - +def delete_logfile(product_name, filename): + if filename and os.path.exists(filename): + os.remove(filename) class KloudBusterContextAdapter(oslogging.KeywordArgumentAdapter):