cinder/releasenotes/notes/rbd-choose-correct-stripe-unit-9d317f4717533fb4.yaml
Jon Bernard 49a2c85eda RBD: use correct stripe unit in clone operation
The recent release of Ceph Pacific saw a change to the clone() logic
where invalid values of stripe unit would cause an error to be returned
where previous versions would correct the value at runtime.  This
becomes a problem when creating a volume from an image, where the source
RBD image may have a larger stripe unit than cinder's RBD driver is
configured for.  When this happens, clone() is called with a stripe unit
that is too small given that of the source image and the clone fails.

The RBD driver in Cinder has a configuration parameter
'rbd_store_chunk_size' that stores the preferred object size for cloned
images.  If clone() is called without a stripe_unit passed in, the
stripe unit defaults to the object size, which is 4MB by default.  The
issue arises when creating a volume from a Glance image, where Glance is
creating images with a default stripe unit of 8MB (distinctly larger
than that of Cinder).  If we do not consider the incoming stripe unit
and select the larger of the two, Ceph cannot clone an RBD image with a
smaller stripe unit and raises an error.

This patch adds a function in our driver's clone logic to select the
larger of the two stripe unit values so that the appropriate stripe unit
is chosen.

It should also be noted that we're determining the correct stripe unit,
but using the 'order' argument to clone().  Ceph will set the stripe
unit equal to the object size (order) by default and we rely on this
behaviour for the following reason: passing stripe-unit alone or with
an order argument causes an invalid argument exception to be raised in
pre-pacific releases of Ceph, as it's argument parsing appears to have
limitations.

Closes-Bug: #1931004
Change-Id: Iec111ab83e9ed8182c9679c911e3d90927d5a7c3
2021-08-02 11:13:13 -04:00

7 lines
221 B
YAML

---
fixes:
- |
`Bug #1931004 <https://bugs.launchpad.net/cinder/+bug/1931004>`_: Fixed
use of incorrect stripe unit in RBD image clone causing volume-from-image
to fail when using raw images backed by Ceph.