]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: unmount osd data directories
authorSage Weil <sage@newdream.net>
Tue, 6 Mar 2012 17:34:38 +0000 (09:34 -0800)
committerSage Weil <sage@newdream.net>
Tue, 6 Mar 2012 17:34:38 +0000 (09:34 -0800)
This helps us avoid reboot to clean up osd data directories that are left
mounted.

teuthology/nuke.py

index acefe280a3804b3700d9dfb154b70f92e3d6fdd6..bac300c4a378332f5777db8519fd34e856257bed 100644 (file)
@@ -130,6 +130,20 @@ def remove_kernel_mounts(ctx, kernel_mounts, log):
     for remote, proc in nodes:
         proc.exitstatus.get()
 
+def remove_osd_mounts(ctx, log):
+    """
+    unmount any osd data mounts (scratch disks)
+    """
+    from .orchestra import run
+    ctx.cluster.run(
+        args=[
+            'grep', '/tmp/cephtest/data/', '/etc/mtab', run.Raw('|'),
+            'awk', '{print $2}', run.Raw('|'),
+            'xargs', 'sudo', 'umount', run.Raw(';'),
+            'true'
+            ],
+        )
+
 def reboot(ctx, remotes, log):
     import time
     nodes = {}
@@ -248,6 +262,9 @@ def nuke(ctx, log):
     shutdown_daemons(ctx, log)
     log.info('All daemons killed.')
 
+    log.info('Unmount any osd data directories...')
+    remove_osd_mounts(ctx, log)
+
     log.info('Dealing with any kernel mounts...')
     kernel_mounts = find_kernel_mounts(ctx, log)
     #remove_kernel_mounts(ctx, kernel_mounts, log)