Easily achieve a 3-2-1-1 policy by copying Zmanda Pro Storage vault contents to tape.
Introduction
This guide will show you how to make a secondary copy of Zmanda Pro storage vaults on tape.
This strategy can create air-gapped and offsite backups, helping you achieve higher data resilience.
The general process is as follows:
Data can be backed up from the sources to disk using a variety of methods including:
- FTP/SFTP
- Local Path (including mounted NFS or SMB)
- SMB
- Local S3-Compatible Interfaces
The restore workflow will also be described in this document.
A few important notes:
- Zmanda Pro does NOT store an index of which tapes are used for a given copy job, nor is it aware of which tapes have data on them already. In other words, you are responsible for maintaining a record of which tapes to rotate in and out and for ensuring you do not overwrite critical data on your tapes.
- This page gives basic usage information for the script described in this KB article.
Configuration
You must install the agent on your storage host device and create a special protected item whose purpose is to trigger the copy job on a customizable schedule. The protected item does not back up any data.
In essence, Zmanda is used as the scheduling tool to run the commands, record logs, and send status notifications. A similar outcome could be achieved by using a cron job (which you are welcome to do).
Prerequisites for the Storage Host
- See this document for script dependencies
- Zmanda Pro Agent installed. Click here for a list of compatible operating systems.
- Note: This script has only been tested with Linux-based OSs. Windows is currently unsupported.
- Script extracted. Click Here to Download (tape_span.tar.gz) - sha256 Checksum: b3ca3a9e26963800504877ffd6394aa6c0e73dae02d86f26575ba08192224968
- The host must have connectivity to the tape library and disk storage device where the storage vaults are located.
- A dedicated Zmanda Pro user should be created, and the device should be registered to the user.
- Identify the path where the storage vaults are configured to send data. This may be any path, including local paths, paths to the root directory of SFTP shares, paths to the root directory of locally hosted S3-compatible storage, and so on.
- In this example, we use an SFTP share and will use the root of that share for the path.
Steps
- Create a storage vault for the backup user. First, create the path on the storage host device. Then create the vault in the Zmanda Pro UI.
No data will be stored here, but this is a required step for the backup job to run. (Example: /var/lib/ZmandaPro/blank_repo) - Create a new Files/Folders protected item and name it appropriately
- Select an empty directory or file for backup. (You can leave this section completely blank, but a "No paths selected for backup" error will occur)
- Create an After task command and add the following:
-
cd <path to tape_span directory> && sudo python3 multi_tape_backup.py <volume/tape size in MB> <path to source> <tape library device> <tape drive device> <drive number>
-
- Configure your desired schedule
- Name the schedule, select the storage vault created in Step 1, and make sure to check the boxes as shown below:
- Configure the schedule as desired. An example weekly schedule is shown below:
- Name the schedule, select the storage vault created in Step 1, and make sure to check the boxes as shown below:
- The backups will begin to run on the set schedule.
Sample Output
The jobs will run on schedule and finish with a Warning, but this is normal.
The used tapes will be shown in the logs, including the storage element number and tape label.
Here's a still screenshot if the gif is hard to see:
Email Notifications
You may want to enable email notifications for the copy job. You can do so by creating an "Immediate Job Notification". The job logs will be included in the email.
Restoring Data
On a high level, recovery is a two-step process:
- Recover the storage vault from tape to disk
- Recover from disk using Zmanda Pro
For immediate support or questions, please contact support@zmanda.com
Step 1 - Recovery from tape to disk
Prerequisites
- The tapes with the data to be restored must be in the library (if using a library to do the restore)
- You can use any drive (even standalone) if the LTO number matches that of the tapes
- Put the first tape in the desired drive (mtx load command if using a library)
- Run
tar -xvMf <tape drive> -C <optional output directory>
- Note: The "-C" flag and output directory are optional. If blank, data will be restored to the current working directory
- When prompted, unload the current tape and load the next tape. THIS MUST BE DONE IN THE SAME ORDER THAT THE TAPES WERE USED. Pay attention to the labels. You can find the order from the output of the backup job (See example output above).
- The restore should complete automatically, and all you must do is switch the tapes (this will require opening two terminals on the same system if using a tape library)
We are currently working on a script that switches the tapes automatically. Contact sales@zmanda.com for status. Only supported with tape libraries and NOT standalone drives.
Step 2 - Complete the recovery using Zmanda Pro
Once the storage vault contents are recovered from the tape, you must perform the following steps:
- Ensure the storage vault contents are in the expected location. To find the expected location, go to the Storage Vault page of the user that you are restoring data for. For example, if you extract the tape library contents to /home/support and your storage vault expects the data to be inside /var/lib/backups/repo1 as shown below, you must move the data to that location. Alternatively, you may point the storage vault to the new path /home/support
- If you used a different storage vault type such as SFTP or local S3-compatible storage, you will be responsible for replacing the data in the correct location.
- Once the storage vault contents have been replaced, you can continue with the regular restore workflow using the Zmanda Pro management UI.