]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util.prepare add other ln helpers for bluestore
authorAlfredo Deza <adeza@redhat.com>
Fri, 13 Oct 2017 13:22:53 +0000 (09:22 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 18 Oct 2017 16:46:29 +0000 (12:46 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/util/prepare.py

index eefa0adc2041526ee1358c50762ae5146e295c77..58d43d9b22a3bcd0ed48c94bba366ef72b09ad62 100644 (file)
@@ -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