From: Alfredo Deza Date: Tue, 11 Jul 2017 20:35:13 +0000 (-0400) Subject: ceph-volume: lvm.activate: register the osd with the mon as part of activation X-Git-Tag: ses5-milestone10~3^2~5^2~57 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9544bab0382c53da454decaa5467a53a28fbb615;p=ceph.git ceph-volume: lvm.activate: register the osd with the mon as part of activation Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/activate.py b/src/ceph-volume/ceph_volume/devices/lvm/activate.py index ebfeb731dbae..9ed80dbda0b1 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/activate.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/activate.py @@ -2,13 +2,14 @@ import argparse import os from textwrap import dedent from ceph_volume import process +from ceph_volume.util import activate as activate_utils from ceph_volume.systemd import systemctl import api def activate_filestore(lvs): # find the osd - osd_lv = lvs.get(lv_tags={'ceph.type': 'osd'}) + osd_lv = lvs.get(lv_tags={'ceph.type': 'data'}) osd_id = osd_lv.tags['ceph.osd_id'] # it may have a volume with a journal osd_journal_lv = lvs.get(lv_tags={'ceph.type': 'journal'}) @@ -31,6 +32,9 @@ def activate_filestore(lvs): destination = '/var/lib/ceph/osd/ceph-%s/journal' % osd_id process.call(['sudo', 'ln', '-s', source, destination]) + # register the osd + activate_utils.add_osd_to_mon(osd_id) + # start the OSD systemctl.start_osd(osd_id) @@ -51,6 +55,8 @@ class Activate(object): lvs = api.Volumes() # filter them down for the OSD ID and FSID we need to activate lvs.filter(lv_tags={'ceph.osd_id': args.id, 'ceph.osd_fsid': args.fsid}) + if not lvs: + raise RuntimeError('could not find osd.%s with fsid %s' % (args.id, args.fsid)) activate_filestore(lvs) def main(self):