This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Collecting Information

1 - Obtaining the CSI Version

This section describes how to view the CSI version.

Procedure

  1. Use a remote access tool, such as PuTTY, to log in to any master node in the Kubernetes cluster through the management IP address.

  2. Run the following command to query information about the node where huawei-csi-node resides.

    kubectl get pod -A  -owide | grep huawei-csi-node
    

    The following is an example of the command output.

    NAMESPACE     NAME                                       READY   STATUS    RESTARTS        AGE     IP               NODE            NOMINATED NODE   READINESS GATES
    huawei-csi    huawei-csi-node-87mss                      3/3     Running   0               6m41s   192.168.129.155      node-1          <none>           <none>
    huawei-csi    huawei-csi-node-xp8cc                      3/3     Running   0               6m41s   192.168.129.156      node-2          <none>           <none
    
  3. Use a remote access tool, such as PuTTY, to log in to any node where huawei-csi-node resides through the node IP address.

  4. Run the following command to view the CSI version.

    cat /var/lib/kubelet/plugins/csi.huawei.com/version
    

    The version information is displayed as follows:

    4.5.0
    

2 - Viewing Huawei CSI Logs

Viewing Logs of the huawei-csi-controller Service

  1. Run the following command to obtain the node where huawei-csi-controller is located.

    kubectl get pod -A -o wide | grep huawei
    

    The following is an example of the command output, where IP indicates the node IP address and NODE indicates the node name.

    NAME                                    READY   STATUS    RESTARTS   AGE     IP             NODE         NOMINATED NODE   READINESS GATES
    huawei-csi-controller-695b84b4d8-tg64l  9/9     Running  0          14s     <host1-ip>     <host1-name> <none>           <none>
    
  2. Use a remote access tool, such as PuTTY, to log in to the node where the huawei-csi-controller service resides in the Kubernetes cluster through the management IP address.

  3. Go to the log directory.

    cd /var/log/huawei
    
  4. Run the following command to view the customized output logs of the container.

    vi huawei-csi-controller
    
  5. Go to the container directory.

    cd /var/log/containers
    
  6. Run the following command to view the standard output logs of the container.

    vi huawei-csi-controller-<name>_huawei-csi_huawei-csi-driver-<contrainer-id>.log
    

Viewing Logs of the huawei-csi-node Service

  1. Run the following command to obtain the node where huawei-csi-node is located.

    kubectl get pod -A -o wide | grep huawei
    

    The following is an example of the command output, where IP indicates the node IP address and NODE indicates the node name.

    NAME                     READY   STATUS    RESTARTS   AGE     IP             NODE         NOMINATED NODE   READINESS GATES
    huawei-csi-node-g6f7z    3/3     Running  0          14s     <host2-ip>     <host2-name> <none>           <none>
    
  2. Use a remote access tool, such as PuTTY, to log in to the node where the huawei-csi-node service resides in the Kubernetes cluster through the management IP address.

  3. Go to the log directory.

    cd /var/log/huawei
    
  4. Run the following command to view the customized output logs of the container.

    vi huawei-csi-node
    
  5. Go to the container directory.

    cd /var/log/containers
    
  6. Run the following command to view the standard output logs of the container.

    vi huawei-csi-node-<name>_huawei-csi_huawei-csi-driver-<contrainer-id>.log
    

3 - Collecting Logs

Performing Check Before Collection

  1. Use a remote access tool, such as PuTTY, to log in to the node where the oceanctl tool is installed in the Kubernetes cluster through the management IP address.

  2. Run the following command. The displayed version is v4.5.0.

    oceanctl version
    

    The following is an example of the command output.

    Oceanctl Version: v4.5.0
    
  3. Run the oceanctl collect logs –help command. The following information is displayed.

    $ oceanctl collect logs --help
    Collect logs of one or more nodes in specified namespace in Kubernetes
    
    Usage:
      oceanctl collect logs [flags]
    
    Examples:
      # Collect logs of all nodes in specified namespace
      oceanctl collect logs -n <namespace>
    
      # Collect logs of specified node in specified namespace
      oceanctl collect logs -n <namespace> -N <node>
    
      # Collect logs of all nodes in specified namespace
      oceanctl collect logs -n <namespace> -a
    
      # Collect logs of all nodes in specified namespace with a maximum of 50 nodes collected at the same time
      oceanctl collect logs -n <namespace> -a --threads-max=50
    
      # Collect logs of specified node in specified namespace
      oceanctl collect logs -n <namespace> -N <node> -a
    
    Flags:
      -a, --all                Collect all nodes messages
      -h, --help               help for logs
      -n, --namespace string   namespace of resources
      -N, --nodename string    Specify the node for which information is to be collected.
          --threads-max int    set maximum number[1~1000] of threads for nodes to be collected. (default 50)
    
    Global Flags:
          --log-dir string   Specify the directory for printing log files. (default "/var/log/huawei")
    
  4. Run the following command to check whether a Pod is started properly. In the command, huawei-csi indicates the namespace for installing CSI.

    kubectl get deployment -n huawei-csi
    

    The following is an example of the command output.

    NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
    huawei-csi-controller   1/1     1            1           21h
    

Collecting All Logs in the CSI Namespace Using oceanctl

  1. Use a remote access tool, such as PuTTY, to log in to the node checked in Performing Check Before Collection through the management IP address.

  2. Run the oceanctl collect logs -n <namespace> -a –threads-max=<max_node_processing_num> command to collect CSI logs of all nodes where CSI containers reside in the cluster. In the command, threads-max indicates the maximum number of nodes for which logs can be collected at the same time. The default value is 50. You can set the value based on the host performance and load.

    oceanctl collect logs -n huawei-csi -a --threads-max=10
    
  3. Check the log package generated in the /tmp directory. You can run the unzip <zip_name> -d collect_logs command to decompress the log package. In the preceding command, <zip_name> indicates the package name.

    # date
    Wed Sep 20 02:49:24 EDT 2023
    
    # ls
    huawei-csi-2023-09-20-02:48:22-all.zip
    

Collecting the Log of a Single CSI Node Using oceanctl

  1. Use a remote access tool, such as PuTTY, to log in to the node checked in Performing Check Before Collection through the management IP address.

  2. Run the **oceanctl collect logs -n <namespace> -N **<nodeName> command to collect CSI logs of all nodes where CSI containers reside in the cluster.

    oceanctl collect logs -n huawei-csi -N node-1
    
  3. Check the log package generated in the /tmp directory. You can run the unzip <zip_name> -d collect_logs command to decompress the log package. In the preceding command, <zip_name> indicates the package name.

    # date
    Thu Sep 21 04:08:47 EDT 2023
    
    # ls
    huawei-csi-2023-09-21-04:05:15-node-1.zip