12.3.7. Debuggen einer teilweisen fehlgeschlagenen Migration
Sie können eine Warnmeldung über eine teilweise fehlgeschlagene Migration debuggen, indem Sie die Velero-CLI verwenden, um die Protokolle der Custom Resource (CR) restore zu untersuchen.
Ein Teilfehler tritt auf, wenn bei Velero ein Problem auftritt, das nicht zum Scheitern einer Migration führt. Wenn beispielsweise eine Custom Resource Definition (CRD) fehlt oder eine Diskrepanz zwischen den CRD-Versionen auf dem Quell- und dem Ziel-Cluster besteht, wird die Migration zwar abgeschlossen, aber die CR wird nicht auf dem Ziel-Cluster erstellt.
Velero protokolliert das Problem als Teilfehler und verarbeitet dann die restlichen Objekte in der CR Backup.
Vorgehensweise
Prüfen Sie den Status einer
MigMigration-CR:$ oc get migmigration <migmigration> -o yamlBeispielausgabe
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Überprüfen Sie den Status der CR
Restoremit dem Velero-Befehldescribe:$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -n openshift-migration -- ./velero restore describe <restore>Beispielausgabe
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Überprüfen Sie die Protokolle der CR
Restoremit dem Velero-Befehllogs:$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -n openshift-migration -- ./velero restore logs <restore>Beispielausgabe
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-x4lbfDie Protokoll-Fehlermeldung der CR
Restore,the server could not find the requested resource, gibt die Ursache für die teilweise fehlgeschlagene Migration an.