Huawei / eSDK_K8S_Plugin

Container-Storage-Interface (CSI) for Huawei storage
Apache License 2.0
82 stars 47 forks source link

Can't unmount persitent volumes. #86

Closed bdietrich12 closed 1 year ago

bdietrich12 commented 2 years ago

Hello, I'm facing a terrible issue since I update the driver csi and kubernetes.

Everything is working with the drivers v3.0.0 but i can"t unmount persistent volumes when a pod is scale to 0.

I check the log and see that there is a difference between the commands pass by the driver to identificate a device and to remove it from the virtual machines.

Here is my log, from cluster A (old driver version but it works) and cluster (last driver version but not working).

Cluster A (working): driver csi : v2.2.13 os : ubuntu 18.04 kubernetes version: 1.18.5

2022-08-19 11:10:52.360596 5267 [INFO]: Shell cmd "ls -l /dev/mapper/ | grep -w dm-9 | awk '{print $9}'" result: 3678b46a10025fc22e1ebf3be00001aa9

2022-08-19 11:10:52.360656 5267 [INFO]: Gonna run shell cmd "multipath -f 3678b46a10025fc22e1ebf3be00001aa9 ". 2022-08-19 11:10:52.502737 5267 [INFO]: Shell cmd "multipath -f 3678b46a10025fc22e1ebf3be00001aa9 " result:

2022-08-19 11:10:52.502788 5267 [INFO]: Flush multipath device 3678b46a10025fc22e1ebf3be00001aa9 successful

Cluster B (not working): driver csi : v3.0.0 os : ubuntu 18.04 kubernetes version: 1.23.5

2022-08-19 10:37:10.880217 52046 [INFO]: [requestID:3583979891] Gonna run shell cmd "ls -l /dev/mapper/ | grep -w dm-5". 2022-08-19 10:37:10.886492 52046 [INFO]: [requestID:3583979891] Shell cmd "ls -l /dev/mapper/ | grep -w dm-5" result: lrwxrwxrwx 1 root root 7 Aug 19 10:57 3678b46a10025fc41736cbc0e0000007b -> ../dm-5

2022-08-19 10:37:10.886756 52046 [ERROR]: [requestID:3583979891] Can not get DMDevice by alias: dm-5 2022-08-19 10:37:10.886792 52046 [ERROR]: [requestID:3583979891] Get DMDevice by alias:dm-5 failed. error: Can not get DMDevice by alias: dm-5 2022-08-19 10:37:10.886816 52046 [ERROR]: [requestID:3583979891] check device: dm-5 is a partition device failed. error: Get DMDevice by alias:dm-5 failed. error: Can not get DMDevice by alias: dm-5 2022-08-19 10:37:10.886841 52046 [ERROR]: [requestID:3583979891] Get device of WWN 678b46a10025fc41736cbc0e0000007b error: check device: dm-5 is a partition device failed. error: Get DMDevice by alias:dm-5 failed. error: Can not get DMDevice by alias: dm-5

As you can see there is a difference in Gonna run shell cmd "ls -l /dev/mapper/ | grep -w dm-5". , in cluster A there is a awk and a print that I don't have in cluster B.

Here is how I construct my dockerfile :

FROM ubuntu:18.04

RUN apt update && apt -y install multipath-tools open-iscsi nfs-common xfsprogs gawk

ADD ["huawei-csi", "/"] RUN ["chmod", "+x", "/huawei-csi"]

ENTRYPOINT ["/huawei-csi"]

YeYoot commented 2 years ago

You can add the following parameters to the /etc/multipath.conf file by referring to section 3.6.1.2. defaults { user_friendly_names yes find_multipaths no }