]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: Set the data pool correctly when creating images
authorAdam Wolfe Gordon <awg@digitalocean.com>
Thu, 10 Aug 2017 19:31:38 +0000 (15:31 -0400)
committerAdam Wolfe Gordon <awg@digitalocean.com>
Mon, 14 Aug 2017 17:15:36 +0000 (11:15 -0600)
Previously the data-pool option was ignored by rbd-mirror, so when using
erasure coding data for the image on the secondary site would end up in
the metadata pool.

Configure the data-pool using the data-pool's name from the primary site
when creating images on the secondary site.

Fixes: http://tracker.ceph.com/issues/20567
Signed-off-by: Adam Wolfe Gordon <awg@digitalocean.com>
src/tools/rbd_mirror/image_replayer/CreateImageRequest.cc

index 5db89b4d1cc396ce7aa5f8b4ab3ecbb038117798..acef392b1a4eafbb49d7aa3408cdd14f6644ec47 100644 (file)
@@ -74,6 +74,8 @@ void CreateImageRequest<I>::create_image() {
                     m_remote_image_ctx->stripe_unit);
   image_options.set(RBD_IMAGE_OPTION_STRIPE_COUNT,
                     m_remote_image_ctx->stripe_count);
+  image_options.set(RBD_IMAGE_OPTION_DATA_POOL,
+                   m_remote_image_ctx->data_ctx.get_pool_name());
 
   librbd::image::CreateRequest<I> *req = librbd::image::CreateRequest<I>::create(
     m_local_io_ctx, m_local_image_name, m_local_image_id,