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 2252210 - Cross storage class cloning from DataSource is selecting incorrect volumeMode
Summary: Cross storage class cloning from DataSource is selecting incorrect volumeMode
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.14.0
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Adam Litke
QA Contact: Natalie Gavrielov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-11-30 06:26 UTC by nijin ashok
Modified: 2023-12-14 16:04 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-12-14 16:04:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   CNV-35879 0 None None None 2023-12-14 16:04:44 UTC

Description nijin ashok 2023-11-30 06:26:48 UTC
Description of problem:

Got datasource PVC in `ocs-external-storagecluster-ceph-rbd` storage class with volumeMode block. Tried to create a new VM from the template to another storage class nfs-csi. The created temporary source PVC has got `volumeMode: filesystem` instead of block.

~~~
# oc get pvc tmp-source-pvc-b32507e1-8fc4-4143-96a4-c01235f03a12  -n openshift-virtualization-os-images  -o json |jq '.spec'
{
  "accessModes": [
    "ReadWriteMany"
  ],
  "dataSource": {
    "apiGroup": "snapshot.storage.k8s.io",
    "kind": "VolumeSnapshot",
    "name": "rhel8-3d8ef774e232"
  },
  "dataSourceRef": {
    "apiGroup": "snapshot.storage.k8s.io",
    "kind": "VolumeSnapshot",
    "name": "rhel8-3d8ef774e232"
  },
  "resources": {
    "requests": {
      "storage": "30Gi"
    }
  },
  "storageClassName": "ocs-external-storagecluster-ceph-rbd",
  "volumeMode": "Filesystem"                                     <=====
}

# oc get VolumeSnapshot rhel8-3d8ef774e232 -n openshift-virtualization-os-images -o json |yq '.spec,.status'

{"source": {"persistentVolumeClaimName": "rhel8-3d8ef774e232"}, "volumeSnapshotClassName": "ocs-external-storagecluster-rbdplugin-snapclass"}
{"boundVolumeSnapshotContentName": "snapcontent-511b5e9a-0918-4037-83e5-cb9cabfcb5c2", "creationTime": "2023-11-15T14:50:57Z", "readyToUse": true, "restoreSize": "30Gi"}

~~~  

So the provisioning fails at the ceph CSI end:

~~~
I1130 05:01:41.030965       1 event.go:298] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"openshift-virtualization-os-images", Name:"tmp-source-pvc-b32507e1-8fc4-4143-96a4-c01235f03a12", UID:"cc9bebb3-efcb-46ab-8c10-8d79bbaccb0d", APIVersion:"v1", ResourceVersion:"34875794", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "ocs-external-storagecluster-ceph-rbd": rpc error: code = InvalidArgument desc = multi node access modes are only supported on rbd `block` type volumes
~~~

It looks like it's copying the volumemode and accessmode from the target PVC which will not be always correct [1].

~~~
# oc get pvc rhel8-mean-asp -n nijin-cnv -o json |jq '.spec'
{
  "accessModes": [
    "ReadWriteMany"
  ],
  "dataSource": {
    "apiGroup": "cdi.kubevirt.io",
    "kind": "VolumeCloneSource",
    "name": "volume-clone-source-8b84f0bb-5a3f-4ae8-aaca-67ceb956401f"
  },
  "dataSourceRef": {
    "apiGroup": "cdi.kubevirt.io",
    "kind": "VolumeCloneSource",
    "name": "volume-clone-source-8b84f0bb-5a3f-4ae8-aaca-67ceb956401f"
  },
  "resources": {
    "requests": {
      "storage": "34087042032"
    }
  },
  "storageClassName": "nfs-csi",
  "volumeMode": "Filesystem"        <===
}
~~~
 


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

OpenShift Virtualization   4.14.0

How reproducible:

100%

Steps to Reproduce:

1. Populate the template boot source images in ceph rbd storage class.
2. Create a new VM from a template and change the disk to another filesystem storage class.

Create => From template => select template => Customize Virtual machine parameters => Disks => Change the disk storage class.

3. VM will be stuck in provisioning status for ever.

Actual results:

Cross storage class cloning from DataSource in selecting incorrect volumeMode 

Expected results:

It should select the correct volumeMode from source PVC.

Additional info:

[1] https://github.com/kubevirt/containerized-data-importer/blob/319a27faade112e6f20cf1cdd0d528e5727b0959/pkg/controller/clone/planner.go#L776


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