The reason create_image() + enable_mirror() happens to work for
PARENT_POOL is that PARENT_POOL is enabled for mirroring in image mode
unconditionally, unlike POOL, POOL/NS1 or PARENT_POOL/NS1 for which
MIRROR_POOL_MODE setting is respected. This isn't immediately obvious
because it's done in setup_pools() in rbd_mirror_helpers.sh.
Switch to create_image_and_enable_mirror() for clarity.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit
44804a374a8c45b30421282e24667e5c4a77fc03)
rbd --cluster ${CLUSTER1} --pool ${PARENT_POOL} mirror pool info --format json | jq -e '.peers[0].direction == "rx-tx"'
rbd --cluster ${CLUSTER2} --pool ${PARENT_POOL} mirror pool info --format json | jq -e '.peers[0].direction == "rx-tx"'
-create_image ${CLUSTER1} ${PARENT_POOL} image1
-create_image ${CLUSTER2} ${PARENT_POOL} image2
-
-enable_mirror ${CLUSTER1} ${PARENT_POOL} image1
-enable_mirror ${CLUSTER2} ${PARENT_POOL} image2
-
+create_image_and_enable_mirror ${CLUSTER1} ${PARENT_POOL} image1
+create_image_and_enable_mirror ${CLUSTER2} ${PARENT_POOL} image2
create_image_and_enable_mirror ${CLUSTER1} ${PARENT_POOL}/${NS1} image1
create_image_and_enable_mirror ${CLUSTER2} ${PARENT_POOL}/${NS1} image2