diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a90eedc..a85feabd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -713,7 +713,7 @@ jobs: run : ~/actionutils.sh remote_configure_rbd_mirroring - name: Wait for RBD mirror to sync images - run : ~/actionutils.sh remote_wait_for_secondary_to_sync + run : ~/actionutils.sh remote_wait_for_secondary_to_sync 4 - name: Verify RBD mirror run : ~/actionutils.sh remote_verify_rbd_mirroring diff --git a/docs/how-to/configure-rbd-mirroring.rst b/docs/how-to/configure-rbd-mirroring.rst index 1629d904..98c47b4d 100644 --- a/docs/how-to/configure-rbd-mirroring.rst +++ b/docs/how-to/configure-rbd-mirroring.rst @@ -1,5 +1,5 @@ ================================== -Configure RBD remote replication +Configure RBD replication ================================== MicroCeph supports asynchronously replicating (mirroring) RBD images to a remote cluster. @@ -13,25 +13,25 @@ Prerequisites 3. Both clusters have 2 rbd pools: pool_one and pool_two. 4. Both pools at cluster "primary_cluster" have 2 images each (image_one and image_two) while the pools at cluster "secondary_cluster" are empty. -Enable RBD remote replication +Enable RBD replication ------------------------------- An operator can enable replication for a given rbd pool which is present at both clusters as .. code-block:: none - sudo microceph remote replication rbd enable pool_one --remote secondary_cluster + sudo microceph replication rbd enable pool_one --remote secondary_cluster Here, pool_one is the name of the rbd pool and it is expected to be present at both the clusters. -Check RBD remote replication status +Check RBD replication status ------------------------------------ The above command will enable replication for ALL the images inside pool_one, it can be checked as: .. code-block:: none - sudo microceph remote replication rbd status pool_one + sudo microceph replication rbd status pool_one +------------------------+----------------------+ | SUMMARY | HEALTH | +-------------+----------+-------------+--------+ @@ -48,14 +48,14 @@ The above command will enable replication for ALL the images inside pool_one, it The status shows that there are 2 images in the pool which are enabled for mirroring. -Listing all RBD remote replication images +Listing all RBD replication images ------------------------------------------ An operator can list all the images that have replication (mirroring) enabled as follows: .. code-block:: none - sudo microceph remote replication rbd list + sudo microceph replication rbd list +-----------+------------+------------+---------------------+ | POOL NAME | IMAGE NAME | IS PRIMARY | LAST LOCAL UPDATE | +-----------+------------+------------+---------------------+ @@ -65,7 +65,7 @@ An operator can list all the images that have replication (mirroring) enabled as | pool_two | image_two | true | 2024-10-08 13:55:07 | +-----------+------------+------------+---------------------+ -Disabling RBD remote replication +Disabling RBD replication --------------------------------- In some cases, it may be desired to disable replication. A single image ($pool/$image) or @@ -74,8 +74,8 @@ a whole pool ($pool) can be disabled in a single command as follows: Disable Pool replication: .. code-block:: none - sudo microceph remote replication disable pool_one - sudo microceph remote replication list + sudo microceph replication rbd disable pool_one + sudo microceph replication rbd list +-----------+------------+------------+---------------------+ | POOL NAME | IMAGE NAME | IS PRIMARY | LAST LOCAL UPDATE | +-----------+------------+------------+---------------------+ @@ -86,8 +86,8 @@ Disable Pool replication: Disable Image replication: .. code-block:: none - sudo microceph remote replication disable pool_two/image_two - sudo microceph remote replication list + sudo microceph replication rbd disable pool_two/image_two + sudo microceph replication rbd list +-----------+------------+------------+---------------------+ | POOL NAME | IMAGE NAME | IS PRIMARY | LAST LOCAL UPDATE | +-----------+------------+------------+---------------------+ diff --git a/docs/how-to/import-remote-cluster.rst b/docs/how-to/import-remote-cluster.rst index 50fa87e1..edeecff0 100644 --- a/docs/how-to/import-remote-cluster.rst +++ b/docs/how-to/import-remote-cluster.rst @@ -6,7 +6,7 @@ MicroCeph supports adding secondary MicroCeph clusters as remote clusters. This creates ``$remote.conf/$remote.keyring`` files in the snap's config directory allowing users (and microceph) to perform ceph operations on the remote clusters. -This also enables capabilities like remote replication by exposing required +This also enables capabilities like replication to remote clusters by exposing required remote cluster details to MicroCeph and Ceph. Working with remote MicroCeph clusters diff --git a/docs/how-to/index.rst b/docs/how-to/index.rst index bdbb10b0..054b650a 100644 --- a/docs/how-to/index.rst +++ b/docs/how-to/index.rst @@ -47,7 +47,7 @@ migrate services and more. Managing a remote cluster ------------------------- -Make MicroCeph aware of a remote cluster and configure remote replication for +Make MicroCeph aware of a remote cluster and configure replication for RBD pools and images. .. toctree:: diff --git a/docs/how-to/perform-site-failover.rst b/docs/how-to/perform-site-failover.rst index a3995932..0efac8e6 100644 --- a/docs/how-to/perform-site-failover.rst +++ b/docs/how-to/perform-site-failover.rst @@ -11,7 +11,7 @@ Prerequisites -------------- 1. A primary and a secondary MicroCeph cluster, for example named "primary_cluster" and "secondary_cluster" 2. primary_cluster has imported configurations from secondary_cluster and vice versa. refer to :doc:`import remote <./import-remote-cluster>` -3. RBD remote replication is configured for at least 1 rbd image. refer to :doc:`configure rbd replication <./configure-rbd-mirroring>` +3. RBD replication is configured for at least 1 rbd image. refer to :doc:`configure rbd replication <./configure-rbd-mirroring>` Failover to a non-primary remote cluster ----------------------------------------- @@ -19,7 +19,7 @@ List all the resources on 'secondary_cluster' to check primary status. .. code-block:: none - sudo microceph remote replication rbd list + sudo microceph replication rbd list +-----------+------------+------------+---------------------+ | POOL NAME | IMAGE NAME | IS PRIMARY | LAST LOCAL UPDATE | +-----------+------------+------------+---------------------+ @@ -31,20 +31,20 @@ An operator can perform cluster wide promotion as follows: .. code-block:: none - sudo microceph remote replication rbd promote --remote primary_cluster --yes-i-really-mean-it + sudo microceph replication rbd promote --remote primary_cluster --yes-i-really-mean-it Here, parameter helps microceph filter the resources to promote. Since promotion of secondary_cluster may cause a split-brain condition in future, it is necessary to pass --yes-i-really-mean-it flag. -Verify RBD remote replication primary status +Verify RBD replication primary status --------------------------------------------- List all the resources on 'secondary_cluster' again to check primary status. .. code-block:: none - sudo microceph remote replication rbd status pool_one + sudo microceph replication rbd status pool_one +-----------+------------+------------+---------------------+ | POOL NAME | IMAGE NAME | IS PRIMARY | LAST LOCAL UPDATE | +-----------+------------+------------+---------------------+ @@ -68,14 +68,14 @@ Note: Demotion can cause data loss and hence can only be performed with the 'yes At primary_cluster (was primary before disaster), perform demotion. .. code-block:: none - sudo microceph remote replication rbd demote --remote secondary_cluster + sudo microceph replication rbd demote --remote secondary_cluster failed to process demote_replication request for rbd: demotion may cause data loss on this cluster. If you understand the *RISK* and you're *ABSOLUTELY CERTAIN* that is what you want, pass --yes-i-really-mean-it. Now, again at the 'primary_cluster', perform demotion with --yes-i-really-mean-it flag. .. code-block:: none - sudo microceph remote replication rbd demote --remote secondary_cluster --yes-i-really-mean-it + sudo microceph replication rbd demote --remote secondary_cluster --yes-i-really-mean-it Note: MicroCeph with demote the primary pools and will issue a resync for all the mirroring images, hence it may cause data loss at the old primary cluster. diff --git a/docs/reference/commands/remote-replication-rbd.rst b/docs/reference/commands/replication-rbd.rst similarity index 68% rename from docs/reference/commands/remote-replication-rbd.rst rename to docs/reference/commands/replication-rbd.rst index 2915d913..aa47ce45 100644 --- a/docs/reference/commands/remote-replication-rbd.rst +++ b/docs/reference/commands/replication-rbd.rst @@ -1,21 +1,21 @@ ============================= -``remote replication rbd`` +``replication rbd`` ============================= Usage: .. code-block:: none - microceph remote replication rbd [command] + microceph replication rbd [command] Available commands: .. code-block:: none - configure Configure remote replication parameters for RBD resource (Pool or Image) - disable Disable remote replication for RBD resource (Pool or Image) - enable Enable remote replication for RBD resource (Pool or Image) - list List all configured remotes replication pairs. + configure Configure replication parameters for RBD resource (Pool or Image) + disable Disable replication for RBD resource (Pool or Image) + enable Enable replication for RBD resource (Pool or Image) + list List all configured replications. status Show RBD resource (Pool or Image) replication status Global options: @@ -31,13 +31,13 @@ Global options: ``enable`` ---------- -Enable remote replication for RBD resource (Pool or Image) +Enable replication for RBD resource (Pool or Image) Usage: .. code-block:: none - microceph remote replication rbd enable [flags] + microceph replication rbd enable [flags] Flags: @@ -57,7 +57,7 @@ Usage: .. code-block:: none - microceph remote replication rbd status [flags] + microceph replication rbd status [flags] Flags: @@ -74,7 +74,7 @@ Usage: .. code-block:: none - microceph remote replication rbd list [flags] + microceph replication rbd list [flags] .. code-block:: none @@ -84,13 +84,13 @@ Usage: ``disable`` ------------ -Disable remote replication for RBD resource (Pool or Image) +Disable replication for RBD resource (Pool or Image) Usage: .. code-block:: none - microceph remote replication rbd disable [flags] + microceph replication rbd disable [flags] .. code-block:: none @@ -103,7 +103,7 @@ Promote local cluster to primary .. code-block:: none - microceph remote replication rbd promote [flags] + microceph replication rbd promote [flags] .. code-block:: none @@ -119,7 +119,7 @@ Usage: .. code-block:: none - microceph remote replication rbd demote [flags] + microceph replication rbd demote [flags] .. code-block:: none diff --git a/microceph/cmd/microceph/replication.go b/microceph/cmd/microceph/replication.go index abf5d596..39b41ade 100644 --- a/microceph/cmd/microceph/replication.go +++ b/microceph/cmd/microceph/replication.go @@ -11,7 +11,7 @@ type cmdReplication struct { func (c *cmdReplication) Command() *cobra.Command { cmd := &cobra.Command{ Use: "replication", - Short: "manage remote replication", + Short: "manage replication to remote clusters", } // Replication RBD commands diff --git a/microceph/cmd/microceph/replication_rbd.go b/microceph/cmd/microceph/replication_rbd.go index 9043e35b..2aab6136 100644 --- a/microceph/cmd/microceph/replication_rbd.go +++ b/microceph/cmd/microceph/replication_rbd.go @@ -11,7 +11,7 @@ type cmdReplicationRbd struct { func (c *cmdReplicationRbd) Command() *cobra.Command { cmd := &cobra.Command{ Use: "rbd", - Short: "manage RBD remote replication", + Short: "manage RBD replication to remote clusters", } // Replication enable command diff --git a/microceph/cmd/microceph/replication_rbd_configure.go b/microceph/cmd/microceph/replication_rbd_configure.go index 1f554be3..786b772d 100644 --- a/microceph/cmd/microceph/replication_rbd_configure.go +++ b/microceph/cmd/microceph/replication_rbd_configure.go @@ -17,7 +17,7 @@ type cmdReplicationConfigureRbd struct { func (c *cmdReplicationConfigureRbd) Command() *cobra.Command { cmd := &cobra.Command{ Use: "configure ", - Short: "Configure remote replication parameters for RBD resource (Pool or Image)", + Short: "Configure replication parameters for RBD resource (Pool or Image)", RunE: c.Run, } diff --git a/microceph/cmd/microceph/replication_rbd_disable.go b/microceph/cmd/microceph/replication_rbd_disable.go index f8eeb391..ba9974f5 100644 --- a/microceph/cmd/microceph/replication_rbd_disable.go +++ b/microceph/cmd/microceph/replication_rbd_disable.go @@ -17,7 +17,7 @@ type cmdReplicationDisableRbd struct { func (c *cmdReplicationDisableRbd) Command() *cobra.Command { cmd := &cobra.Command{ Use: "disable ", - Short: "Disable remote replication for RBD resource (Pool or Image)", + Short: "Disable replication for RBD resource (Pool or Image)", RunE: c.Run, } diff --git a/microceph/cmd/microceph/replication_rbd_enable.go b/microceph/cmd/microceph/replication_rbd_enable.go index 67cda541..36b39d21 100644 --- a/microceph/cmd/microceph/replication_rbd_enable.go +++ b/microceph/cmd/microceph/replication_rbd_enable.go @@ -20,7 +20,7 @@ type cmdReplicationEnableRbd struct { func (c *cmdReplicationEnableRbd) Command() *cobra.Command { cmd := &cobra.Command{ Use: "enable ", - Short: "Enable remote replication for RBD resource (Pool or Image)", + Short: "Enable replication for RBD resource (Pool or Image)", RunE: c.Run, } diff --git a/tests/scripts/actionutils.sh b/tests/scripts/actionutils.sh index 1bc81d13..8ff256f2 100755 --- a/tests/scripts/actionutils.sh +++ b/tests/scripts/actionutils.sh @@ -256,7 +256,8 @@ function remote_enable_rbd_mirror_daemon() { function remote_wait_for_secondary_to_sync() { set -eux - # wait till images are synchronised + # wait till $1 images are synchronised + local threshold="${1?missing}" count=0 for index in {1..100}; do echo "Check run #$index" @@ -264,9 +265,9 @@ function remote_wait_for_secondary_to_sync() { echo $list_output images=$(echo $list_output | jq .[].Images) echo $images - img_one_count=$(echo $images | grep -c "image_one" || true) + img_one_count=$(echo $images | grep -c "image_" || true) echo $img_one_count - if [[ $img_one_count -gt 0 ]] ; then + if [[ $img_one_count -eq $threshold ]] ; then break fi @@ -275,7 +276,7 @@ function remote_wait_for_secondary_to_sync() { sleep 30 done - if [count -eq 10] ; then + if [count -eq 100] ; then echo "replication sync check timed out" exit -1 fi