Bug 2149669

Summary: [4.11] Backup program integration: DataVolume/PVC restore should not require PVC initially owned by DV
Product: Container Native Virtualization (CNV) Reporter: Michael Henriksen <mhenriks>
Component: StorageAssignee: Michael Henriksen <mhenriks>
Status: CLOSED ERRATA QA Contact: Natalie Gavrielov <ngavrilo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.11.0CC: mrashish, yadu
Target Milestone: ---   
Target Release: 4.11.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: CNV v4.11.2-2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2149671 (view as bug list) Environment:
Last Closed: 2023-01-12 14:08:55 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:
Bug Depends On:    
Bug Blocks: 2149671    

Description Michael Henriksen 2022-11-30 14:49:21 UTC
Description of problem:

When a DataVolume/PVC is being restored by a backup program (say Velero) the following should be true:

1.  DataVolume has "cdi.kubevirt.io/storage.prePopulated" annotation
2.  PVC has "cdi.kubevirt.io/storage.populatedFor" annotation
3.  Doesn't matter if DV or PVC is restored first
4.  PVC does not have to initially be owned by the DataVolume

This bug deals with 4


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


How reproducible:


Steps to Reproduce:
1.  Create DataVolume

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  annotations:
    cdi.kubevirt.io/storage.prePopulated: populated-dv
  name: populated-dv
  namespace: default
spec:
  pvc:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 2Gi
    storageClassName: rook-ceph-block
    volumeMode: Filesystem
  source:
    http:
      url: http://doesnotexist/disk.img

2. Create PVC

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    cdi.kubevirt.io/storage.populatedFor: populated-dv
  name: populated-dv
  namespace: default
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
  storageClassName: rook-ceph-block
  volumeMode: Filesystem


Actual results:

DataVolume will stay pending until DV is reconciled again 


Expected results:

DataVolume will go to succeeded phase


Additional info:

Comment 2 Fuhui Yang 2022-12-19 07:14:38 UTC
Version-Release number of selected component (if applicable):  4.11.2

Steps to Verify:
1.  Create a DataVolume with "cdi.kubevirt.io/storage.prePopulated" annotation:

$ oc get dv
NAME   PHASE     PROGRESS   RESTARTS   AGE
dv1    Pending                         3s

2. Create a PVC with "cdi.kubevirt.io/storage.populatedFor" annotation

3. Check DV's status:

$ oc get dv
NAME   PHASE       PROGRESS   RESTARTS   AGE
dv1    Succeeded   N/A                   41s

Comment 10 errata-xmlrpc 2023-01-12 14:08:55 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 (OpenShift Virtualization 4.11.2 Images), 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/RHEA-2023:0155