This command gives users the ability to restore a backup to a 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.

    1. Set the node which the output file should be placed on by replacing <NODE_NAME>, e.g. node1.

    2. Specify the host path of output file by modifying field hostpath of volume disk-directory. By default the directory is /tmp/restore/.

    3. Set the first argument (backup url) by replacing <BACKUP_URL>, e.g. s3://<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, e.g. . The content will be like below:

    4. Set argument output-file by replacing <OUTPUT_FILE>, e.g. volume.raw or volume.qcow2.

    5. Set argument longhorn-version by replacing <LONGHORN_VERSION>, e.g. v1.4.1

    6. Set the S3 Credential Secret by replacing <S3_SECRET_NAME>, e.g. minio-secret.

      • The credential secret can be referenced and must be created in the `longhorn-system’ namespace.
    7. Execute the yaml using e.g.:

    8. Watch the result using:

    After the pod status changed to Completed, you should able to find at e.g. /tmp/restore on the <NODE_NAME>.

    We also provide a script, restore-backup-to-file.sh, to restore a backup. The following parameters should be specified:

    • --output-format: Set the output file format. e.g. raw or qcow2

    • --version: Specifies the version of Longhorn to use. e.g., v1.4.1

    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.

    The output image files can be found in the /tmp/restore folder after the script has finished running.