Bug 2006418

Summary: Clone Strategy does not work as described
Product: Container Native Virtualization (CNV) Reporter: Bartosz Rybacki <brybacki>
Component: StorageAssignee: Bartosz Rybacki <brybacki>
Status: CLOSED ERRATA QA Contact: Yan Du <yadu>
Severity: high Docs Contact:
Priority: high    
Version: 4.9.0CC: alitke, cnv-qe-bugs, pelauter, yadu, ycui
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: v4.9.0-214 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-02 16:01:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bartosz Rybacki 2021-09-21 17:21:49 UTC
Description of problem:


Trying to set clone strategy on storage profile:


----
apiVersion: cdi.kubevirt.io/v1beta1
kind: StorageProfile
metadata:
  name: rook-ceph-block
spec:
  cloneStrategy: copy
status
  cloneStrategy: copy
  claimPropertySets:
  - accessModes:
    - ReadWriteMany
    volumeMode: Block


But the actual implementation accepts clone strategy on claimPropertySet level:

----
apiVersion: cdi.kubevirt.io/v1beta1
kind: StorageProfile
metadata:
  name: rook-ceph-block
spec:
  claimPropertySets:
    cloneStrategy: copy
status
  claimPropertySets:
  - accessModes:
    - ReadWriteMany
    volumeMode: Block
    cloneStrategy: copy

This is a incorrect. 


How reproducible:

Always

Steps to Reproduce:
1. k patch storageprofiles.cdi.kubevirt.io rook-ceph-block --type='json' -p='[{"op": "add" , "path": "/spec/cloneStrategy", "value": "copy"}]'


Actual results:

storageprofile.cdi.kubevirt.io/rook-ceph-block patched (no change)

Expected results:

storageprofile.cdi.kubevirt.io/rook-ceph-block patched


Additional info:
Upstream documentation does not show an example. It might be useful.

Comment 1 Yan Du 2021-09-22 12:25:02 UTC
Peter, Setting this as a blocker because we made a mistake for the API and we want to fix it before the API starts to be used.

Comment 2 Yan Du 2021-09-28 08:19:07 UTC
Test on CNV v4.9.0-220, issue has been fixed.

$ oc patch StorageProfile ocs-storagecluster-ceph-rbd --type='json' -p='[{"op": "add" , "path": "/spec/cloneStrategy", "value": "copy"}]'
storageprofile.cdi.kubevirt.io/ocs-storagecluster-ceph-rbd patched

$ oc get StorageProfile ocs-storagecluster-ceph-rbd -o yaml
-----------8<------------------
spec:
  cloneStrategy: copy
status:
  claimPropertySets:
  - accessModes:
    - ReadWriteMany
    volumeMode: Block
  cloneStrategy: copy
  provisioner: openshift-storage.rbd.csi.ceph.com
  storageClass: ocs-storagecluster-ceph-rbd

Comment 3 Yan Du 2021-09-28 08:19:07 UTC
Test on CNV v4.9.0-220, issue has been fixed.

$ oc patch StorageProfile ocs-storagecluster-ceph-rbd --type='json' -p='[{"op": "add" , "path": "/spec/cloneStrategy", "value": "copy"}]'
storageprofile.cdi.kubevirt.io/ocs-storagecluster-ceph-rbd patched

$ oc get StorageProfile ocs-storagecluster-ceph-rbd -o yaml
-----------8<------------------
spec:
  cloneStrategy: copy
status:
  claimPropertySets:
  - accessModes:
    - ReadWriteMany
    volumeMode: Block
  cloneStrategy: copy
  provisioner: openshift-storage.rbd.csi.ceph.com
  storageClass: ocs-storagecluster-ceph-rbd

Comment 6 errata-xmlrpc 2021-11-02 16:01:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 4.9.0 Images security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4104

Comment 7 Red Hat Bugzilla 2023-09-15 01:15:22 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days