Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-35879

[2252210] Cross storage class cloning from DataSource is selecting incorrect volumeMode

XMLWordPrintable

    • Storage Core Sprint 251
    • Medium

      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.

      ~~~

      1. 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":

        Unknown macro: { "requests"}

        ,
        "storageClassName": "ocs-external-storagecluster-ceph-rbd",
        "volumeMode": "Filesystem" <=====
        }

      1. 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].

      ~~~

      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":

        Unknown macro: { "requests"}

        ,
        "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

            akalenyu Alex Kalenyuk
            rhn-support-nashok Nijin Ashok
            Dalia Frank Dalia Frank
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: