Chapter 8. Creating Disaster Recovery Policy on Hub cluster
OpenShift DR uses Disaster Recovery Policy (DRPolicy) resources (cluster scoped) on the RHACM hub cluster to deploy, failover, and relocate workloads across managed clusters.
Prerequisites
- Ensure that there is a set of two clusters, which are peered for storage level replication and that CSI Volume Replication is enabled.
- Ensure that there is a scheduling interval that determines at what frequency data replication is performed which also serves as a coarse grained Recovery Point Objective (RPO) for the workload using the DRPolicy.
- Ensure that each cluster in the policy is assigned a S3 profile name, which is configured using the ConfigMap of the OpenShift DR cluster and hub operators.
Procedure
-
On the Hub cluster, navigate to Installed Operators in the
openshift-dr-system
project and click on OpenShift DR Hub Operator. You should see two available APIs, DRPolicy and DRPlacementControl. - Click Create instance for DRPolicy and click YAML view.
Copy and save the following YAML to filename
drpolicy.yaml
after replacing <cluster1> and <cluster2> with the correct names of your managed clusters in ACM. Replace <string_value_1> and <string_value_2> with any values as long as they are unique (for example: east and west). TheschedulingInterval
should be one of the values configured in the MirrorPeer earlier (for example: 5m).apiVersion: ramendr.openshift.io/v1alpha1 kind: DRPolicy metadata: name: odr-policy-5m spec: drClusterSet: - name: <cluster1> region: <string_value_1> s3ProfileName: s3profile-<cluster1>-ocs-storagecluster - name: <cluster2> region: <string_value_2> s3ProfileName: s3profile-<cluster2>-ocs-storagecluster schedulingInterval: 5m
NoteThere is no need to specify a namespace to create this resource because DRPolicy is a cluster-scoped resource.
-
Copy the contents of your unique
drpolicy.yaml
file into the YAML view. You must completely replace the original content. Click Create on the YAML view screen.
ImportantThe DRPolicy
schedulingInterval
must match one of the values configured in MirroPeer resource (e.g. 5m). To use one of the otherschedulingIntervals
for volume replication configured in the MirrorPeer requires creating additional DRPolicy resources with the new values (i.e., 15m). Make sure to change the DRPolicyname
to be unique and useful in identifying the replication interval (e.g. odr-policy-15m).Verify that the DRPolicy is created successfully by running the command on the Hub cluster for each DRPolicy resource created. This example is for
odr-policy-5m
:$ oc get drpolicy odr-policy-5m -n openshift-dr-system -o jsonpath='{.status.conditions[].reason}{"\n"}'
Example output:
Succeeded