]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: lvm activate: add --no-tmpfs
authorSage Weil <sage@newdream.net>
Thu, 5 Aug 2021 17:23:27 +0000 (13:23 -0400)
committerAdam King <adking@redhat.com>
Tue, 17 May 2022 14:25:59 +0000 (10:25 -0400)
This isn't necessary for cephadm, but having this arg match raw activate
makes the interface more consistent.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 9dc35338754442b0730b974de4fc3cc6ffb172b6)

src/ceph-volume/ceph_volume/devices/lvm/activate.py

index 82988853a144c5d2c919a7141231c62790c2e82a..4ad117ec0cff5af075f110c9ce16079d17df15d1 100644 (file)
@@ -140,7 +140,7 @@ def get_osd_device_path(osd_lvs, device_type, dmcrypt_secret=None):
     raise RuntimeError('could not find %s with uuid %s' % (device_type, device_uuid))
 
 
-def activate_bluestore(osd_lvs, no_systemd=False):
+def activate_bluestore(osd_lvs, no_systemd=False, no_tmpfs=False):
     for lv in osd_lvs:
         if lv.tags.get('ceph.type') == 'block':
             osd_block_lv = lv
@@ -160,7 +160,7 @@ def activate_bluestore(osd_lvs, no_systemd=False):
     osd_path = '/var/lib/ceph/osd/%s-%s' % (conf.cluster, osd_id)
     if not system.path_is_mounted(osd_path):
         # mkdir -p and mount as tmpfs
-        prepare_utils.create_osd_path(osd_id, tmpfs=True)
+        prepare_utils.create_osd_path(osd_id, tmpfs=not no_tmpfs)
     # XXX This needs to be removed once ceph-bluestore-tool can deal with
     # symlinks that exist in the osd dir
     for link_name in ['block', 'block.db', 'block.wal']:
@@ -300,11 +300,11 @@ class Activate(object):
 
         # explicit filestore/bluestore flags take precedence
         if getattr(args, 'bluestore', False):
-            activate_bluestore(lvs, args.no_systemd)
+            activate_bluestore(lvs, args.no_systemd, getattr(args, 'no_tmpfs', False))
         elif getattr(args, 'filestore', False):
             activate_filestore(lvs, args.no_systemd)
         elif any('ceph.block_device' in lv.tags for lv in lvs):
-            activate_bluestore(lvs, args.no_systemd)
+            activate_bluestore(lvs, args.no_systemd, getattr(args, 'no_tmpfs', False))
         elif any('ceph.data_device' in lv.tags for lv in lvs):
             activate_filestore(lvs, args.no_systemd)
 
@@ -369,6 +369,11 @@ class Activate(object):
             action='store_true',
             help='Skip creating and enabling systemd units and starting OSD services',
         )
+        parser.add_argument(
+            '--no-tmpfs',
+            action='store_true',
+            help='Do not use a tmpfs mount for OSD data dir'
+        )
         if len(self.argv) == 0:
             print(sub_command_help)
             return