Recover from a SUSE® Storage Backup without the System Installed
This command gives users the ability to restore a backup to a raw image or a qcow2 image. If the backup is based on a backing file, users should provide the backing file as a qcow2 image with --backing file parameter.
-
Copy the yaml template: Make a copy of
examples/restore_to_file.yaml.template, for examplerestore.yaml. -
Set the node which the output file should be placed on by replacing
<NODE_NAME>, for examplenode1. -
Specify the host path of output file by modifying field
hostpathof volumedisk-directory. By default the directory is/tmp/restore/. -
Set the first argument (backup url) by replacing
<BACKUP_URL>, for examples3://<your-bucket-name>@<your-aws-region>/backupstore?backup=<backup-name>&volume=<volume-name>.-
<backup-name>and<volume-name>can be retrieved from backup.cfg stored in the backup destination folder, for examplebackup_backup-72bcbdad913546cf.cfg. The content will be like below:{"Name":"backup-72bcbdad913546cf","VolumeName":"volume_1","SnapshotName":"79758033-a670-4724-906f-41921f53c475"}
-
-
Set argument
output-fileby replacing<OUTPUT_FILE>, for examplevolume.raworvolume.qcow2. -
Set argument
output-formatby replacing<OUTPUT_FORMAT>. The supported options areraworqcow2. -
Set argument
longhorn-versionby replacing<LONGHORN_VERSION>, for example,v1.11.2 -
Set the S3 Credential Secret by replacing
<S3_SECRET_NAME>, for exampleminio-secret.-
The credential secret can be referenced here and must be created in the
longhorn-systemnamespace.
-
-
Execute the yaml using:
kubectl create -f restore.yaml -
Watch the result using:
kubectl -n longhorn-system get pod restore-to-file -wAfter the pod status changed to
Completed, you should able to find<OUTPUT_FILE>at/tmp/restoreon the<NODE_NAME>.
We also provide a script, restore-backup-to-file.sh, to restore a backup. The following parameters should be specified:
-
--backup-url: Specifies the backups S3/NFS URL. For example,s3://backupbucket@us-east-1/backupstore?backup=backup-bd326da2c4414b02&volume=volumeexamplename" -
--output-file: Set the output file name. For example,volume.raw -
--output-format: Set the output file format. For example,raworqcow2 -
--version: Specifies the version of SUSE Storage to use. For example,v1.11.2
Optional parameters can be specified:
-
--aws-access-key: Specifies AWS credentials access key if backups is S3. -
--aws-secret-access-key: Specifies AWS credentials access secret key if backups is S3. -
--backing-file: backing image. For example,/tmp/backingfile.qcow2
The output image files can be found in the /tmp/restore folder after the script has finished running.