Kubernetes restore operation fails for the older images which were created using NetBackup 9.1 version.

Kubernetes restore operation fails for the older images which were created using NetBackup 9.1 version.

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

Problem

Kubernetes restore operation fails for the older images which were created using NetBackup 9.1 version. 

Error Message

NetBackup Administrator Web UI Error message:  

“Restore operation is not supported on the backup images of NetBackup version older than 10.0.” 

 

API Error message: “The restore of Kubernetes images taken by NetBackup 9.1 is not supported. To restore an old version of Kubernetes images, please follow the instructions given in the link: https://www.veritas.com/support/en_US/article.100052280.html” 

Cause

An error occurs when you try to perform a restore operation on the NetBackup 10.0 version using the images which were captured using the older version of NetBackup. NetBackup 10.0 version does not support restore operation using the images of older NetBackup versions due to a redesign in the restore workflow. Hence, it gives an error and the restore operation fails.

Solution

Restore the older image using Velero commands. Velero is a pre-requisite on the cluster. Please download the Velero CLI or use the one within Velero pod running in the Kubernetes Cluster. For. e.g. 

kubectl exec <velero-pod-name> -n <namespace> -it -- ./velero get backups 

  

Get the backup name of the image which required to be restored and use it in Velero commands to restore it. 

Below are the steps to get the backup name for images: 

  1. Download & import the attached Postman collection (v2.1) into Postman. (This Postman Script will only work with NetBackup Version >= 10.0) 

  2. To import downloaded collection into Postman, click on the file tab and then click import. 

 

  1. Click on “Upload Files” button as highlighted below. 

 

  1. Choose the “K8s_Imagev9.1_GetBackupNames.postman_collection.json” file (downloaded in step 1) to import and press open. Postman will automatically import the item. 

  1. Below will be the view of Postman after importing the Json file. You can see the collection name as “K8s_Imagev9.1_GetBackupName.postman_collection.json”, then can check collection variables and documentation details for the Postman script. 

 

  1. Before running the collection, Pre-requisite of test script is to set userid and password (through which user usually login into NetBackup WebuI) into request body and below 4 collection variables into the Postman. When the user imports this Json file, the collection variables also get imported. 

    a. primaryserver - name of the NetBackup Primary Server where UI/API is running. 
    b. resourceName - name of the namespace to filter e.g., “kube-public”. This parameter is optional. If left it blank, then script will find the backup names for all the older 9.1 images for all the available namespaces within the date and time range below. 
    c. backpupFilterStartDateTime - yyyy-mm-ddThh:mm:ss.SSSZ formatted filter backup from date to filter all backups 
    d. backpupFilterEndDateTime - yyyy-mm-ddThh:mm:ss.SSSZ formatted filter backup end date to filter all backups 
  2. Once user set above values into Postman collection, user can run the collection by clicking on “run” button as shown in below screenshot. 

 

 

  1. Below screenshot shows the sample result which contains the backup name of image created by NetBackup Version 9.1. 

Run the Velero command with backup name to restore it into targeted namespace. Below are some sample commands and scenarios. 

Scenario 1: Restore into same namespace 

  • velero get backup (To fetch all available backup) 

NAME STATUS CREATED EXPIRES STORAGELOCATION SELECTOR
{{mybackupname}} Completed 2021-12-01 09:29:27 +0200 CEST 12d default <none>
 
  • velero backup describe {{mybackupname}} --details (To fetch backup/resource details)  

  • velero restore create --from-backup {{mybackupname}} (To restore the backup) 

Restore request "{{mybackupname}} -20211201123523" submitted successfully.    

Run velero restore logs {{mybackupname}}-20211201123523" for more details. 

  • velero restore logs {{mybackupname}}-20211201123523 (To check the restore operation logs) 

Scenario 2: Restore into different namespace 

  • To perform alternate location restore, provide option --namespace-mappings <backed-up-namespace>:<restore-namespace> to the restore command 

  • Create a restore named "restore-2" from backup “{{mybackupname}}”. Below is the full command to restore kubeapp1 namespace into kubeapp2 namespace. 

velero restore create restore-2 --from-backup {{mybackupname}} --namespace-mappings kubeapp1:kubeapp2 

Scenario 3: Restore only persistentvolumeclaims and persistentvolumes  

  • Create a restore for only persistentvolumeclaims and persistentvolumes within a backup 

    velero restore create --from-backup {{mybackupname}} --include-resources persistentvolumeclaims,persistentvolumes 

 

For more details about velero commands, please refer: Velero documentation - Restore 

Was this content helpful?