From 5ef2a04137a4924db94db0ee7d46d7ba6ed63b4c Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Tue, 12 Mar 2013 22:17:16 -0500 Subject: [PATCH] task/ceph: Recreate /var/run/ceph on powercycle If a node is powecycled during testing, we need to recreate /var/run/ceph once the node restarts. Signed-off-by: Sam Lang --- teuthology/task/ceph.py | 8 ++++++++ teuthology/task/ceph_manager.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index f238c6302c73b..8ca50994045bf 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -232,6 +232,14 @@ def mount_osd_data(ctx, remote, osd): remote.run( args=[ 'sudo', 'mount', '-t', 'tmpfs', 'tmpfs', '/mnt' ] ) remote.run( args=[ 'truncate', '-s', '1500M', tmpfs ] ) +def make_admin_daemon_dir(ctx, remote): + remote.run( + args=[ + 'sudo', + 'install', '-d', '-m0777', '--', '/var/run/ceph', + ], + ) + @contextlib.contextmanager def cluster(ctx, config): testdir = teuthology.get_testdir(ctx) diff --git a/teuthology/task/ceph_manager.py b/teuthology/task/ceph_manager.py index 5764682be4510..fbdbb6d07ec67 100644 --- a/teuthology/task/ceph_manager.py +++ b/teuthology/task/ceph_manager.py @@ -684,6 +684,7 @@ class CephManager: raise Exception('Failed to revive osd.{o} via ipmi'.format(o=osd)) teuthology.reconnect(self.ctx, 60) ceph_task.mount_osd_data(self.ctx, remote, osd) + ceph_task.make_admin_daemon_dir(self.ctx, remote) self.ctx.daemons.get_daemon('osd', osd).reset() self.ctx.daemons.get_daemon('osd', osd).restart() self.wait_run_admin_socket(osd) @@ -710,6 +711,7 @@ class CephManager: (remote,) = self.ctx.cluster.only('mon.{m}'.format(m=mon)).remotes.iterkeys() self.log('revive_mon on mon.{m} doing powercycle of {s}'.format(m=mon, s=remote.name)) remote.console.power_on() + ceph_task.make_admin_daemon_dir(self.ctx, remote) self.ctx.daemons.get_daemon('mon', mon).restart() def get_mon_status(self, mon): @@ -758,6 +760,7 @@ class CephManager: (remote,) = self.ctx.cluster.only('mds.{m}'.format(m=mds)).remotes.iterkeys() self.log('revive_mds on mds.{m} doing powercycle of {s}'.format(m=mds, s=remote.name)) remote.console.power_on() + ceph_task.make_admin_daemon_dir(self.ctx, remote) args = [] if standby_for_rank: args.extend(['--hot-standby', standby_for_rank]) -- 2.39.5