You can restore a Ceph®
Container Storage Interface (CSI) snapshot of an entire
IBM Cloud Pak® for Data instance.
About this task
It is not recommended to install a backup over an existing project.
You can change the storage class of Persistent Volumes (PVs) and Persistent Volume Claims (PVCs)
during restores by creating a config map in the Velero project to configure a storage class mapping.
For more information, see the Velero documentation Changing PV/PVC Storage Classes.
You cannot restore a backup into a different Cloud Pak for Data instance project.
To restore a backup, you must run the OADP backup and restore utility in Kubernetes mode.
- Permissions that you need for this task
- Log on as a user with cluster administrator rights.
For more information about the OADP
backup and restore utility, including a list of commands that you can run, see the cpd-cli oadp reference documentation.
Procedure
- Check that the backup is available and that it completed with no errors:
cpd-cli oadp backup ls
NAME STATUS ERRORS WARNINGS CREATED EXPIRES STORAGE LOCATION SELECTOR
<backup_name> Completed 0 0 <timestamp> 358d default <none>
- Delete the Cloud Pak for Data instance
project.
- Specialized installations only: Enable the IBM Cloud Pak for Data platform operator to watch the project where
you are restoring the instance of Cloud Pak for Data.
Update the nss-cpd-operators
NamespaceScope
resource in the Cloud Pak for Data operator project to watch the project where you
are restoring the instance.
Tip: To retrieve the existing projects in the
namespaceMembers
list,
run the following command. For example, if
Cloud Pak for Data operators are in the
cpd-operators
project,
run:
oc get namespacescope nss-cpd-operators -n ${PROJECT_CPD_OPS} -o jsonpath={.spec.namespaceMembers}
Edit the namespaceMembers
list to add the project where you are restoring the
instance. For example, if you are restoring the instance to the cpd-instance
project, add that project to the list. If your instance is comprised of a central project and one or
more tethered projects, you must add all of those projects to the list. For example,
cpd-instance-tether1
, cpd-instance-tether2
.
cat <<EOF |oc apply -f -
apiVersion: operator.ibm.com/v1
kind: NamespaceScope
metadata:
name: nss-cpd-operators
namespace: ${PROJECT_CPD_OPS}
spec:
csvInjector: # This setting is required for some services. Do not delete this line if you specified it when you created operator subscriptions.
enable: true # This setting is required for some services. Do not delete this line if you specified it when you created operator subscriptions.
namespaceMembers:
- cpd-operators # (Default) Replace with the Cloud Pak for Data platform operator project name
- cpd-instance # Replace with the project where you are restoring Cloud Pak for Data
EOF
- Restore the ZenService custom resource and certificates:
cpd-cli oadp restore create <zenservice_restore_name> \
--from-backup=<backup_name> \
--include-resources='namespaces,zenservices,secrets,certificates.cert-manager.io,certificates.certmanager.k8s.io,issuers.cert-manager.io,issuers.certmanager.k8s.io' \
--skip-hooks \
--log-level=debug \
--verbose
- Restore the snapshot:
cpd-cli oadp restore create <restore_name> \
--from-backup=<backup_name> \
--exclude-resources='ImageTag,clients' \
--include-cluster-resources=true \
--log-level=debug \
--verbose
Note: If you are restoring Db2® or Watson™ Knowledge
Catalog, add --scale-wait-timeout
15m
to ensure that the restore command completes successfully.
- To check the status of a restore, run the following command:
cpd-cli oadp restore status <restore_name> \
--details
- To view a list of existing restores, run the following command:
- To view restore logs, run the following command:
cpd-cli oadp restore logs <restore_name>
- Optional: To delete a restore for cleanup purposes, run the following
command:
cpd-cli oadp restore delete <restore_name>