Skip to content

Commit

Permalink
ceph-volume: accept --no-tmpfs argument for bluestore
Browse files Browse the repository at this point in the history
When activating a bluestore inside a container, we want to (be able to)
make the osd dir metadata persistent inside the container.

Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Oct 4, 2019
1 parent 6924a8e commit e6c578a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/ceph-volume/ceph_volume/devices/lvm/activate.py
Expand Up @@ -121,7 +121,7 @@ def get_osd_device_path(osd_lv, lvs, device_type, dmcrypt_secret=None):
raise RuntimeError('could not find %s with uuid %s' % (device_type, device_uuid))


def activate_bluestore(lvs, no_systemd=False):
def activate_bluestore(lvs, no_systemd=False, no_tmpfs=False):
# find the osd
osd_lv = lvs.get(lv_tags={'ceph.type': 'block'})
if not osd_lv:
Expand All @@ -136,7 +136,7 @@ def activate_bluestore(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']:
Expand Down Expand Up @@ -260,9 +260,13 @@ def activate(self, args, osd_id=None, osd_fsid=None):
logger.info('found a journal associated with the OSD, assuming filestore')
return activate_filestore(lvs, no_systemd=args.no_systemd)
logger.info('unable to find a journal associated with the OSD, assuming bluestore')
return activate_bluestore(lvs, no_systemd=args.no_systemd)
return activate_bluestore(lvs,
no_systemd=args.no_systemd,
no_tmpfs=args.no_tmpfs)
if args.bluestore:
activate_bluestore(lvs, no_systemd=args.no_systemd)
activate_bluestore(lvs,
no_systemd=args.no_systemd,
no_tmpfs=args.no_tmpfs)
elif args.filestore:
activate_filestore(lvs, no_systemd=args.no_systemd)

Expand Down Expand Up @@ -327,6 +331,12 @@ def main(self):
action='store_true',
help='Skip creating and enabling systemd units and starting OSD services',
)
parser.add_argument(
'--no-tmpfs',
dest='no_tmpfs',
action='store_true',
help='Do not create a tmpfs for the OSD directory',
)
if len(self.argv) == 0:
print(sub_command_help)
return
Expand Down

0 comments on commit e6c578a

Please sign in to comment.