]> git.apps.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:35:41 +0000 (18:35 +0100)
commit38c98ba0d5084dcaa8507c5566eaa6e9b88d39c8
tree337828d6cde9e9941be6ca2aae775ce7e9c661cd
parentd9dfdb85a569ffd45d9f2486c493605b5496449a
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