]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
LVM: Fix thin provisioning and mirrors stats reporting
authorEric Harney <eharney@redhat.com>
Wed, 18 Feb 2015 16:48:23 +0000 (11:48 -0500)
committerEric Harney <eharney@redhat.com>
Wed, 18 Feb 2015 17:54:25 +0000 (12:54 -0500)
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

cinder/volume/drivers/lvm.py

index feee01ddbb2963f8170c811ddec8e0dbafed8fd6..e7098916eb0093f7350ac44616200d28b58f3a70 100644 (file)
@@ -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 = {}