]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix VM issues.
authorSandon Van Ness <sandon@inktank.com>
Thu, 4 Jul 2013 02:07:35 +0000 (19:07 -0700)
committerSandon Van Ness <sandon@inktank.com>
Thu, 4 Jul 2013 02:07:35 +0000 (19:07 -0700)
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 <sandon@inktank.com>
Reviewed-by: Warren Usui <warren.usui@inktank.com>
teuthology/lock.py
teuthology/nuke.py
teuthology/task/internal.py

index a716bfcbd846c70ac0b75e4a0b22f3377689ab08..0f8f69f232c4bae75cd3b0e18053bd8f49ba059c 100644 (file)
@@ -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()
index 5a8efae28c5a323bfac1e70e78f66c9fd891e2e1..d2ef14f9b23b925db9fa6dd648a2e54627142232 100644 (file)
@@ -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:
index dae1217d35937644569083f81943fa0d506ae36b..91692fcfb941a7d134ba0f2fa0f703fb2071dddf 100644 (file)
@@ -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')