From: Jan Fajerski Date: Wed, 4 Mar 2020 12:28:46 +0000 (+0100) Subject: use extent count for slots conversion instead of free count X-Git-Tag: v15.2.8~8^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=50f43c7028bbc8ab031bf7ffb800542529eeee53;p=ceph.git use extent count for slots conversion instead of free count Signed-off-by: Jan Fajerski (cherry picked from commit 4a81b4a2fbb4cafe45a8fe8cceeece636e51adb6) --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 85bdeb62236..461e010506c 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -596,7 +596,7 @@ class VolumeGroup(object): ''' Return how many extents fit the VG slot times ''' - return int(int(self.vg_free_count) / slots) + return int(int(self.vg_extent_count) / slots) def create_vg(devices, name=None, name_prefix=None): diff --git a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py index fe2fe8b577c..cd2f9d9cb42 100644 --- a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py +++ b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py @@ -186,6 +186,7 @@ class TestCreateLV(object): self.foo_volume = api.Volume(lv_name='foo', lv_path='/path', vg_name='foo_group', lv_tags='') self.foo_group = api.VolumeGroup(vg_name='foo_group', vg_extent_size=4194304, + vg_extent_count=100, vg_free_count=100) @patch('ceph_volume.api.lvm.process.run')