Deploy rbd-mirror daemon

It is possible to setup one way or two way replication between pools.
rbd-mirror daemon is responsible for pulling image updates from the
remote peer cluster and applying them to the image within the local
cluster. This patch allows to enable this daemon as part of the
deployment, but the actual configuration between sites remains out
of scope for the deployment script.
This work aims to support [1].

[1] https://review.opendev.org/c/openstack/cinder-tempest-plugin/+/948293

Change-Id: Id1a66c244b9be33b6df63e6504500c77d59a1b9d
Signed-off-by: Francesco Pantano <fpantano@redhat.com>
This commit is contained in:
Francesco Pantano
2025-05-04 21:42:58 +02:00
parent f28dc932b6
commit 1b3afd66c4
2 changed files with 27 additions and 0 deletions

View File

@@ -472,6 +472,26 @@ function configure_rgw_ceph_section {
done
}
# Deploy rbd-mirror on the current site
#
# Note:
#
# One-way Replication
# - When data is mirrored from a primary cluster to a secondary cluster,
# the rbd-mirror daemon runs only on the secondary cluster.
#
# Two-way Replication
# - When data is mirrored from a primary cluster to a secondary cluster,
# but data can be promoted/demoted (switching the role of primary and
# secondary cluster), the rbd-mirror daemon runs on both clusters.
function rbd_mirror {
$SUDO "$CEPHADM" shell --fsid "$FSID" --config "$CEPH_CONFIG" \
--keyring $CEPH_KEYRING -- ceph orch apply rbd-mirror \
"--placement=$HOSTNAME count:1"
}
# Install ceph: add RGW
function rgw {
configure_ceph_embedded_rgw
@@ -517,6 +537,10 @@ function enable_services {
echo "[CEPHADM] Deploying RGW on node $HOSTNAME"
rgw
;;
rbdmirror|RBDMIRROR)
echo "[CEPHADM] Deploying RBD-MIRROR on node $HOSTNAME"
rbd_mirror
;;
esac
done
}
@@ -734,6 +758,8 @@ function configure_ceph {
[ "$ENABLE_CEPH_RGW" == "True" ] && SERVICES+=('rgw')
[ "$ENABLE_CEPH_RBD_MIRROR" == "True" ] && SERVICES+=('rbdmirror')
enable_services
if [[ "$REMOTE_CEPH" = "False" ]]; then
add_pools

View File

@@ -7,6 +7,7 @@ ENABLE_CEPH_MANILA=$(trueorfalse True ENABLE_CEPH_MANILA)
ENABLE_CEPH_NOVA=$(trueorfalse True ENABLE_CEPH_NOVA)
# Do not enable RGW by default as RGW is not tested in upstream CI.
ENABLE_CEPH_RGW=$(trueorfalse False ENABLE_CEPH_RGW)
ENABLE_CEPH_RBD_MIRROR=$(trueorfalse False ENABLE_CEPH_RBD_MIRROR)
CINDER_DRIVER=${CINDER_DRIVER:-ceph}
CINDER_ENABLED_BACKENDS=${CINDER_ENABLED_BACKENDS:-ceph}