Bug 1909136

Summary: Volume and volumesnapshot did not be deleted in the back end after OCP cluster removal
Product: OpenShift Container Platform Reporter: Wei Duan <wduan>
Component: StorageAssignee: ShiftStack Bugwatcher <shiftstack-bugwatcher>
Storage sub component: OpenStack CSI Drivers QA Contact: Wei Duan <wduan>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: low CC: aos-bugs, emacchi, mfedosin, pprinett
Version: 4.7Keywords: Triaged
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-15 16:40:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Wei Duan 2020-12-18 12:34:47 UTC
Description of problem:
Volume and volumesnapshot did not be deleted in the back end after OCP cluster removal

Version-Release number of selected component (if applicable):
4.7.0-0.nightly-2020-12-14-080124

How reproducible:
Always

Steps to Reproduce:
1. Install OSP cluster and cinder csi driver is installed.
2. Create pvc (reclaimPolicy: Delete in storageclass)
3. Create volumesnapshot (deletionPolicy: Delete in volumesnapshotclass)
4. Delete cluster
5. Check the volume and volumesnapshot in the back end

Actual results:
volume and volumesnapshot did not removed

Expected results:
volume and volumesnapshot should be removed after OCP cluster removal

Master Log:

Node Log (of failed PODs):

PV Dump:

PVC Dump:

StorageClass Dump (if StorageClass used by PV/PVC):

Additional info:

Comment 3 Martin André 2021-03-25 14:17:53 UTC
Cinder CSI does not offer the ability to set additional tags the resources it creates. It does add the "cinder.csi.openstack.org/cluster" property however [1], which I assume is to match the volume with a cluster ID, but in practice it is set to 'kubernetes':

$ openstack volume show pvc-96cfac38-fa62-4a51-8f2d-febf96920b2a -f value -c properties
{'cinder.csi.openstack.org/cluster': 'kubernetes'}

The 'kubernetes' value apparently comes from [2].

Once we fix the cluster name for CSI driver, we'll have to adapt the installer's destroy module to look for volumes with the `cinder.csi.openstack.org/cluster=<cluster_id>` property.

[1] https://github.com/openshift/cloud-provider-openstack/blob/ef0206889cb7c39f04d215e8cbb6c69616e59ea4/pkg/csi/cinder/controllerserver.go#L104
[2] https://github.com/openshift/openstack-cinder-csi-driver-operator/blob/729e71f/assets/controller.yaml#L49

Comment 9 Pierre Prinetti 2021-05-27 15:31:00 UTC
*** Bug 1917710 has been marked as a duplicate of this bug. ***

Comment 13 ShiftStack Bugwatcher 2021-11-25 16:11:12 UTC
Removing the Triaged keyword because:
* the target release value is missing

* the QE automation assessment (flag qe_test_coverage) is missing