This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
Bug 2247654 - [4.14] Advise Trident provisioner to use csi-clone
Summary: [4.14] Advise Trident provisioner to use csi-clone
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.14.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.14.2
Assignee: Arnon Gilboa
QA Contact: Jenia Peimer
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-02 15:26 UTC by Arnon Gilboa
Modified: 2023-12-14 16:15 UTC (History)
2 users (show)

Fixed In Version: v4.14.2.rhel9-16
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-12-14 16:15:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 2955 0 None Merged Advise Trident provisioner to use csi-clone 2023-11-02 15:26:22 UTC
Github kubevirt containerized-data-importer pull 2961 0 None Merged [release-v1.57] Advise Trident provisioner to use csi-clone 2023-11-06 14:07:13 UTC
Github kubevirt containerized-data-importer pull 3006 0 None Merged Fix Trident provisioner key for using csi-clone 2023-11-27 07:55:26 UTC
Github kubevirt containerized-data-importer pull 3007 0 None Merged [release-v1.57] Fix Trident provisioner key for using csi-clone 2023-11-27 09:32:11 UTC
Red Hat Issue Tracker   CNV-34785 0 None None None 2023-12-14 16:15:48 UTC

Description Arnon Gilboa 2023-11-02 15:26:23 UTC
StorageProfiles ease the burden of selecting the optimal PVC parameters (AccessMode and VolumeMode) for known CSI provisioners. As we encounter new provisioners we should determine the correct values and update our internal table in CDI so that our customers will get a better out of the box experience. Having a correct storage profile can also make VM provisioning order of magnitude faster (CSI clone vs. default host-assisted clone). Several customer support cases have already arisen because the OCP certified provisioner had an empty or incorrect admin provided storage profile.

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

How reproducible:
100%

Steps to Reproduce:
Create DV with any Trident storage class (provisioner: csi.trident.netapp.io).

Actual results:
StorageProfile has no cloneType, therefore DV will use host-assisted clone.

Expected results:
StorageProfile has cloneStrategy: csi-clone

Additional info:

Comment 1 Jenia Peimer 2023-11-22 23:16:27 UTC
Hi Arnon, I created the storage class, but cloneStrategy is not the 'csi-clone' for me. Could you please take a look?

CNV v4.14.1.rhel9-14 (should already contain the change)
CDI v: $ oc exec $(oc get pod -n openshift-cnv -l=cdi.kubevirt.io=cdi-apiserver --output=jsonpath='{$.items[0].metadata.name}') --namespace=openshift-cnv -- virt-cdi-apiserver --version
Containerized Data Importer v1.57.0-23-g5ab49da26

$ oc get sc trident-csi-fsx -oyaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  creationTimestamp: "2023-11-22T22:39:19Z"
  name: trident-csi-fsx
  resourceVersion: "10853000"
  uid: 35f2751b-5022-4f89-9cbd-5c20f354a361
parameters:
  backendType: ontap-nas
  fsType: ext4
provisioner: csi.trident.netapp.io
reclaimPolicy: Delete
volumeBindingMode: Immediate


$ oc get storageprofile trident-csi-fsx -oyaml
apiVersion: cdi.kubevirt.io/v1beta1
kind: StorageProfile
metadata:
  creationTimestamp: "2023-11-22T22:39:19Z"
  generation: 1
  labels:
    app: containerized-data-importer
    app.kubernetes.io/component: storage
    app.kubernetes.io/managed-by: cdi-controller
    app.kubernetes.io/part-of: hyperconverged-cluster
    app.kubernetes.io/version: 4.14.1
    cdi.kubevirt.io: ""
  name: trident-csi-fsx
  ownerReferences:
  - apiVersion: cdi.kubevirt.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: CDI
    name: cdi-kubevirt-hyperconverged
    uid: 524cc2cd-f4b7-40c9-af6e-1fdbda005da7
  resourceVersion: "10853002"
  uid: eabd32eb-a6b9-40f7-bd9a-92dd8ec1a364
spec: {}
status:
  claimPropertySets:
  - accessModes:
    - ReadWriteMany
    volumeMode: Filesystem
  cloneStrategy: copy    <----------------------------------------
  dataImportCronSourceFormat: pvc
  provisioner: csi.trident.netapp.io
  storageClass: trident-csi-fsx


Then I noticed that there was no VolumeSnapshotClass, so I created this: 

$ cat trident-volume-snapshot-class.yaml
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: csi-snapclass
driver: csi.trident.netapp.io
deletionPolicy: Delete

And it became a 'snapshot'

$ oc get storageprofile trident-csi-fsx -oyaml | grep cloneStrategy
  cloneStrategy: snapshot 

So I'm not sure how to get the 'csi-clone' here. 

A note that might be important: it's a fake storage class, means I don't have an environment to really install it, but the provisioner name is exactly the same.

Comment 2 Arnon Gilboa 2023-11-23 11:07:06 UTC
Hi Jenia, for getting the csi-clone cloneStrategy you need to put 'cloneStrategy: copy' in the StorageProfile spec. To get it actually working you'll also need teh appropriate provisoner CSIDriver. See https://github.com/kubevirt/containerized-data-importer/blob/main/doc/csi-cloning.md.

Comment 3 Arnon Gilboa 2023-11-23 11:08:50 UTC
sorry - put 'cloneStrategy: csi-clone' in the StorageProfile spec :)

Comment 4 Jenia Peimer 2023-11-26 12:24:22 UTC
IIUC, we expect that the StorageProfile will be automatically populated with 'cloneStrategy: csi-clone'?
But I'm getting 'snapshot' even when I have a csi driver:

$ oc get csidriver | grep trident
csi.trident.netapp.io                   true             false            false             <unset>         false               Persistent             10m

$ oc get storageprofile trident-csi-fsx -oyaml | grep clone
  cloneStrategy: snapshot

Comment 5 Arnon Gilboa 2023-11-26 12:49:43 UTC
Like always, you are right and I was mixing 2 bzs. You sure don't need to put `cloneStrategy: csi-clone` in the spec and the fix was supposed to do it for you. I easily reproduced it on my env. You found an actual bug in the fix.

Comment 6 Adam Litke 2023-11-28 13:33:17 UTC
The fix PR did not get picked up yet d/s.  Pushing to 4.14.2.


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