Kubernetes persistent volume recovery API with below request URL is no longer supported.

Article: 100052281
Last Published: 2022-02-22
Ratings: 0 0
Product(s): NetBackup & Alta Data Protection

Problem

Kubernetes persistent volume recovery API with below request URL is no longer supported. 

https://{{primaryserver}}/netbackup/recovery/workloads/kubernetes/scenarios/persistent-volumes/recover

Error Message

“Kubernetes persistent-volume recovery API is no longer in use and has been removed from the product due to redesign at NetBackup Kubernetes recovery process. Please follow the instructions in the given link to restore the persistent volume: https://www.veritas.com/content/support/en_US/article.100052281.html” 

API Response sample: 

Cause

On NetBackup 10.0 version, the recovery API for “kubernetes” workload and scenario “persistent-volumes” is removed and not supported. On the previous version of NetBackup this API was used to restore the persistent volume consumed in the namespaces for Kubernetes workload. With the upgraded NetBackup 10.0 version, using the persistent volume recovery API to restore will fail with the above error message.  

Solution

In NetBackup 10.0, we can recover the persistent volumes claims with persistent volumes or just the persistent volumes from the backup image. 

Following are the scenarios of NetBackup REST API: 

Scenario 1: Restoring PV/PVCs from old images created using NetBackup Version 9.1. 

To restore PV/PVCs from older images, refer to the article: 

https://www.veritas.com/content/support/en_US/article.100052280.html 

 

Scenario 2: Restoring from new images created using NetBackup 10.0 

A. Restoring only persistent volumes without the corresponding persistent volume claims 

To restore the PVs without corresponding persistent volume claims, send the HTTP (Hypertext Transfer Protocol) POST request to recovery Api for Kubernetes workload as below curl command example. 

curl --location --request POST 'https://<primaryserver>/netbackup/recovery/workloads/kubernetes/scenarios/namespace/recover ' \ 

--header 'Authorization: {{token}}' \ 

--header 'Accept: application/vnd.netbackup+json;version=7.0' \ 

--header 'Content-Type: application/vnd.netbackup+json;version=7.0' \ 

--data-raw '{   

  "data": {   
    "type": "recoveryRequest",   
    "attributes": {   
      "recoveryPoint": {   
        "backupId": "a17e8921-42d6-4b61-bc80-9dd2632a211c_1642087772",   
        "copyNumber": 1  
      },   
      "recoveryObject": {   
        "destinationNamespace": "kubeinsuranceapp",   
        "includedResources": [   
          "PersistentVolumeClaim", "PersistentVolume"   
        ],   
        "excludedResources": [],   
        "destinationCluster": "OpenshiftK8sCluster.internalserver.com",   
        "includedPersistentVolumeClaims": [   
          {   
            "name": "insurance-pvc1",   
            "size": "10Mi",   
            "pvRestoreOnly": true   
          },   
          {   
            "name": " insurance-pvc2",   
            "size": "20Mi",   
            "pvRestoreOnly": true   
          }  
        ]   
      }   
    }   
  } 
} ' 

 

B. Restoring persistent volume claims with the persistent volumes 

To restore the PVCs with the PVs, send the HTTP POST request to recovery API for Kubernetes workload as below curl command example. 

curl --location --request POST 'https://<primaryserver>/netbackup/recovery/workloads/kubernetes/scenarios/namespace/recover' \ 

--header 'Authorization: {{token}} \ 

--header 'Accept: application/vnd.netbackup+json;version=7.0' \ 

--header 'Content-Type: application/vnd.netbackup+json;version=7.0' \ 

--data-raw '{ 

  "data": { 
    "type": "recoveryRequest", 
    "attributes": { 
      "recoveryPoint": { 
        "backupId": "a17e8921-42d6-4b61-bc80-9dd2632a211c_1642087772", 
        "copyNumber": 1 
      }, 
      "recoveryObject": { 
        "destinationNamespace": "kubeautoinsuranceapp", 
        "includedResources": [ 
          "PersistentVolumeClaim", "PersistentVolume" 
        ], 
        "excludedResources": [], 
        "destinationCluster": "k8scluster.internalserver.com ", 
        "includedPersistentVolumeClaims": [ 
          { 
            "name": " autoinsurance-pvc1", 
            "size": "10Mi", 
            "pvRestoreOnly": false 
          }, 
          { 
            "name": " autoinsurance-pvc2", 
            "size": "20Mi", 
            "pvRestoreOnly": false 
          } 
        ] 
      } 
    } 
  } 
}' 

Note: To get the “copyNumber” parameter value in above request, user can utilize single recovery point API as shown below. 

API Request: 

curl --location -g --request GET 'https://<primaryserver>/netbackup/recovery-point-service/workloads/kubernetes/recovery-points/<backupid>?include=optionalKubernetesRecoveryPointInfo,optionalKubernetesImageGroupInfo'  
--header 'Authorization: {{token}}' \ 
--header 'Accept: application/vnd.netbackup+json;version=7.0' \ 
--header 'Content-Type: application/vnd.netbackup+json;version=7.0' \ 
--data-raw '' 

 

API Response: 

Below is the screenshot for sample API response. The copy number and its corresponding details are provided in the included section under “optionalKubernetesImageGroupInfo” type.    

Was this content helpful?