from __future__ import print_function
import json
-from ceph_volume.util import disk
+from ceph_volume.util import disk, prepare
from ceph_volume.api import lvm
from . import validators
from ceph_volume.devices.lvm.create import Create
osds = self.computed['osds']
vgs = self.computed['vgs']
for device in devices:
- # XXX needs to read `osd journal size` from ceph.conf
device_size = disk.Size(b=device['size'])
- journal_size = disk.Size(gb=5)
+ journal_size = prepare.get_journal_size(lv_format=False)
data_size = device_size - journal_size
data_percentage = data_size * 100 / device_size
vgs.append({'devices': [device['path']], 'parts': 2})
# create the lvs from the vgs captured in the beginning
for vg in osd_vgs:
- # XXX needs to read `osd journal size` from ceph.conf
- journal_lv = lvm.create_lv('osd-journal', vg.name, size='5G')
+ # this is called again, getting us the LVM formatted string
+ journal_size = prepare.get_journal_size()
+ journal_lv = lvm.create_lv('osd-journal', vg.name, size=journal_size)
# no extents or size means it will use 100%FREE
data_lv = lvm.create_lv('osd-data', vg.name)