-
Bug
-
Resolution: Done-Errata
-
None
-
Quality / Stability / Reliability
-
False
-
False
-
CLOSED
-
Moderate
-
None
Description of problem:
When cloning a data volume, on CNV4.8, if the default storageclass is defined as different to that of the source pvc, it is important for the user to specify the storageClass in the target dv manifest, to avoid the target dv defaulting to the default storage class. The user needs to be made aware of this in the documentation
Version-Release number of selected component (if applicable):
CNV4.8.4
How reproducible:
100%
Steps to Reproduce:
Checked this with the following code:
----------------------------------------------
oc version
Client Version: 4.10.0-202110050529.p0.git.8857282.assembly.stream-8857282
Server Version: 4.8.17
Kubernetes Version: v1.21.1+6438632
OpenShift Virtualization 4.8.3
Performed the following scenario:
---------------------------------------------
1. Created a source-dv on storage class ocs-storagecluster-ceph-rbd and name space golden-ns
2. Created a target-dv without specifying the storage class and on name space golden-ns
The target dv defaulted to being created on the default storage class 'local-block' and on the default name space but the pvc was not created
The same happened when defining the default storage class as 'nfs'
oc dv describe indicates that the "DataVolume.storage spec is missing accessMode and cannot get access mode from StorageProfile local-block"
When trying again and specifying the storage class in the target dv, the datavolume is cloned successfully.
We need to document the need to specify the storage class in the target dv to prevent the user from facing this?
E.g.
----------
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: <cloner-datavolume>
spec:
source:
pvc:
namespace: "<source-namespace>"
name: "<my-favorite-vm-disk>"
storage:
resources:
requests:
storage: <2Gi>
storageClassName: "<required-storageclass-name>"
Additional information
-----------------------------------------
oc get dv -A
NAMESPACE NAME PHASE PROGRESS RESTARTS AGE
default dv-target 58s
golden-ns dv-source Succeeded 100.0% 7h48m
oc get pvc -A
NAMESPACE NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
golden-ns dv-source Bound pvc-28a278dc-8893-41b9-a5a2-4ab2c096f11f 25Gi RWO ocs-storagecluster-ceph-rbd 7h48m
openshift-storage db-noobaa-db-pg-0 Bound pvc-027d78e0-da78-4fc1-9aaa-b5ec6b5fa066 50Gi RWO ocs-storagecluster-ceph-rbd 4d6h
openshift-storage ocs-deviceset-0-data-0hf4hn Bound local-pv-9f1d607c 70Gi RWO local-block 4d6h
openshift-storage ocs-deviceset-1-data-0wvvg8 Bound local-pv-e354c10f 70Gi RWO local-block 4d6h
openshift-storage ocs-deviceset-2-data-0zbstp Bound local-pv-87aab96 70Gi RWO local-block 4d6h
oc describe dv dv-target
Name: dv-target
Namespace: default
Labels: <none>
Annotations: cdi.kubevirt.io/storage.clone.token:
eyJhbGciOiJQUzI1NiIsImtpZCI6IiJ9.eyJleHAiOjE2MzY5MTIzNDcsImlhdCI6MTYzNjkxMjA0NywiaXNzIjoiY2RpLWFwaXNlcnZlciIsIm5hbWUiOiJkdi1zb3VyY2UiLCJuY...
API Version: cdi.kubevirt.io/v1beta1
Kind: DataVolume
Metadata:
Creation Timestamp: 2021-11-14T17:47:27Z
Generation: 1
Managed Fields:
API Version: cdi.kubevirt.io/v1beta1
Fields Type: FieldsV1
fieldsV1:
f:spec:
.:
f:source:
.:
f:pvc:
.:
f:name:
f:namespace:
f:storage:
.:
f:resources:
.:
f:requests:
.:
f:storage:
Manager: kubectl-create
Operation: Update
Time: 2021-11-14T17:47:27Z
Resource Version: 6279388
UID: 1f94766c-456b-45df-a50f-2b9364af30b5
Spec:
Source:
Pvc:
Name: dv-source
Namespace: golden-ns
Storage:
Resources:
Requests:
Storage: 25Gi
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ErrClaimNotValid 60s (x15 over 2m21s) datavolume-controller DataVolume.storage spec is missing accessMode and cannot get access mode from StorageProfile local-block
Yamls for source and target dv's:
----------------------------------------------
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: dv-source
namespace: golden-ns
spec:
source:
http:
url: "http://cnv-qe-server.rhevdev.lab.eng.rdu2.redhat.com/files/cnv-tests/rhel-images/rhel-84.qcow2"
pvc:
accessModes:
- ReadWriteOnce
storageClassName: ocs-storagecluster-ceph-rbd
resources:
requests:
storage: 25Gi
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: dv-target
spec:
source:
pvc:
namespace: golden-ns
name: dv-source
storage:
resources:
requests:
storage: 25Gi
- external trackers