From 2a18c3e1d016dc20d566ca60830e49f76aad6750 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 6 Mar 2012 09:34:38 -0800 Subject: [PATCH] nuke: unmount osd data directories This helps us avoid reboot to clean up osd data directories that are left mounted. --- teuthology/nuke.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/teuthology/nuke.py b/teuthology/nuke.py index acefe280a3..bac300c4a3 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -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) -- 2.39.5