From: Eric Harney Date: Wed, 18 Feb 2015 16:48:23 +0000 (-0500) Subject: LVM: Fix thin provisioning and mirrors stats reporting X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3d3bb11dfc95e29a5709fe1fa942b435e4b950cb;p=openstack-build%2Fcinder-build.git LVM: Fix thin provisioning and mirrors stats reporting This appears to do the wrong thing in the case where both lvm_mirrors and thin prov are being used, since the "elif...thin" block won't be hit. Ensure thin provisioning is always reported correctly. Change-Id: I3c89af4d86e96ded8208f140928a8f2f8e54937a --- diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index feee01ddb..e7098916e 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -190,7 +190,6 @@ class LVMVolumeDriver(driver.VolumeDriver): total_capacity = 0 free_capacity = 0 - thin_enabled = False if self.configuration.lvm_mirrors > 0: total_capacity =\ @@ -203,7 +202,6 @@ class LVMVolumeDriver(driver.VolumeDriver): total_capacity = self.vg.vg_thin_pool_size free_capacity = self.vg.vg_thin_pool_free_space provisioned_capacity = self.vg.vg_provisioned_capacity - thin_enabled = True else: total_capacity = self.vg.vg_size free_capacity = self.vg.vg_free_space @@ -218,6 +216,8 @@ class LVMVolumeDriver(driver.VolumeDriver): 'lvm_type': self.configuration.lvm_type, 'lvm_mirrors': self.configuration.lvm_mirrors}) + thin_enabled = self.configuration.lvm_type == 'thin' + # Skip enabled_pools setting, treat the whole backend as one pool # XXX FIXME if multipool support is added to LVM driver. single_pool = {}