ceph-volume: use Device.lvm_size in batch strategy validators

This will validate the devices on the size that lvm will allow to be
used, not the raw physical size of the device.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
This commit is contained in:
Andrew Schoen 2018-12-06 10:49:03 -06:00
parent 071e7ce41a
commit aaa915cfe6

View File

@ -9,7 +9,7 @@ def minimum_device_size(devices, osds_per_device=1):
"""
msg = 'Unable to use device %s %s, LVs would be smaller than 5GB'
for device in devices:
device_size = disk.Size(b=device.sys_api['size'])
device_size = disk.Size(b=device.lvm_size.b)
lv_size = device_size / osds_per_device
if lv_size < disk.Size(gb=5):
raise RuntimeError(msg % (device_size, device.path))
@ -22,7 +22,7 @@ def minimum_device_collocated_size(devices, journal_size, osds_per_device=1):
"""
msg = 'Unable to use device %s %s, LVs would be smaller than 5GB'
for device in devices:
device_size = disk.Size(b=device.sys_api['size'])
device_size = disk.Size(b=device.lvm_size.b)
lv_size = (device_size / osds_per_device) - journal_size
if lv_size < disk.Size(gb=5):
raise RuntimeError(msg % (device_size, device.path))