Restoring a Cloud Pak for Data online backup to the same cluster with NetApp Astra Control Center

You can restore an online backup of a Cloud Pak for Data instance to the same cluster with NetApp Astra Control Center.

Before you begin

Check that both the State and Hook state columns for the backup show Healthy. If one of the columns shows Unhealthy, the backup is not valid and it cannot be restored.
Tip: A failed execution hook will cause the Hook state column to show Unhealthy.

About this task

You cannot restore a backup to a different project of the Cloud Pak for Data instance.

Cloud Pak for Data instance projects (namespaces) must be deleted before you restore a Cloud Pak for Data instance (tenant).

Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

Procedure

Delete Cloud Pak for Data resources and projects

  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. Delete non-namespaced resources.
    1. Get the list of PersistentVolumes (PVs) from the Cloud Pak for Data instance that are in the Released state:
      oc get pv --no-headers | grep "Released.*${PROJECT_CPD_INST_OPERANDS}/.*" | awk '{print $1}'
    2. Delete those PVs:
      oc get pv --no-headers | grep "Released.*${PROJECT_CPD_INST_OPERANDS}/.*" | awk '{print $1}' | xargs oc delete pv
    3. Deleted outdated security context constraints (SCCs):
      oc get scc | grep ${PROJECT_CPD_INST_OPERANDS} | awk '{print $1}' | xargs oc delete scc
  3. Locate and remove finalizers that might block the deletion of the Cloud Pak for Data instance operand project, and then delete the operand project:
    oc project ${PROJECT_CPD_INST_OPERANDS}
    while read -r resource_type
    do
        echo "${resource_type}"
        while read -r resource
        do
            if [ -z "${resource}" ]; then
                continue
            fi
            kubectl delete "${resource}" -n "${PROJECT_CPD_INST_OPERANDS}" --timeout=10s \
            || kubectl patch "${resource}" -n "${PROJECT_CPD_INST_OPERANDS}" \
                --type=merge \
                --patch '{"metadata":{"finalizers":[]}}'
        done <<< "$(kubectl get "${resource_type}" -n "${PROJECT_CPD_INST_OPERANDS}" -o name  | sort)"
    done <<< "$(kubectl api-resources --namespaced=true -o name | grep ibm.com | sort)"
    oc delete project ${PROJECT_CPD_INST_OPERANDS}
  4. When all finalizers are removed, check that the Cloud Pak for Data instance operand project was deleted:
    oc get project ${PROJECT_CPD_INST_OPERANDS} -o yaml
    If the project was deleted, the command returns the following message:
    Error from server (NotFound): namespaces "${PROJECT_CPD_INST_OPERANDS}" not found
  5. Delete non-namespaced resources.
    1. Get the list of PersistentVolumes (PVs) from the Cloud Pak for Data instance that are in the Released state:
      oc get pv --no-headers | grep "Released.*${PROJECT_CPD_INST_OPERANDS}/.*" | awk '{print $1}'
    2. Delete those PVs:
      oc get pv --no-headers | grep "Released.*${PROJECT_CPD_INST_OPERANDS}/.*" | awk '{print $1}' | xargs oc delete pv
    3. Deleted outdated security context constraints (SCCs):
      oc get scc | grep ${PROJECT_CPD_INST_OPERANDS} | awk '{print $1}' | xargs oc delete scc
  6. If some services were installed in tethered projects, repeat steps 1 and 2 for each tethered project.

    In the commands, replace the PROJECT_CPD_INST_OPERANDS environment variable with PROJECT_CPD_INSTANCE_TETHERED.

    Tip: If you set the PROJECT_CPD_INSTANCE_TETHERED_LIST environment variable, print the list of tethered projects to the terminal:
    echo $PROJECT_CPD_INSTANCE_TETHERED_LIST

    Use this information to set the PROJECT_CPD_INSTANCE_TETHERED environment variable before you re-run the commands.

  7. Delete the Cloud Pak for Data instance operator project:
    oc project ${PROJECT_CPD_INST_OPERATORS}
    while read -r resource_type
    do
        echo "${resource_type}"
        while read -r resource
        do
            if [ -z "${resource}" ]; then
                continue
            fi
            kubectl delete "${resource}" -n "${PROJECT_CPD_INST_OPERATORS}" --timeout=10s \
            || kubectl patch "${resource}" -n "${PROJECT_CPD_INST_OPERATORS}" \
                --type=merge \
                --patch '{"metadata":{"finalizers":[]}}'
        done <<< "$(kubectl get "${resource_type}" -n "${PROJECT_CPD_INST_OPERATORS}" -o name  | sort)"
    done <<< "$(kubectl api-resources --namespaced=true -o name | grep ibm.com | sort)"
    oc delete project ${PROJECT_CPD_INST_OPERATORS}

Restoring Cloud Pak for Data

  1. In NetApp Astra Control Center, select Applications.
  2. Select the ${PROJECT_CPD_INST_OPERATORS}-tenant application.
  3. From the Options menu in the Actions column for the application, select Restore.
  4. Select Restore to original namespaces.
  5. Select the snapshot to use for the restore.
  6. Select Next.
  7. Select Restore all resources.
  8. Select Next.
  9. Select Restore.
  10. Add elasticsearch_backups_persistence_size to the Common core services custom resource.
    1. Log in to Red Hat OpenShift Container Platform as a cluster administrator.
      ${OC_LOGIN}
      Remember: OC_LOGIN is an alias for the oc login command.
    2. Get the size of the elastic-master-backups PVC.
      oc get pvc -n ${PROJECT_CPD_INST_OPERANDS} elasticsearch-master-backups -o yaml
      Under status.capacity.storage, note the size of the PVC.
    3. Edit the Common core services custom resource:
      oc edit -n ${PROJECT_CPD_INST_OPERANDS} ccs ccs-cr
    4. Add the following line after spec, specifying the size noted in step 15b:
      elasticsearch_backups_persistence_size: "<size>"
      For example, 30Gi.

Results

NetApp Astra Control Center does the following actions:

  1. Restores the ${PROJECT_CPD_INST_OPERATORS}-tenant application Persistent Volumes, PVCs, and cpdbr resources.
  2. Invokes post-restore execution hook.

    ${PROJECT_CPD_INST_OPERATORS}-tenant application resources are restored via OADP.