]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/ceph: Recreate /var/run/ceph on powercycle
authorSam Lang <sam.lang@inktank.com>
Wed, 13 Mar 2013 03:17:16 +0000 (22:17 -0500)
committerSam Lang <sam.lang@inktank.com>
Wed, 13 Mar 2013 03:21:01 +0000 (22:21 -0500)
If a node is powecycled during testing, we need to
recreate /var/run/ceph once the node restarts.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
teuthology/task/ceph.py
teuthology/task/ceph_manager.py

index f238c6302c73b326603d9c5c5ac3760c5be5771b..8ca50994045bfa23c839d8e317c9d20a29d9fe48 100644 (file)
@@ -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)
index 5764682be4510f5e1ef18fdec8a1c687fcffd41a..fbdbb6d07ec67cc0881905156985bb9bdf5dc8e3 100644 (file)
@@ -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])