From 555b664882db2cd247087f907bdf4d426fb652f8 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 13 Oct 2017 09:22:53 -0400 Subject: [PATCH] ceph-volume util.prepare add other ln helpers for bluestore Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/util/prepare.py | 30 ++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/ceph-volume/ceph_volume/util/prepare.py b/src/ceph-volume/ceph_volume/util/prepare.py index eefa0adc2041..58d43d9b22a3 100644 --- a/src/ceph-volume/ceph_volume/util/prepare.py +++ b/src/ceph-volume/ceph_volume/util/prepare.py @@ -98,15 +98,37 @@ def mount_osd(device, osd_id): process.run(command) -def link_journal(journal_device, osd_id): - journal_path = '/var/lib/ceph/osd/%s-%s/journal' % ( +def _link_device(device, device_type, osd_id): + """ + Allow linking any device type in an OSD directory. ``device`` must the be + source, with an absolute path and ``device_type`` will be the destination + name, like 'journal', or 'block' + """ + device_path = '/var/lib/ceph/osd/%s-%s/%s' % ( conf.cluster, - osd_id + osd_id, + device_type ) - command = ['sudo', 'ln', '-s', journal_device, journal_path] + command = ['sudo', 'ln', '-s', device, device_path] process.run(command) +def link_journal(journal_device, osd_id): + _link_device(journal_device, 'journal', osd_id) + + +def link_block(block_device, osd_id): + _link_device(block_device, 'block', osd_id) + + +def link_wal(wal_device, osd_id): + _link_device(wal_device, 'wal', osd_id) + + +def link_db(db_device, osd_id): + _link_device(db_device, 'db', osd_id) + + def get_monmap(osd_id): """ Before creating the OSD files, a monmap needs to be retrieved so that it -- 2.47.3