Failover disaster recovery protected discovered application

Before you begin

  • Ensure that the application namespace is created in both managed clusters (for example, busybox-discovered).

About this task

This section guides you on how to failover a discovered application which is disaster recovery protected.

Procedure

  1. Enable fencing on the Hub cluster.
    1. Open CLI terminal and edit the DRCluster resource, where <drcluster_name> is your unique name.
      oc edit drcluster <drcluster_name>
      apiVersion: ramendr.openshift.io/v1alpha1
      kind: DRCluster
      metadata:
      [...]
      spec:
        ## Add this line
        clusterFence: Fenced
        cidrs:
        [...]
      [...]
      

      Example output:

      drcluster.ramendr.openshift.io/ocp4perf1 edited
      Note: Once the managed cluster is fenced, all communication from applications to the OpenShift Data Foundation external storage cluster will fail and some Pods will be in an unhealthy state (for example: CreateContainerError, CrashLoopBackOff) on the cluster that is now fenced.
    2. Verify the fencing status on the Hub cluster for the Primary managed cluster, replacing <drcluster_name> is your unique identifier.
      oc get drcluster.ramendr.openshift.io <drcluster_name> -o jsonpath='{.status.phase}{"\n"}'
      Fenced
    3. Login to your Ceph cluster and verify that the IPs that belong to the OpenShift Container Platform cluster nodes are now in the blocklist.
      ceph osd blocklist ls
      cidr:10.1.161.1:0/32 2028-10-30T22:30:03.585634+0000
      cidr:10.1.161.14:0/32 2028-10-30T22:30:02.483561+0000
      cidr:10.1.161.51:0/32 2028-10-30T22:30:01.272267+0000
      cidr:10.1.161.63:0/32 2028-10-30T22:30:05.099655+0000
      cidr:10.1.161.129:0/32 2028-10-30T22:29:58.335390+0000
      cidr:10.1.161.130:0/32 2028-10-30T22:29:59.861518+0000
  2. In the RHACM console, navigate to Disaster Recovery > Protected applications tab.
  3. At the end of the application row, click on the Actions menu and choose to initiate Failover.
  4. In the Failover application modal window, review the status of the application and the target cluster.
  5. Click Initiate. Wait for the Failover process to complete.
  6. Verify that the busybox application is running on the Secondary managed cluster.
    oc get pods,pvc -n busybox-discovered
    NAME                           READY   STATUS    RESTARTS   AGE
    pod/busybox-796fccbb95-qmxjf   1/1     Running   0          2m46s
    
    
    NAME                                STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                  VOLUMEATTRIBUTESCLASS   AGE
    persistentvolumeclaim/busybox-pvc   Bound    pvc-b20e4129-902d-47c7-b962-040ad64130c4   1Gi        RWO            ocs-storagecluster-ceph-rbd   <unset>                 2m57s
  7. Check the progression status of Failover until the result is WaitOnUserToCleanup. The DRPC name can be identified by the unique Name configured in prior steps (for example, busybox-rbd).
    oc get drpc {drpc_name} -n openshift-dr-ops -o jsonpath='{.status.progression}{"\n"}'
    WaitOnUserToCleanUp
  8. Remove the busybox application from the Primary managed cluster to complete the Failover process.
    1. Navigate to the Protected applications tab. You will see a message to remove the application.
    2. Navigate to the cloned repository for busybox and run the following commands on the Primary managed cluster where you failed over from. Use the same directory that was used to create the application (for example, odr-metro-rbd).
      cd ~/ocm-ramen-samples/
      git branch
      * main
      
      oc delete -k workloads/deployment/odr-metro-rbd -n busybox-discovered
      persistentvolumeclaim "busybox-pvc" deleted
      deployment.apps "busybox" deleted
  9. After deleting the application, navigate to the Protected applications tab and verify that the busybox resources are both in Healthy status.