]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
RBD: use user-configured value for chunk size
authorJon Bernard <jobernar@redhat.com>
Wed, 29 Jul 2015 15:45:39 +0000 (11:45 -0400)
committerJon Bernard <jobernar@redhat.com>
Fri, 31 Jul 2015 17:11:46 +0000 (13:11 -0400)
This patch allows a user to override the default chunk size in
cinder.conf.  When the driver is initialized, the default configuration
values in CONF are merged with the user-provided overrides into
self.configuration.  In most cases, self.configuration is used unless
the original default value is needed.  In this case, CONF was mistakenly
used when self.configuration was intended, which has the effect of
preventing the user from overriding the default chunk size by ignoring
the provided value.

Related-Bug: #1477706
Change-Id: I66a99950b7c4080de932be7ddac2f1595b9d59f4

cinder/volume/drivers/rbd.py

index 277e0a7b1ce18988f0fe1e37ee578e6332ed0b4c..6a894f57a093e376e3e6e4fbaa91ac05c6d6be15 100644 (file)
@@ -533,7 +533,7 @@ class RBDDriver(driver.RetypeVD, driver.TransferVD, driver.ExtendVD,
 
         LOG.debug("creating volume '%s'", volume['name'])
 
-        chunk_size = CONF.rbd_store_chunk_size * units.Mi
+        chunk_size = self.configuration.rbd_store_chunk_size * units.Mi
         order = int(math.log(chunk_size, 2))
 
         with RADOSClient(self) as client:
@@ -922,7 +922,7 @@ class RBDDriver(driver.RetypeVD, driver.TransferVD, driver.ExtendVD,
 
             self.delete_volume(volume)
 
-            chunk_size = CONF.rbd_store_chunk_size * units.Mi
+            chunk_size = self.configuration.rbd_store_chunk_size * units.Mi
             order = int(math.log(chunk_size, 2))
             # keep using the command line import instead of librbd since it
             # detects zeroes to preserve sparseness in the image