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
This commit is contained in:
parent
28adea9380
commit
3d3bb11dfc
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in New Issue