Bug 2110999 - [CSI OSP] Clone volume successfully with different storage class
Summary: [CSI OSP] Clone volume successfully with different storage class
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: OpenShift Storage Bugzilla Bot
QA Contact: Wei Duan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-26 10:11 UTC by Chao Yang
Modified: 2022-07-29 13:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-29 13:57:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chao Yang 2022-07-26 10:11:32 UTC
Description of problem:
Clone volume successfully with different storage class
https://kubernetes.io/docs/concepts/storage/volume-pvc-datasource/

Version-Release number of selected component (if applicable):
NAME      VERSION       AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.11.0-rc.5   True        False         155m    Cluster version is 4.11.0-rc.5

How reproducible:
Always

Steps to Reproduce:
1.Create sc sc-nbm0i-1
oc get sc/sc-nbm0i-1 -o yaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.kubernetes.io/is-default-class: "false"
  creationTimestamp: "2022-07-26T09:30:12Z"
  name: sc-nbm0i-1
  resourceVersion: "80259"
  uid: 09a6eaa4-7b25-4868-8fd5-b641059b3a9e
provisioner: cinder.csi.openstack.org
reclaimPolicy: Delete
volumeBindingMode: Immediate
2.Create pvc/pvc2 with sc sc-nbm0i-1
3.Create another sc/sc-nbm0i-2
oc get sc/sc-nbm0i-2 -o yaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.kubernetes.io/is-default-class: "false"
  creationTimestamp: "2022-07-26T09:30:18Z"
  name: sc-nbm0i-2
  resourceVersion: "80310"
  uid: b1c2135b-adb3-43e7-8413-ee3ba2351efa
provisioner: cinder.csi.openstack.org
reclaimPolicy: Delete
volumeBindingMode: Immediate
4.Create clone pvc with sc/sc-nbm0i-2 
oc get pvc/clone-of-pvc1 -o json | jq .spec
{
  "accessModes": [
    "ReadWriteOnce"
  ],
  "dataSource": {
    "apiGroup": null,
    "kind": "PersistentVolumeClaim",
    "name": "pvc2"
  },
  "dataSourceRef": {
    "apiGroup": null,
    "kind": "PersistentVolumeClaim",
    "name": "pvc2"
  },
  "resources": {
    "requests": {
      "storage": "5Gi"
    }
  },
  "storageClassName": "sc-nbm0i-2",
  "volumeMode": "Filesystem",
  "volumeName": "pvc-ab0e8aba-cda2-4f47-b7d9-5c228ec4e9b5"
}


Actual results:
volume is provisioned and pod can be running status.

Expected results:
clone is failed and some error displayed.

Master Log:

Node Log (of failed PODs):

PV Dump:

PVC Dump:

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

Additional info:

Comment 1 Jan Safranek 2022-07-26 16:01:25 UTC
I think the upstream documentation is outdated. Upstream external-provisioner v3.2.1 allows cloning using a different StorageClass than used by the original PV.
https://github.com/kubernetes-csi/external-provisioner/pull/699/commits/96700cb7637640bcef39fc9e70244fb71b9c5ab4

We just need to fix the upstream (and OCP?) docs.

Comment 2 Wei Duan 2022-07-27 00:24:26 UTC
@chao I think we need to 
1. File 4.11 OCP doc bug (you can assign to Lisa directly) as we indeed mentioned the limitation in openshift doc like https://docs.openshift.com/container-platform/4.10/storage/container_storage_interface/persistent-storage-csi-cloning.html#support-limitations
2. Need check for 4.11- to see if external-provisioner v3.2.1+ is used, if yes, doc fix should be backport to 4.11-
3. File issue for kubernetes doc (Or contribute PR directly)
4. Deactive our negative test case

I guess this bug could be closed.


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