From 4a46b61114cfb81dac08a0289b509f3885f4fa8a Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Wed, 29 Jul 2015 11:45:39 -0400 Subject: [PATCH] RBD: use user-configured value for chunk size 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 277e0a7b1..6a894f57a 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -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 -- 2.45.2