Finish setup of Ceph OSD addition and basic management

This commit is contained in:
2018-10-29 17:51:08 -04:00
parent 59472ae374
commit bfbe9188ce
6 changed files with 363 additions and 51 deletions

View File

@ -59,13 +59,13 @@ def add_osd(zk_conn, node, device):
return False, 'ERROR: No node named "{}" is present in the cluster.'.format(node)
# Tell the cluster to create a new OSD for the host
new_osd_string = 'new {},{}'.format(node, device)
zkhandler.writedata(zk_conn, {'/ceph/osd_cmd': new_osd_string})
add_osd_string = 'add {},{}'.format(node, device)
zkhandler.writedata(zk_conn, {'/ceph/osd_cmd': add_osd_string})
click.echo('Created new OSD with block device {} on node {}.'.format(device, node))
return True, ''
def remove_osd(zk_conn, osd_id):
remove_osd_string = 'remove {}'.format(osd_id)
zkhandler.writedata(zk_conn, {'/ceph/osd_cmd': remove_osd_string})
click.echo('Remove OSD {} from the cluster.'.format(osd_id))
click.echo('Removed OSD with ID {} from the cluster.'.format(osd_id))
return True, ''