3.13. ApplicationSet-based application failover between managed clusters
Perform a failover when a managed cluster becomes unavailable, due to any reason. This failover method is application-based.
Prerequisites
When the primary cluster is in a state other than
Ready, check the actual status of the cluster as it might take some time to update.-
Navigate to the RHACM console
Infrastructure Clusters Cluster list tab. Check the status of both the managed clusters individually before performing failover operation.
However, failover operation can still be performed when the cluster you are failing over to is in a Ready state.
-
Navigate to the RHACM console
Procedure
Enable fencing on the Hub cluster.
Open CLI terminal and edit the DRCluster resource, where <drcluster_name> is a unique name.
ImportantOnce 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.$ 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 editedVerify 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"}'Example output:
FencedVerify that the IPs that belong to the OpenShift Container Platform cluster nodes are now in the blocklist.
$ ceph osd blocklist lsExample output
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
- On the Hub cluster, navigate to Applications.
- Click the Actions menu at the end of application row to view the list of available actions.
- Click Failover application.
- When the Failover application modal is shown, verify the details presented are correct and check the status of the Failover readiness. If the status is Ready with a green tick, it indicates that the target cluster is ready for failover to start.
- Click Initiate. All the system workloads and their available resources are now transferred to the target cluster.
- Close the modal window and track the status using the Data policy column on the Applications page.
Verify that the activity status shows as FailedOver for the application.
-
Navigate to the Applications
Overview tab. - In the Data policy column, click the policy link for the application you applied the policy to.
- On the Data policy popover, verify that you can see one or more policy names and the ongoing activities associated with the policy in use with the application.
-
Navigate to the Applications