2013-10-12 08:28:27 +00:00
|
|
|
"""
|
|
|
|
Execute ceph-deploy as a task
|
|
|
|
"""
|
2013-03-08 01:56:29 +00:00
|
|
|
from cStringIO import StringIO
|
|
|
|
|
|
|
|
import contextlib
|
|
|
|
import os
|
|
|
|
import time
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from teuthology import misc as teuthology
|
|
|
|
from teuthology import contextutil
|
2013-09-24 19:19:24 +00:00
|
|
|
from ..config import config as teuth_config
|
2013-03-08 01:56:29 +00:00
|
|
|
import ceph as ceph_fn
|
|
|
|
from ..orchestra import run
|
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
2013-08-13 15:32:15 +00:00
|
|
|
|
2013-03-08 01:56:29 +00:00
|
|
|
@contextlib.contextmanager
|
|
|
|
def download_ceph_deploy(ctx, config):
|
2013-08-13 15:32:15 +00:00
|
|
|
"""
|
|
|
|
Downloads ceph-deploy from the ceph.com git mirror and (by default)
|
|
|
|
switches to the master branch. If the `ceph-deploy-branch` is specified, it
|
|
|
|
will use that instead.
|
|
|
|
"""
|
2013-03-08 01:56:29 +00:00
|
|
|
log.info('Downloading ceph-deploy...')
|
|
|
|
testdir = teuthology.get_testdir(ctx)
|
|
|
|
ceph_admin = teuthology.get_first_mon(ctx, config)
|
2013-08-13 15:32:15 +00:00
|
|
|
default_cd_branch = {'ceph-deploy-branch': 'master'}
|
2013-08-16 01:39:43 +00:00
|
|
|
ceph_deploy_branch = config.get(
|
2013-08-13 15:32:15 +00:00
|
|
|
'ceph-deploy',
|
2013-08-13 15:56:37 +00:00
|
|
|
default_cd_branch).get('ceph-deploy-branch')
|
2013-03-08 01:56:29 +00:00
|
|
|
|
|
|
|
ctx.cluster.only(ceph_admin).run(
|
|
|
|
args=[
|
2013-08-06 22:17:51 +00:00
|
|
|
'git', 'clone', '-b', ceph_deploy_branch,
|
2013-09-24 19:19:24 +00:00
|
|
|
teuth_config.ceph_git_base_url + 'ceph-deploy.git',
|
2013-03-08 01:56:29 +00:00
|
|
|
'{tdir}/ceph-deploy'.format(tdir=testdir),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
ctx.cluster.only(ceph_admin).run(
|
|
|
|
args=[
|
|
|
|
'cd',
|
|
|
|
'{tdir}/ceph-deploy'.format(tdir=testdir),
|
|
|
|
run.Raw('&&'),
|
|
|
|
'./bootstrap',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
try:
|
|
|
|
yield
|
|
|
|
finally:
|
|
|
|
log.info('Removing ceph-deploy ...')
|
|
|
|
ctx.cluster.only(ceph_admin).run(
|
|
|
|
args=[
|
|
|
|
'rm',
|
|
|
|
'-rf',
|
|
|
|
'{tdir}/ceph-deploy'.format(tdir=testdir),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2013-08-13 15:32:15 +00:00
|
|
|
|
2013-03-08 01:56:29 +00:00
|
|
|
def is_healthy(ctx, config):
|
|
|
|
"""Wait until a Ceph cluster is healthy."""
|
|
|
|
testdir = teuthology.get_testdir(ctx)
|
|
|
|
ceph_admin = teuthology.get_first_mon(ctx, config)
|
|
|
|
(remote,) = ctx.cluster.only(ceph_admin).remotes.keys()
|
2013-12-13 19:46:29 +00:00
|
|
|
max_tries = 90 # 90 tries * 10 secs --> 15 minutes
|
|
|
|
tries = 0
|
2013-03-08 01:56:29 +00:00
|
|
|
while True:
|
2013-12-13 19:46:29 +00:00
|
|
|
tries += 1
|
|
|
|
if tries >= max_tries:
|
|
|
|
msg = "ceph health was unable to get 'HEALTH_OK' after waiting 15 minutes"
|
|
|
|
raise RuntimeError(msg)
|
|
|
|
|
2013-03-08 01:56:29 +00:00
|
|
|
r = remote.run(
|
|
|
|
args=[
|
|
|
|
'cd',
|
|
|
|
'{tdir}'.format(tdir=testdir),
|
|
|
|
run.Raw('&&'),
|
|
|
|
'sudo', 'ceph',
|
|
|
|
'health',
|
|
|
|
],
|
|
|
|
stdout=StringIO(),
|
|
|
|
logger=log.getChild('health'),
|
|
|
|
)
|
|
|
|
out = r.stdout.getvalue()
|
|
|
|
log.debug('Ceph health: %s', out.rstrip('\n'))
|
|
|
|
if out.split(None, 1)[0] == 'HEALTH_OK':
|
|
|
|
break
|
2013-12-13 19:46:29 +00:00
|
|
|
time.sleep(10)
|
2013-03-08 01:56:29 +00:00
|
|
|
|
|
|
|
def get_nodes_using_roles(ctx, config, role):
|
2013-10-12 08:28:27 +00:00
|
|
|
"""Extract the names of nodes that match a given role from a cluster"""
|
2013-03-08 01:56:29 +00:00
|
|
|
newl = []
|
|
|
|
for _remote, roles_for_host in ctx.cluster.remotes.iteritems():
|
|
|
|
for id_ in teuthology.roles_of_type(roles_for_host, role):
|
|
|
|
rem = _remote
|
|
|
|
if role == 'mon':
|
|
|
|
req1 = str(rem).split('@')[-1]
|
|
|
|
else:
|
|
|
|
req = str(rem).split('.')[0]
|
|
|
|
req1 = str(req).split('@')[1]
|
|
|
|
newl.append(req1)
|
|
|
|
return newl
|
|
|
|
|
|
|
|
def get_dev_for_osd(ctx, config):
|
2013-10-12 08:28:27 +00:00
|
|
|
"""Get a list of all osd device names."""
|
2013-03-08 01:56:29 +00:00
|
|
|
osd_devs = []
|
|
|
|
for remote, roles_for_host in ctx.cluster.remotes.iteritems():
|
|
|
|
host = remote.name.split('@')[-1]
|
|
|
|
shortname = host.split('.')[0]
|
|
|
|
devs = teuthology.get_scratch_devices(remote)
|
|
|
|
num_osd_per_host = list(teuthology.roles_of_type(roles_for_host, 'osd'))
|
|
|
|
num_osds = len(num_osd_per_host)
|
|
|
|
assert num_osds <= len(devs), 'fewer disks than osds on ' + shortname
|
|
|
|
for dev in devs[:num_osds]:
|
|
|
|
dev_short = dev.split('/')[-1]
|
|
|
|
osd_devs.append('{host}:{dev}'.format(host=shortname, dev=dev_short))
|
|
|
|
return osd_devs
|
|
|
|
|
|
|
|
def get_all_nodes(ctx, config):
|
2013-10-12 08:28:27 +00:00
|
|
|
"""Return a string of node names separated by blanks"""
|
2013-03-08 01:56:29 +00:00
|
|
|
nodelist = []
|
|
|
|
for t, k in ctx.config['targets'].iteritems():
|
|
|
|
host = t.split('@')[-1]
|
|
|
|
simple_host = host.split('.')[0]
|
|
|
|
nodelist.append(simple_host)
|
|
|
|
nodelist = " ".join(nodelist)
|
|
|
|
return nodelist
|
|
|
|
|
|
|
|
def execute_ceph_deploy(ctx, config, cmd):
|
2013-10-12 08:28:27 +00:00
|
|
|
"""Remotely execute a ceph_deploy command"""
|
2013-03-08 01:56:29 +00:00
|
|
|
testdir = teuthology.get_testdir(ctx)
|
|
|
|
ceph_admin = teuthology.get_first_mon(ctx, config)
|
|
|
|
exec_cmd = cmd
|
|
|
|
(remote,) = ctx.cluster.only(ceph_admin).remotes.iterkeys()
|
|
|
|
proc = remote.run(
|
|
|
|
args = [
|
|
|
|
'cd',
|
|
|
|
'{tdir}/ceph-deploy'.format(tdir=testdir),
|
|
|
|
run.Raw('&&'),
|
|
|
|
run.Raw(exec_cmd),
|
|
|
|
],
|
|
|
|
check_status=False,
|
|
|
|
)
|
|
|
|
exitstatus = proc.exitstatus
|
|
|
|
return exitstatus
|
|
|
|
|
|
|
|
@contextlib.contextmanager
|
|
|
|
def build_ceph_cluster(ctx, config):
|
2013-10-12 08:28:27 +00:00
|
|
|
"""Build a ceph cluster"""
|
2013-03-08 01:56:29 +00:00
|
|
|
log.info('Building ceph cluster using ceph-deploy...')
|
|
|
|
testdir = teuthology.get_testdir(ctx)
|
|
|
|
ceph_branch = None
|
|
|
|
if config.get('branch') is not None:
|
|
|
|
cbranch = config.get('branch')
|
|
|
|
for var, val in cbranch.iteritems():
|
|
|
|
if var == 'testing':
|
|
|
|
ceph_branch = '--{var}'.format(var=var)
|
|
|
|
ceph_branch = '--{var}={val}'.format(var=var, val=val)
|
|
|
|
node_dev_list = []
|
|
|
|
all_nodes = get_all_nodes(ctx, config)
|
|
|
|
mds_nodes = get_nodes_using_roles(ctx, config, 'mds')
|
|
|
|
mds_nodes = " ".join(mds_nodes)
|
|
|
|
mon_node = get_nodes_using_roles(ctx, config, 'mon')
|
|
|
|
mon_nodes = " ".join(mon_node)
|
|
|
|
new_mon = './ceph-deploy new'+" "+mon_nodes
|
|
|
|
install_nodes = './ceph-deploy install '+ceph_branch+" "+all_nodes
|
|
|
|
purge_nodes = './ceph-deploy purge'+" "+all_nodes
|
2013-03-24 22:12:59 +00:00
|
|
|
purgedata_nodes = './ceph-deploy purgedata'+" "+all_nodes
|
2013-03-08 01:56:29 +00:00
|
|
|
mon_hostname = mon_nodes.split(' ')[0]
|
|
|
|
mon_hostname = str(mon_hostname)
|
|
|
|
gather_keys = './ceph-deploy gatherkeys'+" "+mon_hostname
|
|
|
|
deploy_mds = './ceph-deploy mds create'+" "+mds_nodes
|
2013-05-17 19:08:45 +00:00
|
|
|
no_of_osds = 0
|
2013-06-20 20:42:33 +00:00
|
|
|
|
|
|
|
if mon_nodes is None:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("no monitor nodes in the config file")
|
2013-03-08 01:56:29 +00:00
|
|
|
|
2013-06-20 20:42:33 +00:00
|
|
|
estatus_new = execute_ceph_deploy(ctx, config, new_mon)
|
|
|
|
if estatus_new != 0:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("ceph-deploy: new command failed")
|
2013-06-20 20:42:33 +00:00
|
|
|
|
2013-07-17 00:14:33 +00:00
|
|
|
log.info('adding config inputs...')
|
|
|
|
testdir = teuthology.get_testdir(ctx)
|
|
|
|
conf_path = '{tdir}/ceph-deploy/ceph.conf'.format(tdir=testdir)
|
|
|
|
first_mon = teuthology.get_first_mon(ctx, config)
|
|
|
|
(remote,) = ctx.cluster.only(first_mon).remotes.keys()
|
|
|
|
|
|
|
|
lines = None
|
|
|
|
if config.get('conf') is not None:
|
|
|
|
confp = config.get('conf')
|
|
|
|
for section, keys in confp.iteritems():
|
2013-10-12 08:28:27 +00:00
|
|
|
lines = '[{section}]\n'.format(section=section)
|
|
|
|
teuthology.append_lines_to_file(remote, conf_path, lines, sudo=True)
|
|
|
|
for key, value in keys.iteritems():
|
|
|
|
log.info("[%s] %s = %s" % (section, key, value))
|
|
|
|
lines = '{key} = {value}\n'.format(key=key, value=value)
|
2013-07-17 00:14:33 +00:00
|
|
|
teuthology.append_lines_to_file(remote, conf_path, lines, sudo=True)
|
|
|
|
|
2013-06-20 20:42:33 +00:00
|
|
|
estatus_install = execute_ceph_deploy(ctx, config, install_nodes)
|
|
|
|
if estatus_install != 0:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("ceph-deploy: Failed to install ceph")
|
2013-06-20 20:42:33 +00:00
|
|
|
|
2013-07-09 18:12:29 +00:00
|
|
|
mon_no = None
|
|
|
|
mon_no = config.get('mon_initial_members')
|
|
|
|
if mon_no is not None:
|
|
|
|
i = 0
|
|
|
|
mon1 = []
|
|
|
|
while(i < mon_no):
|
|
|
|
mon1.append(mon_node[i])
|
|
|
|
i = i + 1
|
|
|
|
initial_mons = " ".join(mon1)
|
|
|
|
for k in range(mon_no, len(mon_node)):
|
|
|
|
mon_create_nodes = './ceph-deploy mon create'+" "+initial_mons+" "+mon_node[k]
|
|
|
|
estatus_mon = execute_ceph_deploy(ctx, config, mon_create_nodes)
|
|
|
|
if estatus_mon != 0:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("ceph-deploy: Failed to create monitor")
|
2013-07-09 18:12:29 +00:00
|
|
|
else:
|
2014-01-23 21:41:49 +00:00
|
|
|
mon_create_nodes = './ceph-deploy mon create-initial'
|
2013-07-09 18:12:29 +00:00
|
|
|
estatus_mon = execute_ceph_deploy(ctx, config, mon_create_nodes)
|
|
|
|
if estatus_mon != 0:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("ceph-deploy: Failed to create monitors")
|
2013-07-17 00:14:33 +00:00
|
|
|
|
2013-06-20 20:42:33 +00:00
|
|
|
estatus_gather = execute_ceph_deploy(ctx, config, gather_keys)
|
2014-01-06 18:50:35 +00:00
|
|
|
max_gather_tries = 90
|
|
|
|
gather_tries = 0
|
2013-06-20 20:42:33 +00:00
|
|
|
while (estatus_gather != 0):
|
2014-01-06 18:50:35 +00:00
|
|
|
gather_tries += 1
|
|
|
|
if gather_tries >= max_gather_tries:
|
|
|
|
msg = 'ceph-deploy was not able to gatherkeys after 15 minutes'
|
|
|
|
raise RuntimeError(msg)
|
2013-06-20 20:42:33 +00:00
|
|
|
estatus_gather = execute_ceph_deploy(ctx, config, gather_keys)
|
2014-01-06 18:50:35 +00:00
|
|
|
time.sleep(10)
|
2013-06-20 20:42:33 +00:00
|
|
|
|
2013-08-12 21:55:14 +00:00
|
|
|
if mds_nodes:
|
|
|
|
estatus_mds = execute_ceph_deploy(ctx, config, deploy_mds)
|
|
|
|
if estatus_mds != 0:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("ceph-deploy: Failed to deploy mds")
|
2013-06-20 20:42:33 +00:00
|
|
|
|
2013-07-26 00:12:52 +00:00
|
|
|
if config.get('test_mon_destroy') is not None:
|
2013-07-20 05:19:09 +00:00
|
|
|
for d in range(1, len(mon_node)):
|
|
|
|
mon_destroy_nodes = './ceph-deploy mon destroy'+" "+mon_node[d]
|
|
|
|
estatus_mon_d = execute_ceph_deploy(ctx, config, mon_destroy_nodes)
|
|
|
|
if estatus_mon_d != 0:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("ceph-deploy: Failed to delete monitor")
|
2013-07-16 00:04:21 +00:00
|
|
|
|
2013-06-20 20:42:33 +00:00
|
|
|
node_dev_list = get_dev_for_osd(ctx, config)
|
|
|
|
for d in node_dev_list:
|
|
|
|
osd_create_cmds = './ceph-deploy osd create --zap-disk'+" "+d
|
|
|
|
estatus_osd = execute_ceph_deploy(ctx, config, osd_create_cmds)
|
|
|
|
if estatus_osd == 0:
|
|
|
|
log.info('successfully created osd')
|
|
|
|
no_of_osds += 1
|
|
|
|
else:
|
|
|
|
zap_disk = './ceph-deploy disk zap'+" "+d
|
|
|
|
execute_ceph_deploy(ctx, config, zap_disk)
|
|
|
|
estatus_osd = execute_ceph_deploy(ctx, config, osd_create_cmds)
|
|
|
|
if estatus_osd == 0:
|
|
|
|
log.info('successfully created osd')
|
|
|
|
no_of_osds += 1
|
|
|
|
else:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("ceph-deploy: Failed to create osds")
|
2013-06-20 20:42:33 +00:00
|
|
|
|
2013-05-17 19:08:45 +00:00
|
|
|
if config.get('wait-for-healthy', True) and no_of_osds >= 2:
|
|
|
|
is_healthy(ctx=ctx, config=None)
|
2013-03-08 01:56:29 +00:00
|
|
|
|
2013-05-17 19:08:45 +00:00
|
|
|
log.info('Setting up client nodes...')
|
|
|
|
conf_path = '/etc/ceph/ceph.conf'
|
|
|
|
admin_keyring_path = '/etc/ceph/ceph.client.admin.keyring'
|
|
|
|
first_mon = teuthology.get_first_mon(ctx, config)
|
|
|
|
(mon0_remote,) = ctx.cluster.only(first_mon).remotes.keys()
|
|
|
|
conf_data = teuthology.get_file(
|
|
|
|
remote=mon0_remote,
|
|
|
|
path=conf_path,
|
|
|
|
sudo=True,
|
2013-04-20 01:23:54 +00:00
|
|
|
)
|
2013-05-17 19:08:45 +00:00
|
|
|
admin_keyring = teuthology.get_file(
|
|
|
|
remote=mon0_remote,
|
|
|
|
path=admin_keyring_path,
|
|
|
|
sudo=True,
|
2013-03-08 01:56:29 +00:00
|
|
|
)
|
2013-05-17 19:08:45 +00:00
|
|
|
|
|
|
|
clients = ctx.cluster.only(teuthology.is_type('client'))
|
|
|
|
for remot, roles_for_host in clients.remotes.iteritems():
|
|
|
|
for id_ in teuthology.roles_of_type(roles_for_host, 'client'):
|
|
|
|
client_keyring = '/etc/ceph/ceph.client.{id}.keyring'.format(id=id_)
|
|
|
|
mon0_remote.run(
|
|
|
|
args=[
|
|
|
|
'cd',
|
|
|
|
'{tdir}'.format(tdir=testdir),
|
|
|
|
run.Raw('&&'),
|
|
|
|
'sudo','bash','-c',
|
|
|
|
run.Raw('"'),'ceph',
|
|
|
|
'auth',
|
|
|
|
'get-or-create',
|
|
|
|
'client.{id}'.format(id=id_),
|
|
|
|
'mds', 'allow',
|
|
|
|
'mon', 'allow *',
|
|
|
|
'osd', 'allow *',
|
|
|
|
run.Raw('>'),
|
|
|
|
client_keyring,
|
|
|
|
run.Raw('"'),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
key_data = teuthology.get_file(
|
|
|
|
remote=mon0_remote,
|
|
|
|
path=client_keyring,
|
|
|
|
sudo=True,
|
|
|
|
)
|
|
|
|
teuthology.sudo_write_file(
|
|
|
|
remote=remot,
|
|
|
|
path=client_keyring,
|
|
|
|
data=key_data,
|
|
|
|
perms='0644'
|
|
|
|
)
|
|
|
|
teuthology.sudo_write_file(
|
|
|
|
remote=remot,
|
|
|
|
path=admin_keyring_path,
|
|
|
|
data=admin_keyring,
|
|
|
|
perms='0644'
|
|
|
|
)
|
|
|
|
teuthology.sudo_write_file(
|
|
|
|
remote=remot,
|
|
|
|
path=conf_path,
|
|
|
|
data=conf_data,
|
|
|
|
perms='0644'
|
|
|
|
)
|
|
|
|
else:
|
2013-08-12 22:43:02 +00:00
|
|
|
raise RuntimeError("The cluster is NOT operational due to insufficient OSDs")
|
2013-05-17 19:08:45 +00:00
|
|
|
|
2013-03-08 01:56:29 +00:00
|
|
|
try:
|
|
|
|
yield
|
|
|
|
|
|
|
|
finally:
|
2013-04-18 15:06:52 +00:00
|
|
|
log.info('Stopping ceph...')
|
|
|
|
ctx.cluster.run(args=[
|
2013-04-22 20:01:02 +00:00
|
|
|
'sudo', 'stop', 'ceph-all',
|
2013-04-18 15:06:52 +00:00
|
|
|
run.Raw('||'),
|
|
|
|
'sudo', 'service', 'ceph', 'stop'
|
|
|
|
])
|
2013-04-17 03:50:50 +00:00
|
|
|
|
2013-03-08 01:56:29 +00:00
|
|
|
if ctx.archive is not None:
|
|
|
|
# archive mon data, too
|
|
|
|
log.info('Archiving mon data...')
|
|
|
|
path = os.path.join(ctx.archive, 'data')
|
|
|
|
os.makedirs(path)
|
|
|
|
mons = ctx.cluster.only(teuthology.is_type('mon'))
|
|
|
|
for remote, roles in mons.remotes.iteritems():
|
|
|
|
for role in roles:
|
|
|
|
if role.startswith('mon.'):
|
|
|
|
teuthology.pull_directory_tarball(
|
|
|
|
remote,
|
|
|
|
'/var/lib/ceph/mon',
|
|
|
|
path + '/' + role + '.tgz')
|
|
|
|
|
|
|
|
log.info('Compressing logs...')
|
|
|
|
run.wait(
|
|
|
|
ctx.cluster.run(
|
|
|
|
args=[
|
|
|
|
'sudo',
|
|
|
|
'find',
|
|
|
|
'/var/log/ceph',
|
|
|
|
'-name',
|
|
|
|
'*.log',
|
|
|
|
'-print0',
|
|
|
|
run.Raw('|'),
|
|
|
|
'sudo',
|
|
|
|
'xargs',
|
|
|
|
'-0',
|
|
|
|
'--no-run-if-empty',
|
|
|
|
'--',
|
|
|
|
'gzip',
|
|
|
|
'--',
|
|
|
|
],
|
|
|
|
wait=False,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
log.info('Archiving logs...')
|
|
|
|
path = os.path.join(ctx.archive, 'remote')
|
|
|
|
os.makedirs(path)
|
|
|
|
for remote in ctx.cluster.remotes.iterkeys():
|
|
|
|
sub = os.path.join(path, remote.shortname)
|
|
|
|
os.makedirs(sub)
|
|
|
|
teuthology.pull_directory(remote, '/var/log/ceph',
|
|
|
|
os.path.join(sub, 'log'))
|
|
|
|
|
2013-04-18 15:06:52 +00:00
|
|
|
log.info('Purging package...')
|
|
|
|
execute_ceph_deploy(ctx, config, purge_nodes)
|
|
|
|
log.info('Purging data...')
|
2013-03-24 22:12:59 +00:00
|
|
|
execute_ceph_deploy(ctx, config, purgedata_nodes)
|
2013-03-08 01:56:29 +00:00
|
|
|
|
|
|
|
@contextlib.contextmanager
|
|
|
|
def task(ctx, config):
|
|
|
|
"""
|
|
|
|
Set up and tear down a Ceph cluster.
|
|
|
|
|
|
|
|
For example::
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- install:
|
|
|
|
extras: yes
|
|
|
|
- ssh_keys:
|
|
|
|
- ceph-deploy:
|
|
|
|
branch:
|
|
|
|
stable: bobtail
|
2013-07-09 18:12:29 +00:00
|
|
|
mon_initial_members: 1
|
2013-03-08 01:56:29 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
- install:
|
|
|
|
extras: yes
|
|
|
|
- ssh_keys:
|
|
|
|
- ceph-deploy:
|
|
|
|
branch:
|
|
|
|
dev: master
|
2013-07-17 00:14:33 +00:00
|
|
|
conf:
|
|
|
|
mon:
|
|
|
|
debug mon = 20
|
2013-03-08 01:56:29 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
- install:
|
|
|
|
extras: yes
|
|
|
|
- ssh_keys:
|
|
|
|
- ceph-deploy:
|
|
|
|
branch:
|
|
|
|
testing:
|
|
|
|
"""
|
|
|
|
if config is None:
|
|
|
|
config = {}
|
2013-07-09 18:12:29 +00:00
|
|
|
|
2013-07-18 18:21:07 +00:00
|
|
|
overrides = ctx.config.get('overrides', {})
|
|
|
|
teuthology.deep_merge(config, overrides.get('ceph-deploy', {}))
|
|
|
|
|
2013-03-08 01:56:29 +00:00
|
|
|
assert isinstance(config, dict), \
|
|
|
|
"task ceph-deploy only supports a dictionary for configuration"
|
|
|
|
|
2013-07-13 03:54:23 +00:00
|
|
|
overrides = ctx.config.get('overrides', {})
|
|
|
|
teuthology.deep_merge(config, overrides.get('ceph-deploy', {}))
|
|
|
|
|
2013-03-08 01:56:29 +00:00
|
|
|
if config.get('branch') is not None:
|
|
|
|
assert isinstance(config['branch'], dict), 'branch must be a dictionary'
|
|
|
|
|
|
|
|
with contextutil.nested(
|
|
|
|
lambda: ceph_fn.ship_utilities(ctx=ctx, config=None),
|
|
|
|
lambda: download_ceph_deploy(ctx=ctx, config=config),
|
|
|
|
lambda: build_ceph_cluster(ctx=ctx, config=dict(
|
2013-07-17 00:14:33 +00:00
|
|
|
conf=config.get('conf', {}),
|
2013-03-08 01:56:29 +00:00
|
|
|
branch=config.get('branch',{}),
|
2013-07-09 18:12:29 +00:00
|
|
|
mon_initial_members=config.get('mon_initial_members', None),
|
2013-07-26 00:12:52 +00:00
|
|
|
test_mon_destroy=config.get('test_mon_destroy', None),
|
2013-03-08 01:56:29 +00:00
|
|
|
)),
|
|
|
|
):
|
|
|
|
yield
|