1 - Failed to Start the huawei-csi-node Service with Error Message /var/lib/iscsi is not a directory Reported

Symptom

The huawei-csi-node service cannot be started. When you run the kubectl describe daemonset huawei-csi-node -n huawei-csi command, error message “/var/lib/iscsi is not a directory” is reported.

Root Cause Analysis

The /var/lib/iscsi directory does not exist in the huawei-csi-node container.

Solution or Workaround

  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. Go to the directory where the Helm project is located. If the previous Helm project cannot be found, copy the helm directory in the component package to any directory on the master node. For details about the component package path, see Table 1.

  3. Go to the templates directory and find the huawei-csi-node.yaml file.

    cd /templates
    
  4. Run the following command to set path in huawei-csi-node.yaml > volumes > iscsi-dir > hostPath to /var/lib/iscsi, save the file, and exit.

    vi huawei-csi-node.yaml
    
  5. Run the following command to upgrade the Helm chart. The upgrade command will update the Deployment, DaemonSet, and RBAC resources. In the preceding command, helm-huawei-csi indicates the custom chart name and huawei-csi indicates the custom namespace.

    helm upgrade helm-huawei-csi ./  -n huawei-csi -f values.yaml
    

    The following is an example of the command output.

    Release "helm-huawei-csi" has been upgraded. Happy Helming!
    NAME: helm-huawei-csi
    LAST DEPLOYED: Thu Jun  9 07:58:15 2022
    NAMESPACE: huawei-csi
    STATUS: deployed
    REVISION: 2
    TEST SUITE: None
    

2 - Huawei CSI Services Fail to Be Started and Error Message '/etc/localtime is not a file' Is Displayed

Symptom

During the installation and deployment of CSI, a Pod fails to run and is in the ContainerCreating state. Alarm /etc/localtime is not a file is generated for the Pod.

Root Cause Analysis

When the container mounts the /etc/localtime file on the host, the type is incorrectly identified. As a result, the container fails to mount the /etc/localtime file on the host and the Pod cannot run.

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 check the running status of the Pod of the CSI services.

    kubectl get pod -n huawei-csi
    

    The following is an example of the command output. huawei-csi indicates the namespace where the CSI services are deployed.

    NAME                                     READY   STATUS               RESTARTS   AGE
    huawei-csi-controller-6dfcc4b79f-9vjtq   9/9     ContainerCreating    0          24m
    huawei-csi-controller-6dfcc4b79f-csphc   9/9     ContainerCreating    0          24m
    huawei-csi-node-g6f4k                    3/3     ContainerCreating    0          20m
    huawei-csi-node-tqs87                    3/3     ContainerCreating    0          20m
    
  3. Run the following command to check the Events parameter of the container.

    kubectl describe pod huawei-csi-controller-6dfcc4b79f-9vjtq -n huawei-csi
    

    The following is an example of the command output. In the command, huawei-csi-controller-6dfcc4b79f-9vjtq indicates the name of the Pod in the ContainerCreating state found in 2, and huawei-csi indicates the namespace to which the Pod belongs.

    ...
    Events:
      Type     Reason       Age                From               Message
      ----     ------       ----               ----               -------
      Normal   Scheduled    96s                default-scheduler  Successfully assigned huawei-csi/huawei-csi-controller-6dfcc4b79f-9vjtq to node1
      Warning  FailedMount  33s (x8 over 96s)  kubelet            MountVolume.SetUp failed for volume "host-time" : hostPath type check failed: /etc/localtime is not a file
    
  4. Run the cd /helm/esdk/templates command to go to the CSI installation package path. For the path, see Table 1.

  5. Take the huawei-csi-controller.yaml file as an example. Run the following command to view the file content.

    vi huawei-csi-controller.yaml
    

    Find the host-time configuration item under volumes, and delete the type: File line. Perform the same operations on the huawei-csi-node.yaml deployment file that involves the configuration item in the templates directory.

    ...
    ...
    volumes:
      - hostPath:
          path: /var/log/
          type: Directory
        name: log
      - hostPath:
          path: /etc/localtime
          type: File
        name: host-time
    ...
    ...
    
  6. Uninstall and reinstall the service by referring to Uninstalling Huawei CSI Using Helm.

  7. Run the following command to check whether the Pod running status of Huawei CSI services is Running.

    kubectl get pod -n huawei-csi
    

    The following is an example of the command output.

    NAME                                     READY   STATUS    RESTARTS   AGE
    huawei-csi-controller-6dfcc4b79f-9vjts   9/9     Running   0          24m
    huawei-csi-controller-6dfcc4b79f-csphb   9/9     Running   0          24m
    huawei-csi-node-g6f41                    3/3     Running   0          20m
    huawei-csi-node-tqs85                    3/3     Running   0          20m
    

3 - Failed to Start huawei-csi Services with the Status Displayed as InvalidImageName

Symptom

The huawei-csi services (huawei-csi-controller or huawei-csi-node) cannot be started. After the kubectl get pod -A | grep huawei command is executed, the command output shows that the service status is InvalidImageName.

kubectl get pod -A | grep huawei

The following is an example of the command output.

huawei-csi     huawei-csi-controller-fd5f97768-qlldc     6/9     InvalidImageName     0          16s
huawei-csi     huawei-csi-node-25txd                     2/3     InvalidImageName     0          15s

Root Cause Analysis

In the .yaml configuration files of the controller and node, the Huawei CSI image version number is incorrect. For example:

        ...
        - name: huawei-csi-driver
          image: huawei-csi:4.5.0
        ...

Solution or Workaround

  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 modify the configuration file of the huawei-csi-node service. Press I or Insert to enter the insert mode and modify related parameters. After the modification is complete, press Esc and enter :wq! to save the modification.

    kubectl edit daemonset huawei-csi-node -o yaml -n=huawei-csi
    

    • In huawei-csi-driver in the sample .yaml file, modify image to Huawei CSI image huawei-csi:4.5.0.
    containers:
      ...
      - name: huawei-csi-driver
        image: huawei-csi:4.5.0
    
  3. Run the following command to modify the configuration file of the huawei-csi-controller service: Press I or Insert to enter the insert mode and modify related parameters. After the modification is complete, press Esc and enter :wq! to save the modification.

    kubectl edit deployment huawei-csi-controller -o yaml -n=huawei-csi
    

    • In huawei-csi-driver in the sample .yaml file, modify image to Huawei CSI image huawei-csi:4.5.0.
    containers:
      ...
      - name: huawei-csi-driver
        image: huawei-csi:4.5.0
    
  4. Wait until the huawei-csi-node and huawei-csi-controller services are started.

  5. Run the following command to check whether the huawei-csi services are started.

    kubectl get pod -A  | grep huawei
    

    The following is an example of the command output. If the Pod status is Running, the services are started successfully.

    huawei-csi   huawei-csi-controller-58799449cf-zvhmv   9/9     Running       0          2m29s
    huawei-csi   huawei-csi-node-7fxh6                    3/3     Running       0          12m