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
- 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.
- Delete non-namespaced
resources.
- 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}'
- Delete those PVs:
oc get pv --no-headers | grep "Released.*${PROJECT_CPD_INST_OPERANDS}/.*" | awk '{print $1}' | xargs oc delete pv
- Deleted outdated security context constraints (SCCs):
oc get scc | grep ${PROJECT_CPD_INST_OPERANDS} | awk '{print $1}' | xargs oc delete scc
-
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}
- 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
- Delete non-namespaced
resources.
- 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}'
- Delete those PVs:
oc get pv --no-headers | grep "Released.*${PROJECT_CPD_INST_OPERANDS}/.*" | awk '{print $1}' | xargs oc delete pv
- Deleted outdated security context constraints (SCCs):
oc get scc | grep ${PROJECT_CPD_INST_OPERANDS} | awk '{print $1}' | xargs oc delete scc
- 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.
- 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
-
In NetApp Astra Control Center, select
Applications.
- Select the
${PROJECT_CPD_INST_OPERATORS}-tenant
application.
- From the Options menu in the Actions column for the
application, select Restore.
- Select Restore to original namespaces.
- Select the snapshot to use for the restore.
- Select Next.
- Select Restore all resources.
- Select Next.
- Select Restore.
- Add
elasticsearch_backups_persistence_size
to the Common core services custom resource.
- 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.
- 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.
- Edit the Common core services custom
resource:
oc edit -n ${PROJECT_CPD_INST_OPERANDS} ccs ccs-cr
- 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:
- Restores the
${PROJECT_CPD_INST_OPERATORS}-tenant
application
Persistent Volumes, PVCs, and cpdbr resources.
- Invokes post-restore execution hook.
${PROJECT_CPD_INST_OPERATORS}-tenant
application resources are restored via OADP.