Uploaded image for project: 'OpenShift API for Data Protection'
  1. OpenShift API for Data Protection
  2. OADP-3360

PVC has a left out label related to volumeSnapshot after success FileSystem Restore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • OADP 1.4.0
    • OADP 1.3.0
    • kopia, restic
    • False
    • Hide

      None

      Show
      None
    • False
    • ToDo
    • No
    • 0
    • 0
    • Very Likely
    • 0
    • None
    • Unset
    • Unknown

      Description of problem:

      Executed FileSystem backup and restore after successful CSI backup and restore.I noticed that PVC has a left out label related to the snapshot. 

          labels:
            velero.io/volume-snapshot-name: velero-mysql-jh2bc 

      Slack discussion:- 

      https://redhat-internal.slack.com/archives/C0144ECKUJ0/p1705408217639149

       

       

      Version-Release number of selected component (if applicable):
      OADP 1.3.0

       

      How reproducible:
      Always

       

      Steps to Reproduce:

      1. Create a DPA with CSI enabled.

      apiVersion: oadp.openshift.io/v1alpha1
      kind: DataProtectionApplication
      metadata:
        namespace: openshift-adp
        name: ts-dpa
      spec:
        configuration:
          velero:
            defaultPlugins:
            - openshift
            - aws
            - csi
        backupLocations:
          - velero:
              provider: aws
              default: true
              objectStorage:
                bucket: miniobucket
                prefix: velero
              config:
                insecureSkipTLSVerify: 'true'
                profile: minio
                region: minio
                s3ForcePathStyle: 'true'
                s3Url: http://minio-minio.apps.oadp-67130.qe.gcp.devcluster.openshift.com 

      2. Deploy a stateful application
      3. Execute CSI backup

      $ oc get backup test-backup -o yaml
      apiVersion: velero.io/v1
      kind: Backup
      metadata:
        annotations:
          velero.io/source-cluster-k8s-gitversion: v1.27.8+4fab27b
          velero.io/source-cluster-k8s-major-version: "1"
          velero.io/source-cluster-k8s-minor-version: "27"
        creationTimestamp: "2024-01-10T06:25:09Z"
        generation: 6
        labels:
          velero.io/storage-location: ts-dpa-1
        name: test-backup
        namespace: openshift-adp
        resourceVersion: "43589"
        uid: 6eed31ea-fbaa-4433-a7a4-bca659b7e792
      spec:
        csiSnapshotTimeout: 10m0s
        defaultVolumesToFsBackup: false
        includedNamespaces:
        - ocp-todolist-mariadb
        itemOperationTimeout: 1h0m0s
        storageLocation: ts-dpa-1
        ttl: 720h0m0s
      status:
        completionTimestamp: "2024-01-10T06:25:40Z"
        csiVolumeSnapshotsAttempted: 1
        csiVolumeSnapshotsCompleted: 1
        expiration: "2024-02-09T06:25:09Z"
        formatVersion: 1.1.0
        phase: Completed
        progress:
          itemsBackedUp: 69
          totalItems: 69
        startTimestamp: "2024-01-10T06:25:10Z"
        version: 1

       

      4. Delete app namespace and trigger restore.
      $ oc get restore test-restore -o yaml

      apiVersion: velero.io/v1
      kind: Restore
      metadata:
        creationTimestamp: "2024-01-10T08:34:51Z"
        generation: 7
        name: test-restore
        namespace: openshift-adp
        resourceVersion: "102826"
        uid: 9650269a-0e2a-4051-b0a0-f04fa8057d41
      spec:
        backupName: test-backup
        excludedResources:
        - nodes
        - events
        - events.events.k8s.io
        - backups.velero.io
        - restores.velero.io
        - resticrepositories.velero.io
        - csinodes.storage.k8s.io
        - volumeattachments.storage.k8s.io
        - backuprepositories.velero.io
        itemOperationTimeout: 1h0m0s
      status:
        completionTimestamp: "2024-01-10T08:35:11Z"
        phase: Completed
        progress:
          itemsRestored: 44
          totalItems: 44
        startTimestamp: "2024-01-10T08:34:51Z"
        warnings: 13

       

      5. Enable Restic on DPA

      apiVersion: oadp.openshift.io/v1alpha1
      kind: DataProtectionApplication
      metadata:
        namespace: openshift-adp
        name: ts-dpa
      spec:
        configuration:
          restic:
            enable: true
          velero:
            defaultPlugins:
            - openshift
            - aws
            - csi
        backupLocations:
          - velero:
              provider: aws
              default: true
              objectStorage:
                bucket: miniobucket
                prefix: velero
              config:
                insecureSkipTLSVerify: 'true'
                profile: minio
                region: minio
                s3ForcePathStyle: 'true'
                s3Url: http://minio-minio.apps.oadp-67130.qe.gcp.devcluster.openshift.com                                       

      6. Trigger a fileSytemBackup with restic

      oc get backup test-backup1 -o yaml
      apiVersion: velero.io/v1
      kind: Backup
      metadata:
        annotations:
          velero.io/source-cluster-k8s-gitversion: v1.27.8+4fab27b
          velero.io/source-cluster-k8s-major-version: "1"
          velero.io/source-cluster-k8s-minor-version: "27"
        creationTimestamp: "2024-01-10T11:46:13Z"
        generation: 6
        labels:
          velero.io/storage-location: ts-dpa-1
        name: test-backup1
        namespace: openshift-adp
        resourceVersion: "192079"
        uid: 2975748f-910c-40cc-97b0-6d171c64cd5e
      spec:
        csiSnapshotTimeout: 10m0s
        defaultVolumesToFsBackup: true
        includedNamespaces:
        - ocp-todolist-mariadb
        itemOperationTimeout: 1h0m0s
        storageLocation: ts-dpa-1
        ttl: 720h0m0s
      status:
        completionTimestamp: "2024-01-10T11:46:20Z"
        expiration: "2024-02-09T11:46:13Z"
        formatVersion: 1.1.0
        phase: Completed
        progress:
          itemsBackedUp: 76
          totalItems: 76
        startTimestamp: "2024-01-10T11:46:13Z"
        version: 1

      7. Delete app namespace and trigger restore.

      Polarion case:- https://polarion.engineering.redhat.com/polarion/redirect/project/OADP/workitem?id=OADP-522

       

      Actual results: 

      Application PVC has a label related to the snapshot. 

      $ oc get pvc -n ocp-todolist-mariadb mysql -o yaml
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        annotations:
          backup.velero.io/must-include-additional-items: "true"
          pv.kubernetes.io/bind-completed: "yes"
          pv.kubernetes.io/bound-by-controller: "yes"
          velero.io/backup-name: test-backup
          velero.io/volume-snapshot-name: velero-mysql-cf26s
          volume.beta.kubernetes.io/storage-provisioner: pd.csi.storage.gke.io
          volume.kubernetes.io/selected-node: oadp-67120-hp4b2-worker-c-mv9db.c.openshift-qe.internal
          volume.kubernetes.io/storage-provisioner: pd.csi.storage.gke.io
        creationTimestamp: "2024-01-10T08:45:05Z"
        finalizers:
        - kubernetes.io/pvc-protection
        labels:
          app: mysql
          backup.velero.io/must-include-additional-items: "true"
          velero.io/backup-name: test-backup1
          velero.io/restore-name: test-restore1
          velero.io/volume-snapshot-name: velero-mysql-cf26s
        name: mysql
        namespace: ocp-todolist-mariadb
        resourceVersion: "108997"
        uid: 031c38c3-c059-47e2-a47d-473a5663c0d3
      spec:
        accessModes:
        - ReadWriteOnce
        dataSource:
          apiGroup: snapshot.storage.k8s.io
          kind: VolumeSnapshot
          name: velero-mysql-cf26s
        dataSourceRef:
          apiGroup: snapshot.storage.k8s.io
          kind: VolumeSnapshot
          name: velero-mysql-cf26s
        resources:
          requests:
            storage: 1Gi
        storageClassName: standard-csi
        volumeMode: Filesystem
        volumeName: pvc-031c38c3-c059-47e2-a47d-473a5663c0d3
      status:
        accessModes:
        - ReadWriteOnce
        capacity:
          storage: 1Gi
        phase: Bound 

       

      Expected results:

      PVC should not have this label after successful fileSystem backup and restore.

       

      Additional info:

            msouzaol Mateus Oliveira
            rhn-support-prajoshi Prasad Joshi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: