Here we are at the final stage with the Veeam Backup & Replication overview series touching upon different components and their configurations. In this article we’ll review the steps on how to create a Linux Backup Repository Server.
There are many advantages on why and how we should leverage Linux as a Backup Repository for Veeam Backups. First and probably the easiest is the opportunity to leverage heterogeneous hardware running different Linux distributions. This can be a combination of commercial and free releases. In both cases we can take advantage of the storage managed by these boxes to further extend the available space for Backups Jobs and Backup Copy Jobs.
More importantly from a security perspective by leveraging multiple and different file-system types we can simply harden our Backup infrastructure. This is very important to help achieving the widely adopted 3-2-1 rule and protecting against ransomware. Challenging attackers with different file-systems also by using different or separate mechanisms of authentication is definitely making their job harder.
In particular we’ll review the options to configure storage on a Ubuntu Linux as Veeam Backup Repository. Depending on resources available there are three types of storage we can leverage on a Linux server as Backup Repository: Local Storage, directly attached and NFS Shares.
For the purpose of this article we’ll point to a local folder on the main Disk. Additionally it is possible to provide more storage by mean of adding new virtual Disks to the same Linux box and configure them as a Linux backup Repository. Alternatively we can also choose NFS Shares directly mounted to the Linux box as a Linux Backup Repository as well.
We’ll run this configuration in three simple steps, in particular we need to:
- Install the minimum prerequisites on the Linux machine
- Add Linux box to the List of Veeam Managed Servers
- Configure the Linux Backup Repository
Let’s get started with the first step about the prerequisites.
Linux Backup Repository install prerequisites
There are essentially 3 main prerequisites we need to make sure are present in our Linux server: SSH server, Perl Modules and a User part of sudoers file that Veeam will use to connect to and manage the Linux Backup Repository.
So in this case let’s start with the SSH Server. The majority of Linux distribution ship with a built-in software repository nowadays. And this is the case also for Ubuntu Linux with “apt-get”. We’ll use this one to easily install the required components starting from the SSH server.
From the Terminal let’s issue the command:
sudo apt-get install openssh-server
Apt-get will scan it’s own repository to check for the latest version and pertinent dependencies. When ready we can simply hit “y” to continue.
The installation won’t take long. Actually a matter of a few seconds or a few minutes depending on the missing requirements and internet connection. When the installation completes we can check if the SSH Server demon or service is up and running.
To check the status simply issue the command:
sudo service ssh status
The screenshot below should show something similar to this.
The previous screen also indicates the SSH server is running on default Network Port 22. To check connectivity to this Server and Port and more simply to this network socket as IPAddress plus Port we can launch a telnet command prompt from a Windows machine. In this case we can start this command from the Veeam Backup & Replication Server. The screenshot below shows a quick example.
As we can tell from this screen the port is open and the connection to the SSH Server possible. This is also useful to quickly rule out or adjust firewall rules.
At this point we can stop the connection test by hitting “enter” or simply closing the command window.
The next prerequisite refers to the installation of Perl Modules. In order to work for a Linux Backup Repository it is important the Linux machine is running on a 32Bit system. Should the server run on a 64Bit system we than need to install Perl modules in 32Bit compatibility mode. The following is the full list of Perl Modules to install:
- constant
- Carp
- Cwd
- Data::Dumper
- Encode
- Encode::Alias
- Encode::Config
- Encode::Encoding
- Encode::MIME::Name
- Exporter
- Exporter::Heavy
- File::Path
- File::Spec
- File::Spec::Unix
- File::Temp
- List::Util
- Scalar::Util
- Socket
- Storable
- threads
All we have to do is just issue the command as per screenshot below:
sudo cpan constant Carp Cwd Data::Dumper Encode Encode::Alias Encode::Config Encode::Encoding Encode::MIME::Name Exporter Exporter::Heavy File:::Path File::Spec File::Spec::Unix File::temp List::Util Scalar::Util Socket Storable threads
Unless we prefer to configure them manually we can simply accept the default configuration. Let’s hit yes to continue.
Last step in terms of prerequisites is to add a User we intend Veeam to use to help configuring and managing the target storage as Linux Backup Repository. We can do this by manually adding the entry in the sudoers file. In my example this looks like the screenshot below. By running the command:
sudo visudo
we can add a line similar to the following:
username ALL=() NOPASSWD: ALL
replacing the username with the intended user. Finally a CTR+O to save the file and CTRL+X to exit the editor.
Add Linux as Veeam Managed Server
The next step is to add the Linux machine in the list of Veeam “Managed Servers”. This machine will simply control and give access to the Backup Repository. The Veeam Backup & Replication Server instead will communicate with the Linux machine using the SSH protocol on port 22.
As per usual from the main menu on the Backup Infrastructure view in the console let’s add a new Managed Server. From the wizard we’ll select the Linux Server type.
Next we specify the Hostname of the Linux machine. I would recommend to use static IP addresses for such server as best practices. Also let’s make sure DNS name resolutions is working both ways also when using FQDN names.
Next we specify the credentials to connect over SSH to the Linux machine. In case this user account does not exist yet we can click on Add button and create this on the fly. From here we can also choose a different Network Port for SSH to use if desired. Of course let’s make sure the SSH Daemon is set up accordingly.
We can now specify the Credentials to use. We need to elevate the account to root but we don’t need to add this account to sudoers file automatically as already there.
At this point the wizard will try the connection with the intended user. If everything is in place we need to accept the SSH key fingerprint. And yes, we do trust this server! 🙂
The wizard now shows a quick summary before committing the changes.
Configure Veeam Repository Server
We are now ready for the final step: Configure the Linux Backup Repository Server.
From the Backup Infrastracture view let’s add a new Backup Repository and specify a name with a description. The latter is optional.
In the server type let’s choose Linus as indicated in the screenshot as well. In our case the Backup Repository will use internal storage.
At this point the wizard will show in the drop-down all the compatible Managed Servers based on our previous selection.
When clicking on Populate this will show the Disk and Partitions layout with mount points. Should this phase take a long time or not appear at all this means the prerequisites are not working as expected. In the case of a 64Bit Linux machine let’s make sure Perl is installed with 32Bit compatibility mode. Let’s click on next to specify the storage to use.
At this point we can browse to the intended location for the Linux Backup Repository.
In my case this is a folder under my profile. I will use this as test. When setting up a Backup Repository of course we can also configure other settings like the number of concurrent tasks, which is based on current number of CPUs on the Backup Repository server and also limit the Read/Write data rates should we desire to slow down Veeam Backup and Restore activities.
The Advanced options give us the opportunity to enable finer settings like:
- Align Backup file data blocks
- Decompress Backup Data Blocks before storing
- Specify the Repository as using Rotated Drives
- Use per-VM Backup files
Depending on the underlying storage we can further optimise the Backup Jobs using these options.
In this steps we can specify which machine with the Veeam Mount server role we want to use when running Restore Jobs which leverage the vPower NFS as well to run such jobs like Instant VM Recovery, SureBackup and OnDemand Sandbox. We’ll dedicate specific articles to cover these topics.
And finally a review of the main settings before applying for the updates as per screenshot below. As part of the wizard when creating a new Backup Repository we can also import existing Backups and pertinent File-System Index files if in use.
When clicking apply we can see the summary of operations relative to the installation of the required components. The operation is very fast.
And finally when browsing the Backup Repository list we can see the Linux Backup Repository we just added and ready to use to store our Backup Jobs and Backup Copy Jobs.
This concludes a quick series of articles on the Veeam Backup & Replication overview. We can now use this one as a base for testing in our home lab. In my case this will also be the foundation to add more infrastructure components and run even more jobs types to explore all the benefits and features packed in this solution.
I hope this series was informative and I’m happy to come back to comments and feedback.
Hi,
could you give me a hint about how to install perl in 32 bit compatibility mode?
Regards, Peter
Hi Peter,
personally, I haven’t tried this myself yet. I guess It might be the case of exposing the perl modules and binaries to a 32Bit path as well. Have you tried a google search first? I guess different linux distros might have different setups. Sorry for not being of more help here. Otherwise installing a 32Bit version of the Linux OS on a new VM would be a lot quicker and not really resource intensive. 32Bit won’t use more than 4GB of RAM. Thanks Michele
using Debian 9.8 New install..
Missing a few items / steps.. for CPAN install to work…
default install has perl but cpan isn’t current…
Way that seemed to work via https://stackoverflow.com/questions/19677296/how-to-update-cpan-perl-module:
kuz1@banana:~$ sudo perl -MCPAN -e shell
cpan[1]> install CPAN
cpan[2]> reload cpan
# install python3 and dev headers
sudo apt-get install -y python3 python3-dev
# pip is great
sudo apt-get install -y python-pip
still possibly missing a couple of dependencies… but runs much better…
I ran this after I got cpan big install line to run.. and it updated everything again…
perl -MCPAN -e “upgrade /(.\*)/”
found that on:
https://stackoverflow.com/questions/3727795/how-do-i-update-all-my-cpan-modules-to-their-latest-versions
will see if it broke something or not later…
Currently working..
having to remove a ton of old bad backups before I can effectively backup to the target but so far it looks promising..
not all modules in perl were correct but it appears to be able to connect and see the repo…
will be testing in a bit after I delete a ton of backups from old repo and then set new repo for existing job…
maybe a crazy use case, but can i use one linux repository proxy vm for two veeam B&R servers, if i want to make backup copy job to this together used repository.
Hi Hannes,
thanks for your question. Backup Proxies can be associated to one VBR server at a time. I’m not sure I understand the use of a secondary VBR with a Backup Copy use case. If the first VBR is not available, all backup data can be imported onto a new VBR and use this to run the restores. Hope this helps.
Thanks,
Michele
Great! Works perfect for me! Thank you!
Thanks Vitor! Glad it worked. More is coming with latest Veeam support for Linux XFS and Hardened Repositories!