Start a Conversation

Solved!

Go to Solution

2236

April 5th, 2021 08:00

csi-unity volumeattachments / pv will not detach and delete LUN if volumeNamePrefix is changed in values.yaml

Problem: 

When deleting a pod with persistent volume attached, the pv and attachment will not delete / unattache.

Steps to recreate:

Before installing the csi-driver, adjust the values.yaml "volumeNamePrefix" value to anything but the default. Then install the driver. Deploy a new pod with a pv and pvc to unity-iscsi. The pod will deploy and pv / pvc will be configured. pod will mount the block. Try to delete the pod, pv, and pvc. Pod and pvc will delete, but pv and mount will remain.

Work around:

- To remove the pv and mount, first unmount by editing the volume attachment. Delete the line below "finalizers"

> kubectl edit volumeattachment csi-3j4389*******

- Delete the volume attachment

> kubectl delete volumeattachment csi-3j4389*******

- Delete the pv
- Uninstall the csi-driver and reinstall making sure volumeNamePrefix is "csovol" ONLY.

Note to devs:

Is this expected? No where in the documentation does it state I cannot change the volumeNamePrefix. This a bug? 

April 9th, 2021 05:00

Fixed it. The fix: tear down the whole environment (nodes and all) and rebuild. I can now build the csi-unity driver with any volumeNamePrefix. Now LUNS are built in the Unity when pods are created with a pv/pvc, and when a pod is deleted, the pv,pvc, and volumeattachment (LUN) are all removed.

What was the source of the problem? Not sure. One thing I did change on redeployment of my nodes / network addon was building my master initialization cidr and calico add on on a subnet that did not overlap my actual public subnets. Not sure if its related.

Its working now though and that's what matters. 
Thanks to @frank_g for reaching out!

46 Posts

April 6th, 2021 14:00

Hi,

I don't experience the same behavior in my lab.  I will send a PM and we can coordinate to see this live if that is ok with you.

 

No Events found!

Top