]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: add some flexibility to bytes_to_extents
authorJan Fajerski <jfajerski@suse.com>
Tue, 22 Dec 2020 13:29:02 +0000 (14:29 +0100)
committerJan Fajerski <jfajerski@suse.com>
Tue, 22 Dec 2020 15:03:55 +0000 (16:03 +0100)
commitece6e7eb9a92cb944b2f201a05a5acfb877c2dba
tree60f4f5e3660bad8bb00bedcc2ce905406fe2fa9c
parentd5a2611106ac6d60cae0fbad06d74ef820acec52
ceph-volume: add some flexibility to bytes_to_extents

For batch we want to report the projected sizes before creating any LVM
structures, we use the device size for that. This means we pass this
projected size to lvm/api.py::create_lv. This could result in situations
where we request more extents for the new LV than are actually
available, as LVM takes up some available space on the block device
(plus alignment).
We fix this by adjusting the extent count downwards if its less than 1% off the
requested value.

Fixes: https://tracker.ceph.com/issues/47758
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
src/ceph-volume/ceph_volume/api/lvm.py
src/ceph-volume/ceph_volume/tests/api/test_lvm.py
src/ceph-volume/ceph_volume/util/device.py