Skip to content

Commit 8a94605

Browse files
authored
Merge pull request ceph#50657 from guits/remove-filestore-cv
ceph-volume: drop filestore support
2 parents 0f64042 + 2f78121 commit 8a94605

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+59
-1182
lines changed

src/ceph-volume/ceph_volume/api/lvm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,6 @@ def create_lv(name_prefix,
10181018
# be so this function will set it after creation using the mapping
10191019
# XXX add CEPH_VOLUME_LVM_DEBUG to enable -vvvv on lv operations
10201020
type_path_tag = {
1021-
'journal': 'ceph.journal_device',
10221021
'data': 'ceph.data_device',
10231022
'block': 'ceph.block_device',
10241023
'wal': 'ceph.wal_device',

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

Lines changed: 2 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -15,86 +15,6 @@
1515
logger = logging.getLogger(__name__)
1616

1717

18-
def activate_filestore(osd_lvs, no_systemd=False):
19-
# find the osd
20-
for osd_lv in osd_lvs:
21-
if osd_lv.tags.get('ceph.type') == 'data':
22-
data_lv = osd_lv
23-
break
24-
else:
25-
raise RuntimeError('Unable to find a data LV for filestore activation')
26-
27-
is_encrypted = data_lv.tags.get('ceph.encrypted', '0') == '1'
28-
is_vdo = data_lv.tags.get('ceph.vdo', '0')
29-
30-
osd_id = data_lv.tags['ceph.osd_id']
31-
configuration.load_ceph_conf_path(data_lv.tags['ceph.cluster_name'])
32-
configuration.load()
33-
# it may have a volume with a journal
34-
for osd_lv in osd_lvs:
35-
if osd_lv.tags.get('ceph.type') == 'journal':
36-
osd_journal_lv = osd_lv
37-
break
38-
else:
39-
osd_journal_lv = None
40-
41-
# TODO: add sensible error reporting if this is ever the case
42-
# blow up with a KeyError if this doesn't exist
43-
osd_fsid = data_lv.tags['ceph.osd_fsid']
44-
if not osd_journal_lv:
45-
# must be a disk partition, by querying blkid by the uuid we are ensuring that the
46-
# device path is always correct
47-
journal_uuid = data_lv.tags['ceph.journal_uuid']
48-
osd_journal = disk.get_device_from_partuuid(journal_uuid)
49-
else:
50-
journal_uuid = osd_journal_lv.lv_uuid
51-
osd_journal = data_lv.tags['ceph.journal_device']
52-
53-
if not osd_journal:
54-
raise RuntimeError('unable to detect an lv or device journal for OSD %s' % osd_id)
55-
56-
# this is done here, so that previous checks that ensure path availability
57-
# and correctness can still be enforced, and report if any issues are found
58-
if is_encrypted:
59-
lockbox_secret = data_lv.tags['ceph.cephx_lockbox_secret']
60-
# this keyring writing is idempotent
61-
encryption_utils.write_lockbox_keyring(osd_id, osd_fsid, lockbox_secret)
62-
dmcrypt_secret = encryption_utils.get_dmcrypt_key(osd_id, osd_fsid)
63-
encryption_utils.luks_open(dmcrypt_secret, data_lv.lv_path, data_lv.lv_uuid)
64-
encryption_utils.luks_open(dmcrypt_secret, osd_journal, journal_uuid)
65-
66-
osd_journal = '/dev/mapper/%s' % journal_uuid
67-
source = '/dev/mapper/%s' % data_lv.lv_uuid
68-
else:
69-
source = data_lv.lv_path
70-
71-
# mount the osd
72-
destination = '/var/lib/ceph/osd/%s-%s' % (conf.cluster, osd_id)
73-
if not system.device_is_mounted(source, destination=destination):
74-
prepare_utils.mount_osd(source, osd_id, is_vdo=is_vdo)
75-
76-
# ensure that the OSD destination is always chowned properly
77-
system.chown(destination)
78-
79-
# always re-do the symlink regardless if it exists, so that the journal
80-
# device path that may have changed can be mapped correctly every time
81-
destination = '/var/lib/ceph/osd/%s-%s/journal' % (conf.cluster, osd_id)
82-
process.run(['ln', '-snf', osd_journal, destination])
83-
84-
# make sure that the journal has proper permissions
85-
system.chown(osd_journal)
86-
87-
if no_systemd is False:
88-
# enable the ceph-volume unit for this OSD
89-
systemctl.enable_volume(osd_id, osd_fsid, 'lvm')
90-
91-
# enable the OSD
92-
systemctl.enable_osd(osd_id)
93-
94-
# start the OSD
95-
systemctl.start_osd(osd_id)
96-
terminal.success("ceph-volume lvm activate successful for osd ID: %s" % osd_id)
97-
9818

9919
def get_osd_device_path(osd_lvs, device_type, dmcrypt_secret=None):
10020
"""
@@ -279,30 +199,16 @@ def activate(self, args, osd_id=None, osd_fsid=None):
279199

280200
# This argument is only available when passed in directly or via
281201
# systemd, not when ``create`` is being used
202+
# placeholder when a new objectstore support will be added
282203
if getattr(args, 'auto_detect_objectstore', False):
283204
logger.info('auto detecting objectstore')
284-
# may get multiple lvs, so can't do get_the_lvs() calls here
285-
for lv in lvs:
286-
has_journal = lv.tags.get('ceph.journal_uuid')
287-
if has_journal:
288-
logger.info('found a journal associated with the OSD, '
289-
'assuming filestore')
290-
return activate_filestore(lvs, args.no_systemd)
291-
292-
logger.info('unable to find a journal associated with the OSD, '
293-
'assuming bluestore')
294-
295205
return activate_bluestore(lvs, args.no_systemd)
296206

297-
# explicit filestore/bluestore flags take precedence
207+
# explicit 'objectstore' flags take precedence
298208
if getattr(args, 'bluestore', False):
299209
activate_bluestore(lvs, args.no_systemd, getattr(args, 'no_tmpfs', False))
300-
elif getattr(args, 'filestore', False):
301-
activate_filestore(lvs, args.no_systemd)
302210
elif any('ceph.block_device' in lv.tags for lv in lvs):
303211
activate_bluestore(lvs, args.no_systemd, getattr(args, 'no_tmpfs', False))
304-
elif any('ceph.data_device' in lv.tags for lv in lvs):
305-
activate_filestore(lvs, args.no_systemd)
306212

307213
def main(self):
308214
sub_command_help = dedent("""
@@ -348,11 +254,6 @@ def main(self):
348254
action='store_true',
349255
help='force bluestore objectstore activation',
350256
)
351-
parser.add_argument(
352-
'--filestore',
353-
action='store_true',
354-
help='force filestore objectstore activation',
355-
)
356257
parser.add_argument(
357258
'--all',
358259
dest='activate_all',

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

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ def device_formatter(devices):
2929
return ''.join(lines)
3030

3131

32-
def ensure_disjoint_device_lists(data, db=[], wal=[], journal=[]):
32+
def ensure_disjoint_device_lists(data, db=[], wal=[]):
3333
# check that all device lists are disjoint with each other
3434
if not all([set(data).isdisjoint(set(db)),
3535
set(data).isdisjoint(set(wal)),
36-
set(data).isdisjoint(set(journal)),
3736
set(db).isdisjoint(set(wal))]):
3837
raise Exception('Device lists are not disjoint')
3938

@@ -220,13 +219,6 @@ def __init__(self, argv):
220219
default=[],
221220
help='Devices to provision OSDs wal volumes',
222221
)
223-
parser.add_argument(
224-
'--journal-devices',
225-
nargs='*',
226-
type=arg_validators.ValidBatchDevice(),
227-
default=[],
228-
help='Devices to provision OSDs journal volumes',
229-
)
230222
parser.add_argument(
231223
'--auto',
232224
action='store_true',
@@ -246,11 +238,6 @@ def __init__(self, argv):
246238
action='store_true',
247239
help='bluestore objectstore (default)',
248240
)
249-
parser.add_argument(
250-
'--filestore',
251-
action='store_true',
252-
help='filestore objectstore',
253-
)
254241
parser.add_argument(
255242
'--report',
256243
action='store_true',
@@ -323,25 +310,6 @@ def __init__(self, argv):
323310
type=int,
324311
help='Provision slots on WAL device, can remain unoccupied'
325312
)
326-
def journal_size_in_mb_hack(size):
327-
# TODO give user time to adjust, then remove this
328-
if size and size[-1].isdigit():
329-
mlogger.warning('DEPRECATION NOTICE')
330-
mlogger.warning('--journal-size as integer is parsed as megabytes')
331-
mlogger.warning('A future release will parse integers as bytes')
332-
mlogger.warning('Add a "M" to explicitly pass a megabyte size')
333-
size += 'M'
334-
return disk.Size.parse(size)
335-
parser.add_argument(
336-
'--journal-size',
337-
type=journal_size_in_mb_hack,
338-
help='Override the "osd_journal_size" value, in megabytes'
339-
)
340-
parser.add_argument(
341-
'--journal-slots',
342-
type=int,
343-
help='Provision slots on journal device, can remain unoccupied'
344-
)
345313
parser.add_argument(
346314
'--prepare',
347315
action='store_true',
@@ -356,7 +324,7 @@ def journal_size_in_mb_hack(size):
356324
)
357325
self.args = parser.parse_args(argv)
358326
self.parser = parser
359-
for dev_list in ['', 'db_', 'wal_', 'journal_']:
327+
for dev_list in ['', 'db_', 'wal_']:
360328
setattr(self, '{}usable'.format(dev_list), [])
361329

362330
def report(self, plan):
@@ -395,7 +363,7 @@ def _sort_rotational_disks(self):
395363
'''
396364
Helper for legacy auto behaviour.
397365
Sorts drives into rotating and non-rotating, the latter being used for
398-
db or journal.
366+
db.
399367
'''
400368
mlogger.warning('DEPRECATION NOTICE')
401369
mlogger.warning('You are using the legacy automatic disk sorting behavior')
@@ -408,10 +376,7 @@ def _sort_rotational_disks(self):
408376
# no need for additional sorting, we'll only deploy standalone on ssds
409377
return
410378
self.args.devices = rotating
411-
if self.args.filestore:
412-
self.args.journal_devices = ssd
413-
else:
414-
self.args.db_devices = ssd
379+
self.args.db_devices = ssd
415380

416381
@decorators.needs_root
417382
def main(self):
@@ -420,19 +385,18 @@ def main(self):
420385

421386
# Default to bluestore here since defaulting it in add_argument may
422387
# cause both to be True
423-
if not self.args.bluestore and not self.args.filestore:
388+
if not self.args.bluestore:
424389
self.args.bluestore = True
425390

426391
if (self.args.auto and not self.args.db_devices and not
427-
self.args.wal_devices and not self.args.journal_devices):
392+
self.args.wal_devices):
428393
self._sort_rotational_disks()
429394

430395
self._check_slot_args()
431396

432397
ensure_disjoint_device_lists(self.args.devices,
433398
self.args.db_devices,
434-
self.args.wal_devices,
435-
self.args.journal_devices)
399+
self.args.wal_devices)
436400

437401
plan = self.get_plan(self.args)
438402

@@ -453,7 +417,6 @@ def _execute(self, plan):
453417
defaults = common.get_default_args()
454418
global_args = [
455419
'bluestore',
456-
'filestore',
457420
'dmcrypt',
458421
'crush_device_class',
459422
'no_systemd',
@@ -473,8 +436,6 @@ def get_plan(self, args):
473436
if args.bluestore:
474437
plan = self.get_deployment_layout(args, args.devices, args.db_devices,
475438
args.wal_devices)
476-
elif args.filestore:
477-
plan = self.get_deployment_layout(args, args.devices, args.journal_devices)
478439
return plan
479440

480441
def get_deployment_layout(self, args, devices, fast_devices=[],
@@ -500,7 +461,8 @@ def get_deployment_layout(self, args, devices, fast_devices=[],
500461
return plan
501462
requested_osds = args.osds_per_device * len(phys_devs) + len(lvm_devs)
502463

503-
fast_type = 'block_db' if args.bluestore else 'journal'
464+
if args.bluestore:
465+
fast_type = 'block_db'
504466
fast_allocations = self.fast_allocations(fast_devices,
505467
requested_osds,
506468
num_osds,

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

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -126,33 +126,12 @@ def rollback_osd(args, osd_id=None):
126126
},
127127
}
128128

129-
filestore_args = {
130-
'--filestore': {
131-
'action': 'store_true',
132-
'help': 'Use the filestore objectstore',
133-
},
134-
'--journal': {
135-
'help': 'A logical volume (vg_name/lv_name), or path to a device',
136-
'type': arg_validators.ValidDevice(as_string=True),
137-
},
138-
'--journal-size': {
139-
'help': 'Size of journal LV in case a raw block device was passed in --journal',
140-
'default': '0',
141-
'type': disk.Size.parse
142-
},
143-
'--journal-slots': {
144-
'help': ('Intended number of slots on journal device. The new OSD gets one'
145-
'of those slots or 1/nth of the available capacity'),
146-
'type': int,
147-
'default': 1,
148-
},
149-
}
150129

151130
def get_default_args():
152131
defaults = {}
153132
def format_name(name):
154133
return name.strip('-').replace('-', '_').replace('.', '_')
155-
for argset in (common_args, filestore_args, bluestore_args):
134+
for argset in (common_args, bluestore_args):
156135
defaults.update({format_name(name): val.get('default', None) for name, val in argset.items()})
157136
return defaults
158137

@@ -168,7 +147,6 @@ def common_parser(prog, description):
168147
description=description,
169148
)
170149

171-
filestore_group = parser.add_argument_group('filestore')
172150
bluestore_group = parser.add_argument_group('bluestore')
173151

174152
for name, kwargs in common_args.items():
@@ -177,9 +155,6 @@ def common_parser(prog, description):
177155
for name, kwargs in bluestore_args.items():
178156
bluestore_group.add_argument(name, **kwargs)
179157

180-
for name, kwargs in filestore_args.items():
181-
filestore_group.add_argument(name, **kwargs)
182-
183158
# Do not parse args, so that consumers can do something before the args get
184159
# parsed triggering argparse behavior
185160
return parser

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ def main(self):
6868
if len(self.argv) == 0:
6969
print(sub_command_help)
7070
return
71-
exclude_group_options(parser, groups=['filestore', 'bluestore'], argv=self.argv)
71+
exclude_group_options(parser, groups=['bluestore'], argv=self.argv)
7272
args = parser.parse_args(self.argv)
7373
# Default to bluestore here since defaulting it in add_argument may
7474
# cause both to be True
75-
if not args.bluestore and not args.filestore:
75+
if not args.bluestore:
7676
args.bluestore = True
7777
self.create(args)

0 commit comments

Comments
 (0)