summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-01-08 04:45:24 +0000
committerGerrit Code Review <review@openstack.org>2021-01-08 04:45:24 +0000
commit60a73610910257abf5bdd5eae7606f5bd012ae5d (patch)
tree0bf4af2c9497c8104b82fdbc7e9e7ff4250e590f
parentd543201bd0f4365dcb56c8a306cf1f70d5cc3a62 (diff)
parent07adabef0707620b25e5fd0fd464fa09e4b88ed1 (diff)
downloadcinder-60a73610910257abf5bdd5eae7606f5bd012ae5d.tar.gz
Merge "Do not fail when depth is greater than rbd_max_clone_depth" into stable/train
-rw-r--r--cinder/volume/drivers/rbd.py12
-rw-r--r--releasenotes/notes/bug-1901241-361b1b361bfa5152.yaml8
2 files changed, 12 insertions, 8 deletions
diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py
index f06162d68..a3a48607e 100644
--- a/cinder/volume/drivers/rbd.py
+++ b/cinder/volume/drivers/rbd.py
@@ -82,7 +82,9 @@ RBD_OPTS = [
default=5,
help='Maximum number of nested volume clones that are '
'taken before a flatten occurs. Set to 0 to disable '
- 'cloning.'),
+ 'cloning. Note: lowering this value will not affect '
+ 'existing volumes whose clone depth exceeds the new '
+ 'value.'),
cfg.IntOpt('rbd_store_chunk_size', default=4,
help='Volumes will be chunked into objects of this size '
'(in megabytes).'),
@@ -636,12 +638,6 @@ class RBDDriver(driver.CloneableImageVD, driver.MigrateVD,
if not parent:
return depth
- # If clone depth was reached, flatten should have occurred so if it has
- # been exceeded then something has gone wrong.
- if depth > self.configuration.rbd_max_clone_depth:
- raise Exception(_("clone depth exceeds limit of %s") %
- (self.configuration.rbd_max_clone_depth))
-
return self._get_clone_depth(client, parent, depth + 1)
def _extend_if_required(self, volume, src_vref):
@@ -711,7 +707,7 @@ class RBDDriver(driver.CloneableImageVD, driver.MigrateVD,
depth = self._get_clone_depth(client, src_name)
# If dest volume is a clone and rbd_max_clone_depth reached,
# flatten the dest after cloning. Zero rbd_max_clone_depth means
- # infinite is allowed.
+ # volumes are always flattened.
if depth >= self.configuration.rbd_max_clone_depth:
LOG.info("maximum clone depth (%d) has been reached - "
"flattening dest volume",
diff --git a/releasenotes/notes/bug-1901241-361b1b361bfa5152.yaml b/releasenotes/notes/bug-1901241-361b1b361bfa5152.yaml
new file mode 100644
index 000000000..7609cfe9d
--- /dev/null
+++ b/releasenotes/notes/bug-1901241-361b1b361bfa5152.yaml
@@ -0,0 +1,8 @@
+---
+fixes:
+ - |
+ RBD driver `bug #1901241
+ <https://bugs.launchpad.net/cinder/+bug/1901241>`_:
+ Fixed an issue where decreasing the ``rbd_max_clone_depth`` configuration
+ option would prevent volumes that had already exceeded that depth from
+ being cloned.