From c2467f8b003497860118cbbe9f4a8c995c705fee Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 29 Jun 2017 10:53:31 -0400 Subject: [PATCH] ceph-volume: lvm activate checks other non-lv journals and symlinks accordingly Signed-off-by: Alfredo Deza --- .../ceph_volume/devices/lvm/activate.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ceph-volume/ceph_volume/devices/lvm/activate.py b/src/ceph-volume/ceph_volume/devices/lvm/activate.py index c4a51ff0f91..dc756a9b37c 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/activate.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/activate.py @@ -9,7 +9,15 @@ def activate_filestore(lvs): # find the osd osd_lv = lvs.get(lv_tags={'ceph.type': 'osd'}) osd_id = osd_lv.tags['ceph.osd_id'] - osd_journal = lvs.get(lv_tags={'ceph.type': 'journal'}) + # it may have a volume with a journal + osd_journal_lv = lvs.get(lv_tags={'ceph.type': 'journal'}) + if not osd_journal_lv: + osd_journal = osd_lv.tags.get('ceph.journal_device') + else: + osd_journal = osd_journal.lv_path + + if not osd_journal: + raise RuntimeError('unable to detect an lv or device journal for OSD %s' % osd_id) # mount the osd source = osd_lv.lv_path @@ -17,9 +25,10 @@ def activate_filestore(lvs): process.call(['sudo', 'mount', '-v', source, destination]) # ensure that the symlink for the journal is there - source = osd_journal.lv_path - destination = '/var/lib/ceph/osd/ceph-%s/journal' % osd_id - process.call(['sudo', 'ln', '-s', source, destination]) + if not os.path.exists(osd_journal): + source = osd_journal + destination = '/var/lib/ceph/osd/ceph-%s/journal' % osd_id + process.call(['sudo', 'ln', '-s', source, destination]) # start the OSD systemctl.start_osd(osd_id) -- 2.39.5