9.2.3. 使用命令行界面访问日志和自定义资源信息
您可以使用 must-gather 工具从命令行界面访问自定义资源(CR)的日志和信息。您必须将 must-gather 数据文件附加到所有客户问题单。
您可以使用过滤选项收集特定命名空间、完成、失败或取消迁移的虚拟机(VM)的数据。
注意
如果您在过滤的 must-gather 命令中指定不存在的资源,则不会创建存档文件。
先决条件
-
您必须以具有
cluster-admin角色的用户身份登录到 OpenShift Virtualization 集群。 -
已安装 OpenShift Container Platform CLI(
oc)。
流程
-
进入要存储
must-gather数据的目录。 运行
oc adm must-gather命令:oc adm must-gather --image=registry.redhat.io/migration-toolkit-virtualization/mtv-must-gather-rhel8:2.2.0
$ oc adm must-gather --image=registry.redhat.io/migration-toolkit-virtualization/mtv-must-gather-rhel8:2.2.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow 数据被保存为
/must-gather/must-gather.tar.gz。您可以将此文件上传到红帽客户门户网站中的支持问题单中。可选:使用以下选项运行
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 \ -- NS=<namespace> /usr/bin/targetedCopy to Clipboard Copied! Toggle word wrap Toggle overflow 迁移计划:
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 \ -- PLAN=<migration_plan> /usr/bin/targetedCopy to Clipboard Copied! Toggle word wrap Toggle overflow 虚拟机:
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
$ 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/targeted1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 您必须指定 虚拟机名称,而不是虚拟机 ID,因为它出现在
PlanCR 中。