"""
config = config if isinstance(config, dict) else dict()
cluster_name = config.get('cluster', 'ceph')
- log.info('Waiting until ceph cluster %s is healthy...', cluster_name)
+ log.info('Waiting until %s daemons up and pgs clean...', cluster_name)
+ manager = ctx.managers[cluster_name]
+ try:
+ manager.wait_for_mgr_available()
+ except run.CommandFailedError:
+ log.info('ignoring mgr wait error, probably testing upgrade')
+
firstmon = teuthology.get_first_mon(ctx, config, cluster_name)
(mon0_remote,) = ctx.cluster.only(firstmon).remotes.keys()
teuthology.wait_until_osds_up(
remote=mon0_remote,
ceph_cluster=cluster_name,
)
+
+ try:
+ manager.flush_all_pg_stats()
+ except run.CommandFailedError:
+ log.info('ignoring flush pg stats error, probably testing upgrade')
+ manager.wait_for_clean()
+
+ log.info('Waiting until ceph cluster %s is healthy...', cluster_name)
teuthology.wait_until_healthy(
ctx,
remote=mon0_remote,
"""
return self.get_osd_dump_json()['osds']
+ def get_mgr_dump(self):
+ out = self.raw_cluster_cmd('mgr', 'dump', '--format=json')
+ return json.loads(out)
+
def get_stuck_pgs(self, type_, threshold):
"""
:returns: stuck pg information from the cluster
for pool in pools:
self.wait_for_pool(pool)
+ def is_mgr_available(self):
+ x = self.get_mgr_dump()
+ return x.get('available', False)
+
+ def wait_for_mgr_available(self, timeout=None):
+ self.log("waiting for mgr available")
+ start = time.time()
+ while not self.is_mgr_available():
+ if timeout is not None:
+ assert time.time() - start < timeout, \
+ 'timeout expired in wait_for_mgr_available'
+ time.sleep(3)
+ self.log("mgr available!")
+
def wait_for_recovery(self, timeout=None):
"""
Check peering. When this exists, we have recovered.