oadp
restore create
Restore a snapshot of the entire IBM Software Hub instance (when installed on Container Storage Interface (CSI) volumes) or restore a restic backup of an entire IBM Software Hub instance on an S3-compatible object store.
Syntax
cpd-cli oadp restore create <cpd-snapshot-restore-name> \
--from-backup=<backup-file-name> \
[--aux-service-image-prefix=<backup-hook-image-prefix>] \
[--cacert=<certificate-bundle-path>] \
[--exclude-namespaces=<namespace1,namespace2,...>] \
[--exclude-resources=<resource.group1,resource.group2,...>] \
[--grant-image-puller-role=true|false] \
[--image-prefix=<image-registry-prefix>] \
[--include-cluster-resources=true|false] \
[--include-namespaces=<project-name1,project-name2,...>] \
[--include-resources=<resource-name1,resource-name2,...>] \
[--insecure-skip-tls-verify=true|false] \
[--labels=<map<label,label,...>>] \
[--posthooks=--posthooks] \
[--preserve-nodeports=true|false] \
[--preworkloadhooks=true|false] \
[--pvc-bound-wait-timeout=<h,m,s>] \
[--restore-volumes=true|false] \
[--scale-always] \
[--scale-wait-timeout=<h,m,s>] \
[--selector=<label-selector>] \
[--skip-hooks] \
[--unclaim-volumes=true|false] \
[--values=<yaml-file-name1,yaml-file-name2,...>] \
# Global options
[--add_dir_header=true|false] \
[--alsologtostderr=true|false] \
[--cpd-namespace=<cpd-namespace>] \
[--kubeconfig=<kubeconfig-paths> \
[--log-level=info|debug|warn|error|panic|trace] \
[--log-backtrace-at traceLocation=<integer>] \
[--log-dir=<log_directory>] \
[--log-file=<log_file_name>] \
[--log_file_max_size=<uint>] \
[--logtostderr=true|false] \
[--namespace=<namespace-name>] \
[--one-output=true|false] \
[--skip-headers=true|false] \
[--skip-log-headers=true|false] \
[--stderrthreshold severity=<integer>] \
[--v=<integer>] \
[--verbose \
[--vmodule moduleSpec=<pattern1, pattern2, and so on>]
Arguments
Table 1: Command arguments
| Argument | Description |
|---|---|
<cpd-snapshot-restore-name> |
The name of the restore snapshot to create. |
Table 2: Global options arguments
| Argument | Description |
|---|---|
<trace-location> |
The stack trace location |
<severity> |
The log severity level |
Options
Table 1: Command options
| Option | Description |
|---|---|
--aux-service-image-prefix |
Specify the backup hook job image
prefix (if configurable).
|
--cacert |
The certificate bundle path to use
when verifying TLS connections.
|
--exclude-namespaces |
Namespaces to exclude from the
restore.
|
--exclude-resources |
Resources to exclude from
the restore, formatted as resource.group (for example,
storageclasses.storage.k8s.io).
|
|
|
The backup name from which to
restore.
|
--grant-image-puller-role |
Grants IBM Software Hub instance
namespaces permission to pull images from the OADP/Velero namespace. This option is used for
air-gapped installations.
|
|
|
Display command
help.
|
--image-prefix |
Specify the image registry
prefix.
|
--include-cluster-resources |
Include the cluster-scoped
resources in the backup.
|
--include-namespaces |
Include the specified
namespaces in the restore.
|
--include-resources |
Resources to include in the
backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '\*' for all
resources).
|
--insecure-skip-tls-verify |
When set to 'true', the object
store's TLS certificate are not checked for validity (not recommended for
production).
|
--labels |
Labels to apply to the
backup.
|
--posthooks |
Run the default scale-up of K8's
resources and configmap post-restore hooks.
|
--preserve-nodeports |
Preserve or don't preserve
services node ports when restoring.
|
--preworkloadhooks |
Run the ConfigMap pre-workload
restore hooks.
|
--pvc-bound-wait-timeout |
The PVC bound wait timeout
duration ('h' for hours, 'm' for minutes, 's' for seconds)
|
--restore-volumes |
Restore volumes from
snapshots.
|
--scale-always |
Unquiesce via scale
down.
|
--scale-wait-timeout |
The scale wait timeout duration
('h' for hours, 'm' for minutes, 's' for seconds).
|
|
|
Only restore resources
that match the label selector.
|
--skip-hooks |
Skip the default scale down of
resources and backup configmap hooks.
|
--unclaim-volumes |
Allow released,
statically-provisioned persistent volumes to be reclaimed.
|
--values |
Specify values in one or more YAML
files.
|
Global options
You can also use the following global options with this command:
Table 2: Command global options
| Option | Description |
|---|---|
--add_dir_header |
Add the file directory to the
header of log messages.
|
--alsologtostderr |
Log to standard error as well as
files.
Note: This option has no effect when
--logtostderr=true. |
--cpd-namespace |
The IBM Software Hub namespace in
which the utility operates.
|
--kubeconfig |
Paths to a kubeconfig. Only
required if out-of-cluster.
|
--log-level |
The command log
level.
|
--log-backtrace-at traceLocation |
When logging hits line file:N,
emit a stack trace.
|
--log-dir |
If non-empty, write log files in
this directory.
|
--log-file |
If non-empty, use this log
file.
|
--log_file_max_size |
The maximum size, in MB, that a
log file can grow to. If you specify 0, the maximum file size is
unlimited.
|
--logtostderr |
Log to standard error instead of
files.
|
--namespace
|
The namespace where OADP is
installed.
|
--one-output |
Specifies whether to only write
logs to their native severity level.
|
--skip-headers |
Specifies whether to avoid header
prefixes in log messages.
|
--skip-log-headers |
Specifies whether to avoid header
prefixes when opening log files.
Note: This option has no effect when
--logtostderr=true. |
--stderrthreshold severity |
Logs at or above the specified
threshold. Go to stderr when writing to files and stderr.
|
--v
|
Number for the log level
verbosity.
|
--verbose |
Logs include more detailed
messages.
|
--vmodule moduleSpec |
Comma-separated list of pattern=N
settings for file-filtered logging.
|
Examples
Note: The following examples use the recommended installation environment variables.
It is strongly recommended that you use a script to create environment variables with the correct values for your environment. For more information, see Setting up installation environment variables.
- Restore the
<cpd-snapshot-restore-name>custom resource and certificates. -
cpd-cli oadp restore create <cpd-snapshot-restore-name> \ --from-backup=<backup-file-name> \ --exclude-resources='ImageTag,clients' \ --include-cluster-resources=true \ --log-level=debug \ --verbose - Specify the private registry image prefix with the Red Hat® OpenShift® APIs for the Data Protection (OADP) project in an air-gapped environment.
-
cpd-cli oadp restore create <cpd-snapshot-restore-name> \ --from-backup=<backup-file-name> \ --exclude-resources='ImageTag,clients' \ --include-cluster-resources=true \ --image-prefix=registry.redhat.io/ubi9 \ --log-level=debug \ --verbose