9.2.3. 使用命令行界面访问日志和自定义资源信息

您可以使用 must-gather 工具从命令行界面访问自定义资源(CR)的日志和信息。您必须将 must-gather 数据文件附加到所有客户问题单。

您可以使用过滤选项收集特定命名空间、完成、失败或取消迁移的虚拟机(VM)的数据。

注意

如果您在过滤的 must-gather 命令中指定不存在的资源,则不会创建存档文件。

先决条件

流程

  1. 进入要存储 must-gather 数据的目录。
  2. 运行 oc adm must-gather 命令:

    $ oc adm must-gather --image=registry.redhat.io/migration-toolkit-virtualization/mtv-must-gather-rhel8:2.2.0

    数据被保存为 /must-gather/must-gather.tar.gz。您可以将此文件上传到红帽客户门户网站中的支持问题单中。

  3. 可选:使用以下选项运行 oc adm must-gather 命令来收集过滤的数据:

    • Namespace:

      $ oc adm must-gather --image=registry.redhat.io/migration-toolkit-virtualization/mtv-must-gather-rhel8:2.2.0 \
        -- NS=<namespace> /usr/bin/targeted
    • 迁移计划:

      $ oc adm must-gather --image=registry.redhat.io/migration-toolkit-virtualization/mtv-must-gather-rhel8:2.2.0 \
        -- PLAN=<migration_plan> /usr/bin/targeted
    • 虚拟机:

      $ oc adm must-gather --image=registry.redhat.io/migration-toolkit-virtualization/mtv-must-gather-rhel8:2.2.0 \
        -- VM=<vm_name> NS=<namespace> /usr/bin/targeted 1
      1
      您必须指定 虚拟机名称,而不是虚拟机 ID,因为它出现在 Plan CR 中。