Bug 1298813

Summary: [RFE] Persistent Volume with recycle policy becomes 'FAILED' immediately after claim is deleted if the volume plugin does not support recycling
Product: OpenShift Container Platform Reporter: Jianwei Hou <jhou>
Component: StorageAssignee: Erin Boyd <eboyd>
Status: CLOSED WONTFIX QA Contact: Jianwei Hou <jhou>
Severity: low Docs Contact:
Priority: low    
Version: 3.1.0CC: aos-bugs, bchilds, jkrieger, pep
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-09 15:36:49 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:
Bug Depends On:    
Bug Blocks: 1267746    

Description Jianwei Hou 2016-01-15 07:01:28 UTC
Description of problem:
Given a persistent volume has 'recycle' reclaim policy, and it is bound to a claim. When the claim is deleted, the persistent volume status becomes 'FAILED' immediately

Version-Release number of selected component (if applicable):


How reproducible:
openshift v3.1.1.2
kubernetes v1.1.0-origin-1107-g4c8e6f4
etcd 2.1.2

Steps to Reproduce:
1. Create a PV with reclaim policy set as 'recycle'
oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/persistent-volumes/iscsi/pv-rwx.json
2. Create a PVC
oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/persistent-volumes/iscsi/pvc-rwx.json
3. When PV and PVC are bound, delete this PVC
4. Get PV status

Actual results:
After step 4:
# oc get pv 
NAME      LABELS    CAPACITY   ACCESSMODES   STATUS    CLAIM         REASON    AGE
iscsi     <none>    5Gi        RWX           Failed    jhou/iscsic             5m

# oc describe pv iscsi
Name:		iscsi
Labels:		<none>
Status:		Failed
Claim:		jhou/iscsic
Reclaim Policy:	Recycle
Access Modes:	RWX
Capacity:	5Gi
Message:	no volume plugin matched
Source:
    Type:		ISCSI (an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod)
    TargetPortal:	192.168.0.225:3260
    IQN:		iqn.2015-06.world.server:storage.target00
    Lun:		0
    FSType:		ext4
    ReadOnly:		false

Logs:
```
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.151773   38864 persistentvolume_claim_binder_controller.go:196] Synchronizing PersistentVolume[iscsi], current phase: Bound
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.167844   38864 persistentvolume_claim_binder_controller.go:313] PersistentVolume[iscsi] changing phase from Bound to Released
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.177292   38864 persistentvolume_recycler_controller.go:101] Reclaiming PersistentVolume[iscsi]
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.179403   38864 persistentvolume_claim_binder_controller.go:196] Synchronizing PersistentVolume[iscsi], current phase: Released
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.188287   38864 persistentvolume_recycler_controller.go:133] Recycling PersistentVolume[iscsi]
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.188328   38864 persistentvolume_recycler_controller.go:165] PersistentVolume[iscsi] changing phase from Released to Failed
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.414246   38864 persistentvolume_claim_binder_controller.go:196] Synchronizing PersistentVolume[iscsi], current phase: Failed
Jan 15 14:32:38 openshift-115.lab.eng.nay.redhat.com atomic-openshift-master[38864]: I0115 14:32:38.414298   38864 persistentvolume_claim_binder_controller.go:304] PersistentVolume[iscsi] previously failed recycling.  Skipping.
```

Expected results:
Not sure if this is our expected behavior, since recycle policy now only supports hostpath and nfs.

Additional info:

Comment 1 Bradley Childs 2016-01-26 15:55:44 UTC
this is not a bug- iscsi has no recycler. Marking as feature request.

Comment 2 Steve Watt 2016-02-01 17:13:35 UTC
Yes, The ISCSI volume plugin does not support Recycle Operations on a claim release.

However, I think we should throw an intuitive error & description when someone attempts to create a PV where the the PV definition specifies something that the underlying volume type does not support.  

Assigning to Brad Childs (Dev Lead) so that he can re-assign to a member of the dev team.

Comment 3 Jianwei Hou 2016-03-11 02:50:09 UTC
Only NFS and hostPath support recycle, any PV with recycle policy and other volume plugins will reproduce this issue.

Comment 5 Bradley Childs 2018-03-09 15:36:49 UTC
Closing as 'wont fix'.  The recycle feature is deprecated since 3.7