Creating and scheduling online backups of Cloud Pak for Data with IBM Storage Fusion

Create and schedule online backups of a Cloud Pak for Data deployment with IBM Storage Fusion.

Before you begin

Ensure that all backup prerequisite tasks are done.

About this task

To create online backups, your Cloud Pak for Data deployment must meet the following requirements:
  • The minimum deployment profile of IBM Cloud Pak foundational services is Small.

    For more information about sizing IBM Cloud Pak foundational services, see Hardware requirements and recommendations for foundational services.

  • All services are installed at the same Cloud Pak for Data release.

    You cannot back up and restore a deployment that is running service versions from different Cloud Pak for Data releases.

  • The Cloud Pak for Data control plane is installed in a single project (namespace).
  • The Cloud Pak for Data instance is installed in zero or more tethered projects.
  • Cloud Pak for Data operators and the Cloud Pak for Data instance are in a good state. For more information, see Best practices for monitoring Cloud Pak for Data.

If service-related custom resources are manually placed into maintenance mode prior to creating an online backup, those custom resources will remain in the same state if the backup is restored. Taking these services out of maintenance mode must be done manually after the restore.

You must be a cluster administrator or a similar role to create backups.

Procedure

Creating IBM Storage Fusion backup and restore resources on the hub

  1. Create a backup object storage location for the backups.
    1. In IBM Storage Fusion, go to Backup & restore > Locations and click Add location.
    2. Add details for the location and click Add.
  2. Create a backup policy for the Cloud Pak for Data applications, and tie them to the backup storage location.
    1. Go to Backup & restore > Policies and click Add policy.
    2. Add details for the policy.
    3. Under Frequency, schedule when to run the backup policy.
    4. Click Create policy.
    5. If you are creating one policy per application, repeat these steps for each project (namespace) with a backup and restore recipe.
      Recommendation: Create a single backup policy for all Cloud Pak for Data applications.
  3. Create backup policy assignments.
    Note: If your Cloud Pak for Data deployment has tethered projects (namespaces), do not create a backup policy or assign a backup policy to those projects. The tethered projects are handled with the primary IBM Cloud Pak for Data control plane project.
    1. Go to Backup & restore > Backed up applications and click Protect apps.
    2. From the cluster menu, select the source cluster.
    3. In the Protect applications window, find and select the Cloud Pak for Data instance (tenant): ${PROJECT_CPD_INST_OPERATORS} application from the list and click Next.
    4. Select a policy to assign to the application, and then set Back up now toggle button to off.
      Notes:

      Do not assign a policy to the ${PROJECT_CPD_INST_OPERANDS} application. This application is backed up with the recipe, described in the following step, that is used to back up the ${PROJECT_CPD_INST_OPERATORS} application.

      Backup and restore recipe details are not yet associated with the policy assignment, so any backups that are taken now will be invalid.

    5. If the Cloud Pak for Data scheduling service is installed, repeat these steps to assign the ${PROJECT_SCHEDULING_SERVICE} policy to the scheduling service.
  4. Patch policy assignments with the backup and restore recipe details.
    1. Log in to Red Hat® OpenShift® Container Platform as an instance administrator.
      ${OC_LOGIN}
      Remember: OC_LOGIN is an alias for the oc login command.
    2. Get each policy assignment name:
      export PROJECT_FUSION=<fusion-namespace>
      oc get policyassignment -n ${PROJECT_FUSION}
    3. If installed, patch the ${PROJECT_SCHEDULING_SERVICE} policy assignment:
      oc -n ${PROJECT_FUSION} patch policyassignment <cpd-scheduler-policy-assignment> --type merge -p '{"spec":{"recipe":{"name":"ibmcpd-scheduler", "namespace":"'${PROJECT_SCHEDULING_SERVICE}'", "apiVersion":"spp-data-protection.isf.ibm.com/v1alpha1"}}}'
    4. Patch the Cloud Pak for Data tenant policy assignment:
      oc -n ${PROJECT_FUSION} patch policyassignment <cpd-tenant-policy-assignment> --type merge -p '{"spec":{"recipe":{"name":"ibmcpd-tenant", "namespace":"'${PROJECT_CPD_INST_OPERATORS}'", "apiVersion":"spp-data-protection.isf.ibm.com/v1alpha1"}}}'
  5. Verify that policy assignments are associated to the correct Cloud Pak for Data backup and restore recipes by running the command again:
    oc get policyassignments.data-protection.isf.ibm.com -n ${PROJECT_FUSION}

    Check that the command returns output such as in the following example.

    NAME                                 PROVIDER             APPLICATION        BACKUPPOLICY    RECIPE                RECIPENAMESPACE    PHASE      LASTBACKUPTIMESTAMP   CAPACITY
    cpd-operator-cpd-operator-apps       isf-backup-restore   cpd-operator       cpd-operator    ibmcpd-tenant         cpd-operator       Assigned   20h                   59460607
    cpd-scheduler-cpd-scheduler-apps     isf-backup-restore   cpd-scheduler      cpd-scheduler   ibmcpd-scheduler      cpd-scheduler      Assigned   20h                   88206
  6. If the recipes are not associated to the correct policy assignments, do the following substeps.
    1. Unassign the policies from the applications.
    2. Verify that the cpdbr service is installed in the Cloud Pak for Data operator project and in the Cloud Pak for Data control plane project.
    3. Verify that the recipe recipes.spp-data-protection.isf.ibm.com was installed in both projects.
    4. Reassign the policies to the respective applications.
    5. Repeat step 6.

Backing up Cloud Pak for Data applications

  1. Go to Backup & restore > Backed up applications.
  2. Select the ${PROJECT_CPD_INST_OPERATORS} application and click Back up now.

    When the ${PROJECT_CPD_INST_OPERATORS} application is backed up, the ${PROJECT_CPD_INST_OPERANDS} project is backed up with it.

  3. If installed, repeat the previous step to back up the ${PROJECT_SCHEDULING_SERVICE} application.

Monitoring backup jobs

  1. To monitor backup jobs, go to Backup & restore > Jobs and click the Backups tab.
  2. Select a job to view the inventory of what resources will be backed up and the progress of the backup flow.

What to do next

If a backup fails, you must return Cloud Pak for Data to a good state before you can retry a backup. Do the following steps:
  1. Get the Cloud Pak for Data instance (tenant) pod:
    CPD_TENANT_POD=`oc get po -n ${PROJECT_CPD_INST_OPERATORS} -l component=cpdbr-tenant,icpdsupport/addOnId=cpdbr,icpdsupport/app=br-service | grep cpdbr-tenant-service | awk '{print $1}'`
    echo "cpd tenant pod: $CPD_TENANT_POD"
  2. Run backup post-hooks:
    oc exec -it -n ${PROJECT_CPD_INST_OPERATORS} $CPD_TENANT_POD -- /cpdbr-scripts/cpdbr/checkpoint_backup_posthooks.sh --tenant-operator-namespace=${PROJECT_CPD_INST_OPERATORS}

If you have services that connect to an external database, such as for business intelligence (BI) reporting, it is recommended that you also back up the database. Backing up the external database ensures data consistency if the Cloud Pak for Data backup is later restored. For example, you need to restore an older Cloud Pak for Data backup instead of the most recent backup. The external database is synchronized with the most recent Cloud Pak for Data backup, so it has data that is not in the backup that you want to restore. To maintain data consistency, you need to restore the external database backup that was taken at the same time as the Cloud Pak for Data backup.