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

PVC Backup/Restore Not Working on Azure Red Hat OpenShift

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • OADP
    • False
    • Hide

      None

      Show
      None
    • False
    • ToDo
    • 0
    • 0
    • 0
    • None

      Hi,

      I have a number of customers currently using Azure Red Hat OpenShift (ARO) who are interested in using OADP.

      As a Solution Architect, I've been trying to get backup/restore working with ARO in order to demo the functionality for these different Government departments.

      So far, backups "seem" to work, but I have not been able to get PVCs restored.  Any restored pod that requires a PVC gets stuck in "pending" because the PVC is never created properly.

      I've been going back and forth with rhn-engineering-dymurray and tkaovila@redhat.com on Slack to try to debug the issue, but so far we haven't had any luck.  Can you please provide explicit details on how to successfully backup and restore namespaces with PVCs in Azure Red Hat OpenShift.

      The process I used:

      1. Create a SPN with "Contributor" access to my Subscription.
      2. Create the required "credentials-velero" file and secret with the SPN details (subscription ID, tenant ID, client ID, secret, backup RG, etc...)
      3. Create a DataProtectionApplictaion (below)
      4. Create a Backup (below)
      5. Attempt a Restore (below)

      The backup completes, and the restore partially completes - but always stalls/fails on the PVC restore.

      Please advise on the proper config (dpa/backup and SPN config), as this is an important feature for my customers.

      Thanks!

      DPA:
       

      apiVersion: oadp.openshift.io/v1alpha1
      kind: DataProtectionApplication
      metadata:
        name: dpa
        namespace: openshift-adp
      spec:
        configuration:
          velero:
            defaultPlugins:
              - azure
              - openshift
          restic:
            enable: true
        backupLocations:
          - velero:
              config:
                resourceGroup: Velero_Backups
                 storageAccount: velerodxxxxxxx
                 subscriptionId: ea271b60-xxxx-xxxxx-xxxx-422408e476ba
                 storageAccountKeyEnvVar: AZURE_STORAGE_ACCOUNT_ACCESS_KEY
              credential:
                key: cloud
                name: cloud-credentials-azure
                provider: azure
              default: true
              objectStorage:
                bucket: velero
                prefix: velero
        snapshotLocations:
          - velero:
              config:
                resourceGroup: Velero_Backups
                subscriptionId: ea271b60-xxxxxx-xxxxx-422408e476ba
                incremental: "true"
              provider: azure

      Backup:

      apiVersion: velero.io/v1
      kind: Backup
      metadata:
        name: a-backup
        labels:
          velero.io/storage-location: default
        namespace: openshift-adp
      spec:  hooks: {}
        includedNamespaces:
          - testproj
        includeClusterResources: false
        storageLocation: dpa-1
        ttl: 24h0m0s

      Restore:

      apiVersion: velero.io/v1
      kind: Restore
      metadata:
        name: a-restore
        namespace: openshift-adp
      spec:
        backupName: a-backup
         restorePVs: true

      Velero error message on restore:

      time="2022-04-06T19:36:29Z" level=info msg="Getting client for /v1, Kind=PersistentVolumeClaim" logSource="pkg/restore/restore.go:878" restore=openshift-adp/a-restore
      
      time="2022-04-06T19:36:29Z" level=info msg="Executing item action for persistentvolumeclaims" logSource="pkg/restore/restore.go:1159" restore=openshift-adp/a-restore
      
      time="2022-04-06T19:36:29Z" level=info msg="Executing AddPVFromPVCAction" cmd=/velero logSource="pkg/restore/add_pv_from_pvc_action.go:44" pluginName=velero restore=openshift-adp/a-restore
      
      time="2022-04-06T19:36:29Z" level=info msg="Adding PV pvc-ab62c854-112a-44a5-bb73-05da0fa6f091 as an additional item to restore" cmd=/velero logSource="pkg/restore/add_pv_from_pvc_action.go:66" pluginName=velero restore=openshift-adp/a-restore
      
      time="2022-04-06T19:36:29Z" level=warning msg="unable to restore additional item" additionalResource=persistentvolumes additionalResourceName=pvc-ab62c854-112a-44a5-bb73-05da0fa6f091 additionalResourceNamespace= error="stat /tmp/718783699/resources/persistentvolumes/cluster/pvc-ab62c854-112a-44a5-bb73-05da0fa6f091.json: no such file or directory" logSource="pkg/restore/restore.go:1191" restore=openshift-adp/a-restore

              tkaovila@redhat.com Tiger Kaovilai
              rhn-support-apitt Andrew Pitt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: