]> 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>
Wed, 3 Feb 2021 17:34:03 +0000 (18:34 +0100)
commit59613a8ab483d30d31bd84da0cef203ff28ce959
treeb149b6a65b12ff3f8e49ab7d03155c3d62048241
parent8bb2d5ecc900bbfcfae3dd7cc53a37b1bbabca45
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>
(cherry picked from commit ece6e7eb9a92cb944b2f201a05a5acfb877c2dba)
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