From 3d3bb11dfc95e29a5709fe1fa942b435e4b950cb Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 18 Feb 2015 11:48:23 -0500 Subject: [PATCH] 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 --- cinder/volume/drivers/lvm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 = {} -- 2.45.2