-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
0.42
-
False
-
-
False
-
NEW
-
---
-
---
-
-
Storage Core Sprint 251
-
Medium
-
No
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" },
{ "apiGroup": "snapshot.storage.k8s.io", "kind": "VolumeSnapshot", "name": "rhel8-3d8ef774e232" }
"dataSourceRef":,
"resources":Unknown macro: { "requests"},
"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
): 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" },
{ "apiGroup": "cdi.kubevirt.io", "kind": "VolumeCloneSource", "name": "volume-clone-source-8b84f0bb-5a3f-4ae8-aaca-67ceb956401f" }
"dataSourceRef":,
"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: