Relocating an ApplicationSet-based application between managed clusters

Relocate an application to its preferred location when all managed clusters are available.

Before you begin

  • If your setup has active and passive RHACM hub clusters, see Hub recovery using Red Hat Advanced Cluster Management [Technology preview].
  • When 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.
    1. Navigate to RHACM console > Infrastructure > Clusters > Cluster list tab.
    2. Check the status of both the managed clusters individually before performing a relocate operation.
  • Verify that applications were cleaned up from the cluster before unfencing it.

Procedure

  1. Disable fencing on the Hub cluster.
    1. 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 edited
    2. Gracefully reboot OpenShift Container Platform nodes that were Fenced.
      A restart is required to resume the I/O operations after unfencing to avoid any further recovery orchestration failures. Restart all nodes of the cluster by following the steps in the Nodes > Working with nodes > Understanding node rebooting > Rebooting a node gracefully Red Hat OpenShift Container Platform product documentation.
      Note: Make sure that all the nodes are initially cordoned and drained before you restart and perform uncordon operations on the nodes.
    3. After all Red Hat OpenShift nodes are rebooted and are in a Ready status, verify that all Pods are in a healthy state.
      Run the following command on the Primary-managed cluster (or the cluster has been Unfenced):
      oc get pods -A | egrep -v 'Running|Completed'
      Example output:
      NAMESPACE                                          NAME                                                              READY   STATUS      RESTARTS       AGE
      The output for this query is zero Pods before proceeding to the next step.
      Note: 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 Red Hat OpenShift, it also must be properly recovered after a site outage for Red Hat OpenShift applications to be healthy.

      Alternatively, you can use the Red Hat OpenShift Web Console dashboards and Overview tab to assess the health of applications and the external Fusion Data Foundation storage cluster. The detailed Fusion Data Foundation dashboard is found by going to Storage > Data Foundation.

    4. Verify that the Unfenced cluster is in a healthy state.
      Validate the fencing status in the Hub cluster for the Primary-managed cluster, replacing <drcluster_name> with your unique name.
      oc get drcluster.ramendr.openshift.io <drcluster_name> -o jsonpath='{.status.phase}{"\n"}'
      Example output: Unfenced
    5. Verify that the IPs that belong to the OpenShift Container Platform cluster nodes are NOT in the blocklist.
      ceph osd blocklist ls

      Ensure that you do not see the IPs added during fencing.

  2. On the Hub cluster, navigate to Applications.
  3. Click the Actions menu at the end of application row to view the list of available actions.
  4. Click Relocate application.
  5. When the Relocate application modal is shown, select Policy and Target cluster to which the associated application migrates to.
  6. Click Initiate.
    All the system workloads and their available resources are now transferred to the target cluster.
  7. Close the modal window and track the status using the Data policy column on the Applications page.
  8. Verify that the activity status shows as Relocated for the application.
    1. Go to Applications > Overview.
    2. In the Data policy column, click the policy link for the application you applied the policy to.
    3. On the Data Policy popover page, verify that you can see one or more policy names and the relocation status associated with the policy in use with the application.