From 8875a7a6851cf33ead2da50fbd77f1850e515d35 Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 15 Aug 2018 11:37:01 +0100 Subject: [PATCH] Enable bluestore by default For Ceph Lumimous (12.2.0) or later enable Bluestore block device format as the default for Ceph OSD's. Bluestore can be disabled by setting the bluestore config option to False. For older releases, Bluestore cannot be enabled as its not supported - setting the config option will have no effect. Change-Id: I5ca657b9c4da055c4e0ff12e8b91b39d0964be8c --- config.yaml | 9 +++------ hooks/ceph_hooks.py | 15 +++++++++++++-- tests/basic_deployment.py | 2 -- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/config.yaml b/config.yaml index 4e0f4a55..8e04fb10 100644 --- a/config.yaml +++ b/config.yaml @@ -120,13 +120,10 @@ options: Only supported with ceph >= 0.48.3. bluestore: type: boolean - default: false + default: True description: | - Use experimental bluestore storage format for OSD devices; only supported - in Ceph Jewel (10.2.0) or later. - . - Note that despite bluestore being the default for Ceph Luminous, if this - option is False, OSDs will still use filestore. + Enable bluestore storage format for OSD devices; Only applies for Ceph + Luminous or later. osd-encrypt: type: boolean default: False diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 3b8cfcdd..414ce1b0 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -220,6 +220,16 @@ def use_vaultlocker(): return False +def use_bluestore(): + """Determine whether bluestore should be used for OSD's + + :returns: whether bluestore disk format should be used + :rtype: bool""" + if cmp_pkgrevno('ceph', '10.2.0') < 0: + return False + return config('bluestore') + + def install_apparmor_profile(): """ Install ceph apparmor profiles and configure @@ -336,7 +346,7 @@ def get_ceph_context(upgrading=False): 'dio': str(config('use-direct-io')).lower(), 'short_object_len': use_short_objects(), 'upgrade_in_progress': upgrading, - 'bluestore': config('bluestore'), + 'bluestore': use_bluestore(), 'bluestore_experimental': cmp_pkgrevno('ceph', '12.1.0') < 0, 'bluestore_block_wal_size': config('bluestore-block-wal-size'), 'bluestore_block_db_size': config('bluestore-block-db-size'), @@ -468,12 +478,13 @@ def prepare_disks_and_activate(): if ceph.is_bootstrapped(): log('ceph bootstrapped, rescanning disks') emit_cephconf() + bluestore = use_bluestore() for dev in get_devices(): ceph.osdize(dev, config('osd-format'), osd_journal, config('ignore-device-errors'), config('osd-encrypt'), - config('bluestore'), + bluestore, config('osd-encrypt-keymanager')) # Make it fast! if config('autotune'): diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 26c9f53d..8c75e98f 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -398,8 +398,6 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment): }, 'osd': { 'keyring': '/var/lib/ceph/osd/$cluster-$id/keyring', - 'osd journal size': '1024', - 'filestore xattr use omap': 'true' }, }