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: v14.2.10~128^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=67db707b2bc9c86e8fc1e9e7c5fc3a0e2edfb85e;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 7f41f56ff531..f4ef1cf6a1aa 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -649,7 +649,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) class VolumeGroups(list): 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 c0f8e3f53917..fea6fefaa085 100644 --- a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py +++ b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py @@ -533,6 +533,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')