storage-dude
2 Bronze

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

Jump to solution

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? 

0 Kudos
1 Solution

Accepted Solutions
storage-dude
2 Bronze

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

Jump to solution

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!

View solution in original post

0 Kudos
2 Replies
frank_g
2 Bronze

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

Jump to solution

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.

 

0 Kudos
storage-dude
2 Bronze

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

Jump to solution

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!

View solution in original post

0 Kudos