CSI 驱动程序:如何收集日志

Summary: 本文介绍如何收集基本日志以开始对戴尔容器存储模块 (CSM) 系列的问题进行故障处理:Dell Container Storage Interface (CSI) 驱动程序

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

CSI 驱动程序日志收集
这包括启用调试、重现问题(如果可能)、收集 CSI 驱动程序控制器的日志、从节点 Pod 收集日志。

提醒:kubectl 在 OpenShift 环境中,命令可以替换为“oc”。

为 CSI 驱动程序控制器和节点 Pod 启用调试日志。
请参阅文档中的“动态日志记录配置”功能:https://dell.github.io/csm-docs/docs/csidriver

提醒:由于启用调试日志不具有追溯性,因此在收集日志之前,如果可能,请重现该问题。

确定控制器和节点 Pod 的名称。
使用 kubectl get pods 用于列出驱动程序命名空间中的 Pod 的命令。

# kubectl get pods -n isilon
NAME                                READY   STATUS    RESTARTS        AGE
isilon-controller-66d7d9d7c-6j6f4   6/6     Running   0               11m
isilon-node-9wngk                   2/2     Running   0               27d
提醒:控制器部署设置为“replicas:1”。这不是受支持的生产配置,但可用于测试目的。受支持的环境显示两个或更多控制器。

收集 CSI 驱动程序控制器日志。
应收集控制器 Pod 的日志。使用 从所有控制器收集日志 kubectl logs 命令确认该锁定已释放。确保传入相关的容器,例如驱动程序。

kubectl logs -n <namespace> <controller> <container> > <file name>

示例:

kubectl logs -n isilon isilon-controller-66d7d9d7c-6j6f4 driver > isilon-controller-66d7d9d7c-6j6f4_driver.log

对与您的问题相关的所有必需容器(附加器、快照器、预配器、驱动程序、调整器等)重复上述步骤。确保更改输出文件的文件名,以匹配控制器名称和容器。

收集 CSI 驱动程序节点 Pod 日志。
此外,还应收集工作机节点的日志。这可能包括一个节点,或者如果问题 Pod 从一个节点移动到另一个节点,则可能包括多个节点。这将收集 CSI 驱动程序节点 pod(驱动程序、注册器等)上每个容器的日志:

kubectl logs -n <namespace> <worker node> > <filename>.txt

示例:

kubectl logs -n isilon isilon-node-9wngk driver > isilon-node-9wngk_driver.txt
kubectl logs -n isilon isilon-node-9wngk registrar > isilon-node-9wngk_registrar.txt

选择
脚本

这将单独生成所有控制器日志(如果需要,请更改“isilon”命名空间 2 位置),并根据需要添加容器。

for x in $(kubectl get pods -n isilon | grep controller | awk '{print $1}'); do for i in attacher provisioner driver snapshotter;do kubectl logs -n isilon $x -c $i > $x-$i.txt;done;done

这将收集节点日志(如果需要,请在两个位置更改“isilon”命名空间)并根据需要添加容器。

for x in $(kubectl get pods -n isilon | grep node | awk '{print $1}'); do for i in driver registrar;do kubectl logs -n isilon $x -c $i > $x-$i.txt;done;done

由于选项
收集所有日志可能会产生比所需更多的数据。“--since“选项可用于收集已知时间量。此选项后跟“5 秒”、“5 米”或“5 小时”,表示秒、分钟、小时,具体取决于日志收集应返回多长时间。如果问题重现,收集过去 5 分钟的日志(或重现所花的时间),这也很有帮助:

示例:

kubectl logs -n isilon isilon-node-xxx driver --since 5m > isilon-node-xxx_driver.txt

全容器
如上所述,单独收集日志有助于故障排除。有时,将容器名称替换为”--all-containers收集所有 Pod 容器的日志可能很有用。

提醒:这可能会使故障处理变得更加困难,因为这会将所有日志放在同一个文件中。

示例:

kubectl logs -n isilon isilon-node-xxx --all-containers> isilon-node_driver.txt

其他所需信息:
容器编排器(K8s、OpenShift 等)和版本
Kubernetes 版本和风格
驱动程序版本
阵列版本或微码
K8 节点作系统和版本

 

Additional Information

对于以前的版本,通过编辑部署/守护程序集来启用调试。

要列出部署,请执行以下操作:
# kubectl get deployment -A
NAMESPACE NAME READY UP-UP-DATE AVAILABLE AGE
csi-powerscale isilon-controller 1/1 1 1 14d
powermax powermax-controller 1/1 1 1 26d
unity-controller 1/1 1 1 47d
vxflexos vxflexos-controller 2/2 2 2 107d
编辑部署:
kubectl edit deployment -n
示例:
# kubectl edit deployment -n csi-powerscale isilon-controller
这将打开 vi 编辑器。将X_CSI_DEBUG参数更改为“true”(i 表示插入)并保存 (:wq):
        -名字:
X_CSI_DEBUG值:“true”
对于 Isilon,还应通过设置为 0(true) 在调试中记录 OneFS REST API 的内容:
        -名字:
X_CSI_VERBOSE值:“0”

通过编辑守护程序集启用 CSI 驱动程序节点调试日志。
通过编辑守护程序集来启用调试。

要列出守护程序,请执行以下操作:
# kubectl get daemonset -A
NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
csi-powerscale isilon-node 2 2 2 2 2 14d
powermax powermax-node 2 2 2 2 2 26d
unity unity 节点 2 2 2 2 2 2 47d
vxflexos vxflexos-node 2 2 2 2 2 107d
编辑守护程序集:
# kubectl edit daemonset -n csi-powerscale isilon-node
这将打开 vi 编辑器。将 X_CSI_DEBUG 参数更改为“true”并保存。
-名字:
X_CSI_DEBUG值:“true”

对于 Isilon,还应通过设置为 0(true) 在调试中记录 OneFS REST API 的内容:
-名字:
X_CSI_VERBOSE值:“0”


由于调试日志不是回溯的,因此在收集日志之前,如果可能,请重现问题。
Article Properties
Article Number: 000188057
Article Type: How To
Last Modified: 12 Nov 2025
Version:  9
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.