oadp backup create

Create a snapshot of the entire Cloud Pak for Data instance (when installed on Container Storage Interface (CSI) volumes) or create a Restic backup of an entire Cloud Pak for Data instance on an S3-compatible object store.

Syntax

cpd-cli oadp backup create <cpd-snapshot-name> \
[--aux-service-image-prefix=<backup-hook-image-prefix>] \
[--cleanup-completed-resources=true|false] \
[--default-volumes-to-restic] \
[--exclude-resources=<resource.group1,resource.group2,...>] \
[--grant-image-puller-role=true|false] \
[--hook-kind=prehook|posthook|checkpoint] \
[--image-prefix=<image-registry-prefix>] \
[--include-cluster-resources=true|false] \
[--include-namespaces=<project-name1,project-name2,...>] \
[--include-resources=<resource-name1,resource-name2,...>] \
[--labels=<map<label,label,...>>] \
[--log-level=info|debug|warn|error|panic] \
[--posthooks=true|false] \
[--prehooks=true|false] \
[--scale-always] \
[--scale-wait-timeout=<h,m,s>] \
[--selector=String] \
[--skip-hooks] \
[--snapshot-volumes=true|false] \
[--storage-location=<backup-location>] \
[--ttl=<h,m,s>] \
[--use-retain-pv-reclaim-policy] \
[--values=<yaml-file-name1,yaml-file-name2,...>] \
[--vol-mnt-pod-cpu-limit=<cpu-limit-value>] \
[--vol-mnt-pod-cpu-request=<cpu-request-value>] \
[--vol-mnt-pod-mem-limit=<memory-limit-value>] \
[--vol-mnt-pod-mem-request=<memory-request-value>] \
[--vol-mnt-service-account=<service-request-value>] \
[--volume-snapshot-locations=<volume-snapshot-location1,volume-snapshot-location2,...>] \
[--verbose] \
[--wait-timeout=<h,m,s>] \
[--with-checkpoint]

Arguments

The backup create command has no arguments.

Options

Option Description
--aux-service-image-prefix Specify the backup hook job image prefix (if configurable).
Status
Optional.
Syntax
--aux-service-image-prefix=<backup-hook-image-prefix>
Default value
icr.io/cpopen/cpd
Valid values
  • icr.io/cpopen/cpd
  • ${PRIVATE_REGISTRY_LOCATION}
--cleanup-completed-resources When set to "true", deletes completed Kubernetes jobs and pods.
Status
Optional.
Syntax
--cleanup-completed-resources=true|false
Default value
false
Valid values
false
Does not delete completed Kubernetes jobs and pods.
true
Deletes completed Kubernetes jobs and pods.
--default-volumes-to-restic Backup all pod volumes using restic without applying annotation on the pod.
Status
Optional.
Syntax
--default-volumes-to-restic
Default value
No default.
Valid values
Not applicable.
--exclude-resources Resources to exclude from the restore, formatted as resource.group (for example, storageclasses.storage.k8s.io).
Status
Optional.
Syntax
--exclude-resources=<resource.group1,resource.group2,...>
Default value
No default.
Valid values
Valid resource.group pairings.
--grant-image-puller-role Grants Cloud Pak for Data instance namespaces permission to pull images from the OADP/Velero namespace. This option is used for air-gapped installations.
Status
Optional.
Syntax
--grant-image-puller-role=true|false
Default value
true
Valid values
true
Grants Cloud Pak for Data instance namespaces permission to pull images from the OADP/Velero namespace. This option is used for air-gapped installations.
false
Denies IBM Cloud Pak® for Data instance namespaces permission.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--hook-kind The backup hook type. By default, backup configmap pre-hook and post-hooks are called and are used for offline backups. When the value is "checkpoint", checkpoint backup pre-hook and post-hooks are called and are used for non-disruptive backups.
Status
Optional.
Syntax
--hook-kind=prehook|posthook|checkpoint
Default value
prehook|posthook
Valid values
prehook|posthook
The backup configmap precooks and pothooks are called (used for offline backups).
checkpoint
The checkpoint precooks and pothooks are called (used for non-disruptive backups).
--image-prefix Specify the image registry prefix.
Status
Optional.
Syntax
--image-prefix=icr.io/cpopen/cpd
Default value
icr.io/cpopen/cpd
Valid values
  • icr.io/cpopen/cpd
  • ${PRIVATE_REGISTRY_LOCATION}
--include-cluster-resources Include the cluster-scoped resources in the backup.
Status
Optional.
Syntax
--include-cluster-resources=true|false
Default value
true
Valid values
true
Include the cluster-scoped resources in the backup.
false
Do not include the cluster-scoped resources in the backup.
--include-namespaces Include the specified namespaces in the backup.
Status
Optional.
Syntax
--include-namespaces=<project-name1,project-name2,...>
Default value
${PROJECT_CPD_INSTANCE}
Valid values
Any valid project names. (Comma separated string array.)
--include-resources Include the specified resources in the backup.
Status
Optional.
Syntax
--include-resources=<resource-name1,resource-name2,...>
Default value
No default.
Valid values
Any valid resource names. (Comma separated string array. Use '*' for all resources.)
--labels Labels to apply to the backup.
Status
Optional.
Syntax
--labels=<map<label,label,...>>
Default value
No default.
Valid values
Valid label names. (Comma separated map string array list.)
--log-level The command log level.
Status
Optional.
Syntax
--log-level=info|debug|warn|error|panic
Default value
info
Valid values
debug
Debug messages are written to the log.
error
Error messages are written to the log.
info
Informative messages are written to the log.
panic
Panic messages are written to the log.
warn
Warning messages are written to the log.
--posthooks Run the default scale-up of K8's resources and configmap post-restore hooks.
Status
Optional.
Syntax
--posthooks=true|false
Default value
true
Valid values
true
Run the default scale-up of K8's resources and configmap post-restore hooks.
false
Do not run default scale down of K8's resources and configmap post-restore hooks.
--prehooks Run default scale down of K8's resources and configmap pre-backup hooks.
Status
Optional.
Syntax
--prehooks=true|false
Default value
true
Valid values
true
Run default scale down of K8's resources and configmap pre-backup hooks.
false
Do not run default scale down of K8's resources and configmap pre-backup hooks.
--scale-always Quiesce via scale down.
Status
Optional.
Syntax
--scale-always
Default value
No default.
Valid values
Not applicable.
--scale-wait-timeout The scale wait timeout duration ('h' for hours, 'm' for minutes, 's' for seconds).
Status
Optional.
Syntax
--scale-wait-timeout=<h,m,s>
Default value
6m0s
Valid values
Any valid duration string. Examples: 1m, 30m, 1h, 2h45m

--selector

-l

Only back up resources that match the label selector.
Status
Optional.
Syntax
--selector=String
Default value
No default.
Valid values
Not applicable.
--skip-hooks Skip the default scale down of resources and backup configmap hooks.
Status
Optional.
Syntax
--skip-hooks
Default value
No default.
Valid values
Not applicable.
--snapshot-volumes Take snapshots of Persistent Volumes as part of the backup. When set to false, the volume is backed-up using Restic. When set to true, a volume snapshot is created.
Status
Optional.
Syntax
--snapshot-volumes=true|false
Default value
false
Valid values
false
The volume is backed-up using Restic.
true
A volume snapshot is created.
--storage-location The backup location to use for the backup.
Status
Optional.
Syntax
--storage-location=<backup-location>
Default value
No default.
Valid values
A valid backup location.
--ttl Specify how long to keep the data ('h' for hours, 'm' for minutes, 's' for seconds).
Status
Optional.
Syntax
--ttl=<h,m,s>
Default value
8760h
Valid values
A time setting in the format <h,m,s>.
--use-retain-pv-reclaim-policy Change persistent volumes to use the retain reclaim policy for backups.
Status
Optional.
Syntax
--use-retain-pv-reclaim-policy
Default value
No default.
Valid values
Not applicable.

--values

-f

Specify values in one or more YAML files.
Status
Optional.
Syntax
--values=<yaml-file-name1,yaml-file-name2,...>
Default value
No default.
Valid values
One or more YAML file names.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.
--vol-mnt-pod-cpu-limit Set the CPU limit for the cpdbr-vol-mnt pod.
Status
Optional.
Syntax
--vol-mnt-pod-cpu-limit=<cpu-limit-value>
Default value
500m
Valid values
A CPU limit value.
--vol-mnt-pod-cpu-request Set the CPU request for the cpdbr-vol-mnt pod.
Status
Optional.
Syntax
--vol-mnt-pod-cpu-request=<cpu-request-value>
Default value
100m
Valid values
Plain integer or fixed-point number that uses one the following quantity suffixes: E, P, T, G, M, k. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.

Examples: 0, 100m, 256Mi, 1Gi

--vol-mnt-pod-mem-limit Set the memory limit for the cpdbr-vol-mnt pod.
Status
Optional.
Syntax
--vol-mnt-pod-mem-limit=<memory-limit-value>
Default value
512Mi
Valid values
Plain integer or fixed-point number that uses one the following quantity suffixes: E, P, T, G, M, k. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.

Examples: 0, 100m, 256Mi, 1Gi

--vol-mnt-pod-mem-request Set the memory request for the cpdbr-vol-mnt pod.
Status
Optional.
Syntax
--vol-mnt-pod-mem-request=<memory-request-value>
Default value
256Mi
Valid values
Plain integer or fixed-point number that uses one the following quantity suffixes: E, P, T, G, M, k. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.

Examples: 0, 100m, 256Mi, 1Gi

--vol-mnt-service-account The service account for the cpdbr-vol-mnt pod.
Status
Optional.
Syntax
--vol-mnt-service-account=<service-request-value>
Default value
default
Valid values
Valid cpdbr-vol-mnt service account.
--volume-snapshot-locations List of locations (at most one per provider) where volume snapshots are stored.
Status
Optional.
Syntax
--volume-snapshot-locations=<volume-snapshot-location1,volume-snapshot-location2,...>
Default value
No default.
Valid values
Valid volume snapshot locations.
--wait-timeout The wait timeout setting ('h' for hours, 'm' for minutes, 's' for seconds).
Status
Optional.
Syntax
--wait-timeout=<h,m,s>
Default value
6m0s
Valid values
Any valid duration string. Examples: 1m, 30m, 1h, 2h45m
--with-checkpoint Run a checkpoint before backup.
Status
Optional.
Syntax
--with-checkpoint
Default value
No default.
Valid values
Not applicable.

Examples

Note: The following examples use the recommended installation environment variables.

Use a script to create environment variables with the correct values for your environment. For more information, see Best practice: Setting up install variables.

Create a snapshot with Restic for the entire IBM Cloud Pak for Data instance (<cpd-snapshot-name>) in an air-gapped environment.
cpd-cli oadp backup create <cpd-snapshot-name>\
--cleanup-completed-resources \
--default-volumes-to-restic] \
--exclude-resources='Event,Event.events.k8s.io'\
--image-prefix=icr.io/cpopen/cpd \
--include-namespaces=<project-name>\
--log-level=debug \
--snapshot-volumes=false \
--verbose