Bug 1842747 - Not READYTOUSE volumesnapshot instance can not be deleted
Summary: Not READYTOUSE volumesnapshot instance can not be deleted
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.5
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.6.0
Assignee: OpenShift Storage Bugzilla Bot
QA Contact: Wei Duan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-02 03:32 UTC by Qin Ping
Modified: 2022-08-25 21:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-25 21:05:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift csi-external-snapshotter pull 28 0 None closed Bug 1876810: Rebase v3.0.0 2021-01-19 06:37:01 UTC

Description Qin Ping 2020-06-02 03:32:48 UTC
Description of problem:
Not READYTOUSE volumesnapshot instance can not be deleted

Version-Release number of selected component (if applicable):
$ oc get clusterversion --context=admin
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.5.0-0.nightly-2020-05-30-025738   True        False         5h41m   Cluster version is 4.5.0-0.nightly-2020-05-30-025738


How reproducible:
Always

Steps to Reproduce:
1. Deploy aws ebs csi drvier wih operator, the storageclass gp2-csi is created too.
$ oc get sc gp2-csi
NAME      PROVISIONER       RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
gp2-csi   ebs.csi.aws.com   Delete          WaitForFirstConsumer   true                   19h
2. Create a default volumesnapshotclass with:
$ cat volumesnapshotclass.yaml 
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotClass  
metadata:
  name: csi-aws-ebs-snapclass
deletionPolicy: Delete
3. Create a PVC with storageclass gp2-csi(pvc in pending status)
$ cat pvc.yaml 
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc2
spec:
  storageClassName: gp2-csi
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
4.Create a volumesnapshot with:
$ cat volumesnapshot.yaml 
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
  name: mysnap2
spec:
  volumeSnapshotClassName: csi-aws-ebs-snapclass
  source:
    persistentVolumeClaimName: pvc2
5. Check the volumesnapshot
$ oc get volumesnapshot mysnap2
NAME      READYTOUSE   SOURCEPVC   SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS           SNAPSHOTCONTENT   CREATIONTIME   AGE
mysnap2   false        pvc2                                              csi-aws-ebs-snapclass                                    17h
6. Create a Pod using pvc2(pvc in bound status)
7. Create a volumesnapshot for pvc2 again
$ cat volumesnapshot.yaml 
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
  name: mysnap3
spec:
  volumeSnapshotClassName: csi-aws-ebs-snapclass
  source:
    persistentVolumeClaimName: pvc2
8. Check the volumesnapshot status and delete volumesnapshot mysnap2 and mysnap3


Actual results:
mysnap3 volumesnapshot(can be delete successfully):
Status:
  Bound Volume Snapshot Content Name:  snapcontent-fd1c7ddb-d911-4dd6-a359-d3e015d4b9b0
  Creation Time:                       2020-06-02T03:08:38Z
  Ready To Use:                        true
  Restore Size:                        2Gi
Events:                                <none>



mysnap2 volumesnapshot(can not be deleted):
Status:
  Error:
    Message:     Failed to create snapshot content with error failed to get input parameters to create snapshot mysnap2: "the PVC pvc2 is not yet bound to a PV, will not attempt to take a snapshot"
    Time:        2020-06-01T09:51:05Z
  Ready To Use:  false
Events:          <none>



Expected results:
mysnap2 volumesnapshot can be deleted successfully.

Master Log:

Node Log (of failed PODs):

PV Dump:

PVC Dump:

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

Additional info:
$ oc logs csi-snapshot-controller-5767cdc6f5-rrk2n -n openshift-cluster-storage-operator|grep mysnap2
I0601 09:51:05.032466       1 snapshot_controller.go:498] createSnapshotContent: Creating content for snapshot default/mysnap2 through the plugin ...
E0601 09:51:05.047543       1 snapshot_controller.go:601] getCreateSnapshotInput failed to get PersistentVolume object [mysnap2]: Error: [&errors.errorString{s:"the PVC pvc2 is not yet bound to a PV, will not attempt to take a snapshot"}]
E0601 09:51:05.057932       1 snapshot_controller_base.go:378] could not sync volume "default/mysnap2": failed to get input parameters to create snapshot mysnap2: "the PVC pvc2 is not yet bound to a PV, will not attempt to take a snapshot"
I0601 09:51:05.057987       1 snapshot_controller.go:809] Keeping PVC default/pvc2, it is used by snapshot default/mysnap2
I0601 09:51:05.058023       1 snapshot_controller.go:498] createSnapshotContent: Creating content for snapshot default/mysnap2 through the plugin ...
E0601 09:51:05.058037       1 snapshot_controller.go:601] getCreateSnapshotInput failed to get PersistentVolume object [mysnap2]: Error: [&errors.errorString{s:"the PVC pvc2 is not yet bound to a PV, will not attempt to take a snapshot"}]
E0601 09:51:05.066153       1 snapshot_controller_base.go:378] could not sync volume "default/mysnap2": failed to get input parameters to create snapshot mysnap2: "the PVC pvc2 is not yet bound to a PV, will not attempt to take a snapshot"
I0601 09:51:05.066199       1 snapshot_controller.go:809] Keeping PVC default/pvc2, it is used by snapshot default/mysnap2
I0601 09:51:05.066245       1 event.go:281] Event(v1.ObjectReference{Kind:"VolumeSnapshot", Namespace:"default", Name:"mysnap2", UID:"aa8c2bed-1744-4907-b15f-3f358addf30b", APIVersion:"snapshot.storage.k8s.io/v1beta1", ResourceVersion:"184680", FieldPath:""}): type: 'Warning' reason: 'SnapshotContentCreationFailed' Failed to create snapshot content with error failed to get input parameters to create snapshot mysnap2: "the PVC pvc2 is not yet bound to a PV, will not attempt to take a snapshot"
I0601 09:51:40.040589       1 snapshot_controller.go:809] Keeping PVC default/pvc2, it is used by snapshot default/mysnap2
I0601 09:52:40.040748       1 snapshot_controller.go:809] Keeping PVC default/pvc2, it is used by snapshot default/mysnap2
I0601 09:53:40.040945       1 snapshot_controller.go:809] Keeping PVC default/pvc2, it is used by snapshot default/mysnap2

Comment 5 Wei Duan 2020-09-23 10:05:47 UTC
Verified pass on 4.6.0-0.nightly-2020-09-22-213802

[wduan@MINT snapshot]$ oc get volumesnapshot
NAME         READYTOUSE   SOURCEPVC   SOURCESNAPSHOTCONTENT   RESTORESIZE   SNAPSHOTCLASS           SNAPSHOTCONTENT   CREATIONTIME   AGE
mysnapshot   false        mypvc-ori                                         csi-aws-ebs-snapclass                                    2m57s

[wduan@MINT snapshot]$ oc delete volumesnapshot mysnapshot
volumesnapshot.snapshot.storage.k8s.io "mysnapshot" deleted

[wduan@MINT snapshot]$ oc get volumesnapshot
No resources found in wduan namespace.


Note You need to log in before you can comment on or make changes to this bug.