Clean up disaster recovery objects
Summary and Key concepts
Summary
This article explains how to delete a disaster recovery (DR) setup in a Portworx environment. It includes steps to remove the migrationschedule object, associated migration objects, schedule policies, and the ClusterPair object from the source cluster. After deleting the migration schedule, additional migration objects linked to it should also be removed. Platform-specific commands using kubectl or oc are provided to manage these deletions effectively, depending on the Kubernetes environment.
Kubernetes Concepts
- Namespaces: Used here to specify the namespace where DR objects like
migrationscheduleandClusterPairreside and from which they are deleted. - SchedulePolicy: In this context, the
schedulepolicyobject is associated with migration scheduling, and this guide includes steps for deleting the policy when the DR setup is no longer needed.
Portworx Concepts
-
MigrationSchedule: A Portworx object used to automate periodic migrations; deleting it involves additional steps to remove related migration objects.
-
ClusterPair: Represents the DR relationship between clusters, which is deleted from the source cluster to dismantle the DR configuration.
If you no longer require a disaster recovery object, you can delete it.
Perform the following steps from a location where you have kubectl or oc access to the source cluster:
-
Delete the migration schedule:
- Kubernetes
- OpenShift
kubectl delete migrationschedules <migrationschedule-name> -n <migrationnamespace>oc delete migrationschedules <migrationschedule-name> -n <migrationnamespace>noteOnce a
migrationscheduleobject is deleted, also delete all associated migration objects that you retrieved in step 2 of the previous section. -
Delete the associated schedule policy:
- Kubernetes
- OpenShift
kubectl delete schedulepolicy <your-schedule-policy>oc delete schedulepolicy <your-schedule-policy> -
Delete the cluster pair from the source cluster:
- Kubernetes
- OpenShift
kubectl delete clusterpair <migration-cluster-pair> -n <migrationnamespace>oc delete clusterpair <migration-cluster-pair> -n <migrationnamespace>