Velero CLI tool
You can obtain the velero CLI tool by using the following options:
-
Downloading the
veleroCLI tool -
Accessing the
velerobinary in the Velero deployment in the cluster
Downloading the Velero CLI tool
You can download and install the Velero CLI tool by following the instructions on the Velero documentation page. The page includes instructions for the following options:
-
macOS by using Homebrew
-
GitHub
-
Windows by using Chocolatey
-
You have access to a Kubernetes cluster, v1.16 or later, with DNS and container networking enabled.
-
You have installed
kubectllocally.
-
Open a browser and navigate to "Install the CLI" on the Velero website.
-
Follow the appropriate procedure for macOS, GitHub, or Windows.
-
Download the Velero version appropriate for your version of OADP and OpenShift Container Platform.
OADP-Velero-OpenShift Container Platform version relationship
Review the version relationship between OADP, Velero, and OpenShift Container Platform to decide compatible version combinations. This helps you select the appropriate OADP version for your cluster environment.
Accessing the Velero binary in the Velero deployment in the cluster
You can use a shell command to access the Velero binary in the Velero deployment in the cluster.
-
Your
DataProtectionApplicationcustom resource has a status ofReconcile complete.
-
Set the needed alias by using the following command:
$ alias velero='oc -n openshift-adp exec deployment/velero -c velero -it -- ./velero'
Debugging Velero resources with the OpenShift CLI tool
You can debug a failed backup or restore by checking Velero custom resources (CRs) and the Velero pod log with the OpenShift CLI tool.
-
Retrieve a summary of warnings and errors associated with a
BackuporRestoreCR by using the followingoc describecommand:$ oc describe <velero_cr> <cr_name> -
Retrieve the
Veleropod logs by using the followingoc logscommand:$ oc logs pod/<velero> -
Specify the Velero log level in the
DataProtectionApplicationresource as shown in the following example.Note
This option is available starting from OADP 1.0.3.
Example Velero log level fileapiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication metadata: name: velero-sample spec: configuration: velero: logLevel: warningThe following
logLevelvalues are available: -
trace -
debug -
info -
warning -
error -
fatal -
panicUse the
infologLevelvalue for most logs.
Debugging Velero resources with the Velero CLI tool
You can debug Backup and Restore custom resources (CRs) and retrieve logs with the Velero CLI tool. The Velero CLI tool provides more detailed information than the OpenShift CLI tool.
-
Use the
oc execcommand to run a Velero CLI command:$ oc -n openshift-adp exec deployment/velero -c velero -- ./velero \ <backup_restore_cr> <command> <cr_name>Exampleoc execcommand$ oc -n openshift-adp exec deployment/velero -c velero -- ./velero \ backup describe 0e44ae00-5dc3-11eb-9ca8-df7e5254778b-2d8ql -
List all Velero CLI commands by using the following
velero --helpoption:$ oc -n openshift-adp exec deployment/velero -c velero -- ./velero \ --help -
Retrieve the logs of a
BackuporRestoreCR by using the followingvelero logscommand:$ oc -n openshift-adp exec deployment/velero -c velero -- ./velero \ <backup_restore_cr> logs <cr_name>Examplevelero logscommand$ oc -n openshift-adp exec deployment/velero -c velero -- ./velero \ restore logs ccc7c2d0-6017-11eb-afab-85d0007f5a19-x4lbf -
Retrieve a summary of warnings and errors associated with a
BackuporRestoreCR by using the followingvelero describecommand:$ oc -n openshift-adp exec deployment/velero -c velero -- ./velero \ <backup_restore_cr> describe <cr_name>Examplevelero describecommand$ oc -n openshift-adp exec deployment/velero -c velero -- ./velero \ backup describe 0e44ae00-5dc3-11eb-9ca8-df7e5254778b-2d8qlThe following types of restore errors and warnings are shown in the output of a
velero describerequest: -
Velero: A list of messages related to the operation of Velero itself, for example, messages related to connecting to the cloud, reading a backup file, and so on -
Cluster: A list of messages related to backing up or restoring cluster-scoped resources -
Namespaces: A list of list of messages related to backing up or restoring resources stored in namespacesOne or more errors in one of these categories results in a
Restoreoperation receiving the status ofPartiallyFailedand notCompleted. Warnings do not lead to a change in the completion status.Consider the following points for these restore errors:
-
For resource-specific errors, that is,
ClusterandNamespaceserrors, therestore describe --detailsoutput includes a resource list that includes all resources that Velero restored. For any resource that has such an error, check if the resource is actually in the cluster. -
If there are
Veleroerrors but no resource-specific errors in the output of adescribecommand, it is possible that the restore completed without any actual problems in restoring workloads. In this case, carefully validate post-restore applications.For example, if the output contains
PodVolumeRestoreor node agent-related errors, check the status ofPodVolumeRestoresandDataDownloads. If none of these are failed or still running, then volume data might have been fully restored.