From: Sandon Van Ness Date: Thu, 4 Jul 2013 02:07:35 +0000 (-0700) Subject: Fix VM issues. X-Git-Tag: 1.1.0~2093 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d54932cbc8c6dbb065a1ea5d407209f66bffd961;p=teuthology.git Fix VM issues. Fix of #5494 although bad description. Instead of adding a wait the code used to detect if the guest was back up is fixed. The previous code appeared to assume only one machine and broke when it was waiting for multiple machines if the guests did not come up within 10 seconds of each other Make nuke not do the normal stuff if the machine is a VPS as we just destroy them when they get unlocked. Instead of getting downburst options from ~/.teuthology.yaml get it from the yaml given to teuthology for the test/task instead. Fixed an error that would make all the default downburst values not take effect if any of them were set via a yaml. Signed-off-by: Sandon Van Ness Reviewed-by: Warren Usui --- diff --git a/teuthology/lock.py b/teuthology/lock.py index a716bfcbd..0f8f69f23 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -458,7 +458,7 @@ def keyscan_check(ctx, machines): stdout=subprocess.PIPE, ) out, _ = p.communicate() - assert p.returncode == 0, 'ssh-keyscan failed' + #assert p.returncode == 0, 'ssh-keyscan failed' return (out, current_locks) def update_keys(ctx, out, current_locks): @@ -543,22 +543,24 @@ def create_if_vm(ctx, machine_name): vm_type = 'ubuntu' createMe = decanonicalize_hostname(machine_name) with tempfile.NamedTemporaryFile() as tmp: - lcnfg = ctx.teuthology_config - file_out = lcnfg.get('downburst') - if not file_out: - file_info = {} - file_info['disk-size'] = lcnfg.get('disk-size', '30G') - file_info['ram'] = lcnfg.get('ram', '1.9G') - file_info['cpus'] = lcnfg.get('cpus', 1) - file_info['networks'] = lcnfg.get('networks', - [{'source' : 'front'}]) - file_info['distro'] = lcnfg.get('distro', vm_type.lower()) - file_info['additional-disks'] = lcnfg.get( - 'additional-disks', 3) - file_info['additional-disks-size'] = lcnfg.get( - 'additional-disks-size', '200G') - file_info['arch'] = lcnfg.get('arch', 'x86_64') - file_out = {'downburst': file_info} + try: + lcnfg = ctx.config['downburst'] + except KeyError: + lcnfg = {} + + file_info = {} + file_info['disk-size'] = lcnfg.get('disk-size', '30G') + file_info['ram'] = lcnfg.get('ram', '1.9G') + file_info['cpus'] = lcnfg.get('cpus', 1) + file_info['networks'] = lcnfg.get('networks', + [{'source' : 'front'}]) + file_info['distro'] = lcnfg.get('distro', vm_type.lower()) + file_info['additional-disks'] = lcnfg.get( + 'additional-disks', 3) + file_info['additional-disks-size'] = lcnfg.get( + 'additional-disks-size', '200G') + file_info['arch'] = lcnfg.get('arch', 'x86_64') + file_out = {'downburst': file_info} yaml.safe_dump(file_out, tmp) metadata = "--meta-data=%s" % tmp.name dbrst = _get_downburst_exec() diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 5a8efae28..d2ef14f9b 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -413,6 +413,8 @@ def nuke_helper(ctx, log): (target,) = ctx.config['targets'].keys() host = target.split('@')[-1] shortname = host.split('.')[0] + if 'vpm' in shortname: + return log.debug('shortname: %s' % shortname) log.debug('{ctx}'.format(ctx=ctx)) if not ctx.noipmi and 'ipmi_user' in ctx.teuthology_config: diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index dae1217d3..91692fcfb 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -103,7 +103,7 @@ def lock_machines(ctx, config): if vmlist: log.info('Waiting for virtual machines to come up') keyscan_out = '' - while not keyscan_out: + while len(keyscan_out.splitlines()) != len(vmlist): time.sleep(10) keyscan_out, current_locks = lock.keyscan_check(ctx, vmlist) log.info('virtual machine is stil unavailable')