11.3.7. 调试部分迁移失败


您可以使用 Velero CLI 检查 Restore 自定义资源(CR)日志来调试部分迁移失败警告消息。

当 Velero 遇到没有导致迁移失败的问题时,会导致迁移部分失败。例如,缺少自定义资源定义(CRD),或者源集群和目标集群的 CRD 版本之间存在冲突,则迁移会完成,但不会在目标集群上创建 CR。

Velero 将问题作为部分失败记录,然后处理 备份 CR 中的其他对象。

流程

  1. 检查 MigMigration CR 的状态:

    $ oc get migmigration <migmigration> -o yaml
    Copy to Clipboard Toggle word wrap

    输出示例

    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
    Copy to Clipboard Toggle word wrap

  2. 使用 Velero describe 命令检查 Restore CR 的状态:

    $ oc -n {namespace} exec deployment/velero -c velero -- ./velero \
      restore describe <restore>
    Copy to Clipboard Toggle word wrap

    输出示例

    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
    Copy to Clipboard Toggle word wrap

  3. 使用 Velero logs 命令检查 Restore CR 日志:

    $ oc -n {namespace} exec deployment/velero -c velero -- ./velero \
      restore logs <restore>
    Copy to Clipboard Toggle word wrap

    输出示例

    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
    Copy to Clipboard Toggle word wrap

    Restore CR 会记录日志错误消息, the server could not find the requested resource,代表迁移部分失败的原因。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat