From: Andrew Schoen Date: Mon, 24 May 2021 17:04:00 +0000 (-0500) Subject: ceph-volume: calculate % of device correctly in lvm batch --report X-Git-Tag: v14.2.22~13^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c9b1c7f81e740b2f79bf260776eb026f827d5ba3;p=ceph.git ceph-volume: calculate % of device correctly in lvm batch --report If using --block-db-size, the % of device calculation is incorrect and always reads 100%. Resolves: RHBZ#1946478 Fixes: https://tracker.ceph.com/issues/50957 Signed-off-by: Andrew Schoen (cherry picked from commit ed5ab92dc3e67a670b33f7c36c651571682bf8e2) --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/batch.py b/src/ceph-volume/ceph_volume/devices/lvm/batch.py index 40c0fea4eec14..cdb68953173cf 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/batch.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/batch.py @@ -126,6 +126,7 @@ def get_physical_fast_allocs(devices, type_, fast_slots_per_device, new_osds, ar if requested_size: if requested_size <= abs_size: abs_size = requested_size + relative_size = int(abs_size) / dev_size else: mlogger.error( '{} was requested for {}, but only {} can be fulfilled'.format(