3.15. Relocating an ApplicationSet-based application between managed clusters
Relocate an application to its preferred location when all managed clusters are available.
Prerequisite
- If your setup has active and passive RHACM hub clusters, see Hub recovery using Red Hat Advanced Cluster Management.
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. Relocate can only be performed when both primary and preferred clusters are up and running.
-
Navigate to RHACM console
Infrastructure Clusters Cluster list tab. - Check the status of both the managed clusters individually before performing relocate operation.
-
Navigate to RHACM console
- Verify that applications were cleaned up from the cluster before unfencing it.
Procedure
Disable fencing on the Hub cluster.
Edit the DRCluster resource for this cluster, replacing <drcluster_name> with a unique name.
$ oc edit drcluster <drcluster_name>apiVersion: ramendr.openshift.io/v1alpha1 kind: DRCluster metadata: [...] spec: cidrs: [...] ## Modify this line clusterFence: Unfenced [...] [...]Example output:
drcluster.ramendr.openshift.io/ocp4perf1 editedGracefully reboot OpenShift Container Platform nodes that were
Fenced. A reboot is required to resume the I/O operations after unfencing to avoid any further recovery orchestration failures. Reboot all nodes of the cluster by following the steps in the procedure, Rebooting a node gracefully.注記Make sure that all the nodes are initially cordoned and drained before you reboot and perform uncordon operations on the nodes.
After all OpenShift nodes are rebooted and are in a
Readystatus, verify that all Pods are in a healthy state by running this command on the Primary managed cluster (or whatever cluster has been Unfenced).oc get pods -A | egrep -v 'Running|Completed'Example output:
NAMESPACE NAME READY STATUS RESTARTS AGEThe output for this query should be zero Pods before proceeding to the next step.
重要If there are Pods still in an unhealthy status because of severed storage communication, troubleshoot and resolve before continuing. Because the storage cluster is external to OpenShift, it also has to be properly recovered after a site outage for OpenShift applications to be healthy.
Alternatively, you can use the OpenShift Web Console dashboards and Overview tab to assess the health of applications and the external ODF storage cluster. The detailed OpenShift Data Foundation dashboard is found by navigating to Storage
Data Foundation. Verify that the
Unfencedcluster is in a healthy state. Validate the fencing status in the Hub cluster for the Primary-managed cluster, replacing <drcluster_name> with a unique name.$ oc get drcluster.ramendr.openshift.io <drcluster_name> -o jsonpath='{.status.phase}{"\n"}'Example output:
UnfencedVerify that the IPs that belong to the OpenShift Container Platform cluster nodes are NOT in the blocklist.
$ ceph osd blocklist lsEnsure that you do not see the IPs added during fencing.
- 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 Relocate application.
- When the Relocate application modal is shown, select policy and target cluster to which the associated application will relocate to in case of a disaster.
- Click Initiate. The busybox resources are now created on 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 Relocated 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 relocation status associated with the policy in use with the application.
-
Navigate to the Applications