"""
-Ceph cluster task, deployed via ceph-daemon and ssh orchestrator
+Ceph cluster task, deployed via cephadm and ssh orchestrator
"""
from cStringIO import StringIO
return remote.run(
args=[
'sudo',
- ctx.ceph_daemon,
+ ctx.cephadm,
'--image', ctx.ceph[cluster_name].image,
'shell',
'-c', '{}/{}.conf'.format(testdir, cluster_name),
def normalize_hostnames(ctx):
"""
Ensure we have short hostnames throughout, for consistency between
- remote.shortname and socket.gethostname() in ceph-daemon.
+ remote.shortname and socket.gethostname() in cephadm.
"""
log.info('Normalizing hostnames...')
ctx.cluster.run(args=[
pass
@contextlib.contextmanager
-def download_ceph_daemon(ctx, config, ref):
+def download_cephadm(ctx, config, ref):
cluster_name = config['cluster']
testdir = teuthology.get_testdir(ctx)
run.Raw('|'),
'tar', '-xO', 'src/cephadm/cephadm',
run.Raw('>'),
- ctx.ceph_daemon,
+ ctx.cephadm,
run.Raw('&&'),
'test', '-s',
- ctx.ceph_daemon,
+ ctx.cephadm,
run.Raw('&&'),
'chmod', '+x',
- ctx.ceph_daemon,
+ ctx.cephadm,
],
)
log.info('Removing cluster...')
ctx.cluster.run(args=[
'sudo',
- ctx.ceph_daemon,
+ ctx.cephadm,
'rm-cluster',
'--fsid', ctx.ceph[cluster_name].fsid,
'--force',
args=[
'rm',
'-rf',
- ctx.ceph_daemon,
+ ctx.cephadm,
],
)
log.info('Bootstrapping...')
cmd = [
'sudo',
- ctx.ceph_daemon,
+ ctx.cephadm,
'--image', ctx.ceph[cluster_name].image,
'bootstrap',
'--fsid', fsid,
config['cephadm_mode'] = 'root'
assert config['cephadm_mode'] in ['root', 'cephadm-package']
if config['cephadm_mode'] == 'root':
- ctx.ceph_daemon = testdir + '/cephadm'
+ ctx.cephadm = testdir + '/cephadm'
else:
- ctx.ceph_daemon = 'cephadm' # in the path
+ ctx.cephadm = 'cephadm' # in the path
if first_ceph_cluster:
# FIXME: this is global for all clusters
ctx.daemons = DaemonGroup(
- use_ceph_daemon=ctx.ceph_daemon)
+ use_cephadm=ctx.cephadm)
# image
ctx.ceph[cluster_name].image = config.get('image')
with contextutil.nested(
lambda: ceph_initial(),
lambda: normalize_hostnames(ctx=ctx),
- lambda: download_ceph_daemon(ctx=ctx, config=config,
- ref=ref),
+ lambda: download_cephadm(ctx=ctx, config=config, ref=ref),
lambda: ceph_log(ctx=ctx, config=config),
lambda: ceph_crash(ctx=ctx, config=config),
lambda: ceph_bootstrap(ctx=ctx, config=config),
ctx=ctx,
logger=log.getChild('ceph_manager.' + cluster_name),
cluster=cluster_name,
- ceph_daemon=True,
+ cephadm=True,
)
try:
log = logging.getLogger(__name__)
-# this is for ceph-daemon clusters
+# this is for cephadm clusters
def shell(ctx, cluster_name, remote, args, **kwargs):
testdir = teuthology.get_testdir(ctx)
return remote.run(
args=[
'sudo',
- ctx.ceph_daemon,
+ ctx.cephadm,
'--image', ctx.ceph[cluster_name].image,
'shell',
'-c', '{}/{}.conf'.format(testdir, cluster_name),
"""
def __init__(self, controller, ctx=None, config=None, logger=None,
- cluster='ceph', ceph_daemon=False):
+ cluster='ceph', cephadm=False):
self.lock = threading.RLock()
self.ctx = ctx
self.config = config
self.controller = controller
self.next_pool_id = 0
self.cluster = cluster
- self.ceph_daemon = ceph_daemon
+ self.cephadm = cephadm
if (logger):
self.log = lambda x: logger.info(x)
else:
"""
Start ceph on a raw cluster. Return count
"""
- if self.ceph_daemon:
+ if self.cephadm:
proc = shell(self.ctx, self.cluster, self.controller,
args=['ceph'] + list(args),
stdout=StringIO())
"""
Start ceph on a cluster. Return success or failure information.
"""
- if self.ceph_daemon:
+ if self.cephadm:
proc = shell(self.ctx, self.cluster, self.controller,
args=['ceph'] + list(args),
check_status=False)