]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
ceph_manager: randomly reweight in osds 248/head
authorSage Weil <sage@inktank.com>
Fri, 2 May 2014 23:32:53 +0000 (16:32 -0700)
committerSage Weil <sage@inktank.com>
Fri, 2 May 2014 23:32:53 +0000 (16:32 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/task/ceph_manager.py

index 2778358e5fb72997c887f191878b9fd5a1ae4451..7ed01d070d68d71c07484c84da4bf87bee249f6a 100644 (file)
@@ -123,6 +123,17 @@ class Thrasher:
         self.ceph_manager.mark_in_osd(osd)
         self.log("Added osd %s"%(str(osd),))
 
+    def reweight_osd(self, osd=None):
+        """
+        Reweight an osd that is in
+        :param osd: Osd to be marked.
+        """
+        if osd is None:
+            osd = random.choice(self.in_osds)
+        val = random.uniform(.1, 1.0)
+        self.log("Reweighting osd %s to %f" % (str(osd), val))
+        self.raw_cluster_cmd('osd', 'reweight', str(osd), val)
+
     def primary_affinity(self, osd=None):
         if osd is None:
             osd = random.choice(self.in_osds)
@@ -320,6 +331,7 @@ class Thrasher:
             actions.append((self.revive_osd, 1.0,))
         if self.config.get('thrash_primary_affinity', True):
             actions.append((self.primary_affinity, 1.0,))
+        actions.append((self.reweight_osd, self.config.get('reweight_osd',.5),))
         actions.append((self.grow_pool, self.config.get('chance_pgnum_grow', 0),))
         actions.append((self.fix_pgp_num, self.config.get('chance_pgpnum_fix', 0),))
         actions.append((self.test_pool_min_size, chance_test_min_size,))