12.3.7. Debugging di un errore parziale della migrazione
È possibile eseguire il debugging di un messaggio di avviso di errore parziale della migrazione usando la CLI di Velero per esaminare i registri della risorsa personalizzata Restore.
Un errore parziale si verifica quando Velero incontra un problema che non causa l'esito negativo della migrazione. Per esempio, se manca la definizione di una risorsa personalizzata (CRD) o se è presente una discrepanza tra le versioni CRD sui cluster di origine e di destinazione, la migrazione viene completata ma la risorsa personalizzata non viene creata sul cluster di destinazione.
Velero registra il problema come un errore parziale e poi elabora il resto degli oggetti nella risorsa personalizzata Backup.
Procedura
Controllare lo stato di una risorsa personalizzata
MigMigration:$ oc get migmigration <migmigration> -o yamlEsempio di output
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: SucceededWithWarningsControllare lo stato della risorsa personalizzata
Restoreusando il comando Velerodescribe:$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -n openshift-migration -- ./velero restore describe <restore>Esempio di output
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 resourceControllare i registri della risorsa personalizzata
Restoreusando il comando Velerologs:$ oc exec $(oc get pods -n openshift-migration -o name | grep velero) -n openshift-migration -- ./velero restore logs <restore>Esempio di output
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-x4lbfIl messaggio di errore del registro della risorsa personalizzata
Restore,the server could not find the requested resource, indica la causa della migrazione parzialmente non riuscita.