-
Notifications
You must be signed in to change notification settings - Fork 1.8k
mig527: Velero debug tool #29638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
mig527: Velero debug tool #29638
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Module included in the following assemblies: | ||
// * migration/migrating_3_4/troubleshooting-3-4.adoc | ||
// * migration/migrating_4_1_4/troubleshooting-4-1-4.adoc | ||
// * migration/migrating_4_2_4/troubleshooting-4-2-4.adoc | ||
|
||
[id="migration-debugging-velero-resources_{context}"] | ||
= Using the Velero CLI to debug Backup and Restore CRs | ||
|
||
You can debug the `Backup` and `Restore` custom resources (CRs) and partial migration failures with the Velero command line interface (CLI). The Velero CLI runs in the `velero` pod. | ||
|
||
[id="velero-command-syntax_{context}"] | ||
== Velero command syntax | ||
|
||
Velero CLI commands use the following syntax: | ||
[source,terminal] | ||
---- | ||
$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -- ./velero <resource> <command> <resource_id> | ||
---- | ||
|
||
You can specify `velero-<pod> -n openshift-migration` in place of `$(oc get pods -n openshift-migration -o name | grep velero)`. | ||
|
||
[id="help-command_{context}"] | ||
== Help command | ||
|
||
The Velero `help` command lists all the Velero CLI commands: | ||
[source,terminal] | ||
---- | ||
$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -- ./velero --help | ||
---- | ||
|
||
[id="describe-command_{context}"] | ||
== Describe command | ||
|
||
The Velero `describe` command provides a summary of warnings and errors associated with a Velero resource: | ||
[source,terminal] | ||
---- | ||
$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -- ./velero <resource> describe <resource_id> | ||
---- | ||
|
||
.Example | ||
[source,terminal] | ||
---- | ||
$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -- ./velero backup describe 0e44ae00-5dc3-11eb-9ca8-df7e5254778b-2d8ql | ||
---- | ||
|
||
[id="logs-command_{context}"] | ||
== Logs command | ||
|
||
The Velero `logs` command provides the logs associated with a Velero resource: | ||
[source,terminal] | ||
---- | ||
velero <resource> logs <resource_id> | ||
---- | ||
|
||
.Example | ||
[source,terminal] | ||
---- | ||
$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -- ./velero restore logs ccc7c2d0-6017-11eb-afab-85d0007f5a19-x4lbf | ||
---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// Module included in the following assemblies: | ||
// * migration/migrating_3_4/troubleshooting-3-4.adoc | ||
// * migration/migrating_4_1_4/troubleshooting-4-1-4.adoc | ||
// * migration/migrating_4_2_4/troubleshooting-4-2-4.adoc | ||
|
||
[id="migration-partial-failure-velero_{context}"] | ||
= Debugging a partial migration failure | ||
|
||
You can debug a partial migration failure warning message by using the Velero CLI to examine the `Restore` custom resource (CR) logs. | ||
|
||
A partial failure occurs when Velero encounters an issue that does not cause a migration to fail. For example, if a custom resource definition (CRD) is missing or if there is a discrepancy between CRD versions on the source and target clusters, the migration completes but the CR is not created on the target cluster. | ||
|
||
Velero logs the issue as a partial failure and then processes the rest of the objects in the `Backup` CR. | ||
|
||
.Procedure | ||
|
||
. Check the status of a `MigMigration` CR: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc get migmigration <migmigration> -o yaml | ||
---- | ||
+ | ||
.Example output | ||
+ | ||
[source,yaml] | ||
---- | ||
status: | ||
conditions: | ||
- category: Warn | ||
durable: true | ||
lastTransitionTime: "2021-01-26T20:48:40Z" | ||
message: 'Final Restore openshift-migration/ccc7c2d0-6017-11eb-afab-85d0007f5a19-x4lbf: partially failed on destination cluster' | ||
status: "True" | ||
type: VeleroFinalRestorePartiallyFailed | ||
- category: Advisory | ||
durable: true | ||
lastTransitionTime: "2021-01-26T20:48:42Z" | ||
message: The migration has completed with warnings, please look at `Warn` conditions. | ||
reason: Completed | ||
status: "True" | ||
type: SucceededWithWarnings | ||
---- | ||
|
||
. Check the status of the `Restore` CR by using the Velero `describe` command: | ||
+ | ||
[source,yaml] | ||
---- | ||
$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -n openshift-migration -- ./velero restore describe <restore> | ||
---- | ||
+ | ||
.Example output | ||
+ | ||
[source,yaml] | ||
---- | ||
Phase: PartiallyFailed (run 'velero restore logs ccc7c2d0-6017-11eb-afab-85d0007f5a19-x4lbf' for more information) | ||
|
||
Errors: | ||
Velero: <none> | ||
Cluster: <none> | ||
Namespaces: | ||
migration-example: error restoring example.com/migration-example/migration-example: the server could not find the requested resource | ||
---- | ||
|
||
. Check the `Restore` CR logs by using the Velero `logs` command: | ||
+ | ||
[source,yaml] | ||
---- | ||
$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -n openshift-migration -- ./velero restore logs <restore> | ||
---- | ||
+ | ||
.Example output | ||
+ | ||
[source,yaml] | ||
---- | ||
time="2021-01-26T20:48:37Z" level=info msg="Attempting to restore migration-example: migration-example" logSource="pkg/restore/restore.go:1107" restore=openshift-migration/ccc7c2d0-6017-11eb-afab-85d0007f5a19-x4lbf | ||
time="2021-01-26T20:48:37Z" level=info msg="error restoring migration-example: the server could not find the requested resource" logSource="pkg/restore/restore.go:1170" restore=openshift-migration/ccc7c2d0-6017-11eb-afab-85d0007f5a19-x4lbf | ||
---- | ||
+ | ||
The `Restore` CR log error message, `the server could not find the requested resource`, indicates the cause of the partially failed migration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.