In a previous article in this series, dedicated to the Proxmox VE hypervisor, we already explained how to backup using built-in tools. This time, we’ll show you how to use the great Veeam® Backup&Replication™ 10 tool for the same purpose.
“Backups clearly are of quantum essence. Until you try to recover from a backup, it’s in superposition. It’s both successful and not”.(quote found on the Internet)
I do not claim this is the perfect way to back up. I cannot recommend it for production. I cannot guarantee the perfect integrity of the backups made this way.
However, it works and is a fine option for many users and beginner system administrators who are just cutting their teeth in virtualization and backup systems.
Table of contents:
Backing up is one of the most crucial processes for the uninterrupted operation of any company. There is nothing more valuable than data stored in corporate information systems, and there is nothing worse than being unable to restore it when something fails.
Oftentimes, the need for backing up and the choice of the right tool for it are considered only after failure with loss of crucial data has happened. As virtualization technologies evolved, backup applications began focusing on close integration with hypervisors. Veeam® Backup&Replication™ is no exception to that, possessing extensive backup capabilities in virtualized environments. Today we’ll show you how to configure it to work with Proxmox VE.
Setting up the hypervisor
We will use Proxmox 6.2.1, the most up-to-date version at the time of writing. It was released on May 12, 2020, and contains many useful changes, which will be discussed in one of the next articles. For now, we will start preparing the hypervisor. Our task at hand is to install Veeam® Agent for Linux on a redundant host with Proxmox. However, before doing that, we will attend to a few other things.
Preparing the system
Let’s install the sudo utility, absent in the system if Proxmox was installed not on an existing Linux system, but as a stand-alone OS from the official image. We will also need the PVE kernel headers. We log on to the server via SSH and add a repository that works without a support subscription (it is not officially recommended for production but contains the packages we need):
echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" >> /etc/apt/sources.list
apt install sudo pve-headers
After this procedure, a server reboot is due.
Installing Veeam® Agent
Download the Veeam® Agent for Linux deb package from the official website (account required), fire up your SFTP client and upload the obtained deb package to the server. Install the package and update the program list in the repositories that the package adds:
dpkg -i veeam-release-deb_1.x.x_amd64.deb
Update the repositories again:
Install the agent itself:
apt install veeam
Check that everything has been installed correctly:
The response should look like this:
veeamsnap, 220.127.116.111, 5.4.41-1-pve, x86_64: installed
Configuring Veeam® Backup&Replication™
Adding a repository
Obviously, you can also store backups directly on a server with Veeam® Backup&Replication™ deployed, but it’s easier to use external storage.
Go to BACKUP INFRASTRUCTURE:
Select Backup Repositories, click the Add Repository button, and in the window that appears, select Network attached storage:
For the sake of example, let’s take a test SMB storage. I’m using regular QNAP:
Fill in the name and description, then click Next:
Enter the address of your SMB repository and, if it requires authorization, click Add to add the access credentials:
Fill in the username and password to access the SMB storage, then click OK and, back in the previous window, Next:
If there are no errors, the program will connect to the storage, request information about available disk space, and display the following dialog box. In this dialog box, set additional parameters (if necessary) and click Next:
In the next window, you can retain all the default settings and click Next:
Make sure that the required components are installed and have the already exists status, and then click the Apply button:
At this point, Veeam® Backup&Replication™ will reconnect to the repository, define the required settings, and create a repository. Click Next:
Check the information summary on the added repository and click Finish:
The program will automatically offer to save its configuration files to a new repository. We do not need this, so reply with a No:
The repository has been successfully added:
Creating a backup job
In the Veeam® Backup&Replication™ main window, click Backup Job — Linux computer. Select the Server type and Managed by backup server mode:
Give a name to the job and optionally add a description. Then click Next:
Next up, we need to add all the servers with Proxmox that we will be backing up. To that end, click Add — Individual computer. Enter the host name or IP address of the server and access details. This way, a Protected computers list is formed. Click Next:
Now we face a very important step, namely the selection of data to be added to the backup. Everything depends on where exactly you have your virtual machines. If you only want to add a logical volume, you need the Volume level backup mode. Specify the path to a logical device, for example, /dev/pve. All other actions are identical.
For the sake of this article, we will show you how the File level backup mode works:
In the next window, form a list of directories to be backed up. Click Add and specify the directories where the configuration files of the virtual machines are stored. The default directory is /etc/pve/nodes/pve/qemu-server/. If you are using not only virtual machines but also LXC, then add the /etc/pve/nodes/pve/lxc/ directory. In my case, it is also the /data directory.
Having thus formed the list of directories, click Next:
In the drop-down list of repositories, select the Storage one we created earlier. Determine the chain length for your incremental backup. The more points there are in Retention policy, the more space you will save. However, this will reduce the reliability of the backup. I personally care more about reliability than storage space, so I have set 4 points. You can use 7, the default value. Continue setting up the job by clicking Next:
Leave the settings unchanged and proceed to the next window:
Set up the scheduler. This is one of the coolest QOL features for a system administrator. In the example, I chose to automatically launch the backup process every day at 2 a.m. Another great feature is the option to interrupt the backup job if the time limit of the backup window has been exceeded. Its exact schedule is generated by the Window button:
Again, for the sake of example, let’s assume we only do backups outside working hours on weekdays, and on weekends we are not limited in time at all. Form a nice table like this, return to the previous window, and click Apply:
All we need to do now is check the summary information on the job and click Finish:
This completes the backup job creation.
Executing the backup
It’s very basic. In the main window, select the created job and click ‘Start’. The system will automatically connect to our server (or several servers), check the availability of storage, and reserve the necessary amount of disk space. Then, the actual backup process will begin, and upon its completion we will be given comprehensive information on the process.
If an issue like Failed to load module [veeamsnap] with parameters [zerosnapdata=1 debuglogging=0] arises during the backup process, you will need to rebuild the veeamsnap module in accordance with the instructions.
Especially interesting is the fact that on the server, we can not only check a list of completed backup jobs, but also watch the process in real time, using the veeam command:
Why my console looks so odd, you ask? I’ll tell you why: I just really like the way the console looks on a
warm, cozy CRT monitor. You can try it out by using the cool-retro-term terminal emulator.
Now comes the most important question. How do we restore the data if something irreversible happens? For example, the wrong virtual machine accidentally gets deleted. Gone for good from Proxmox GUI, and nothing left in the storage where the machine used to be.
Well, the recovery process is not complicated at all. Go to the Proxmox console and enter the following command:
You will see a list of completed backups. Use arrows to select the one you need and press the R key. Then select the recovery point and press Enter:
In a couple of seconds, the restore point will be mounted in the /mnt/backup directory.
All that remains is to copy the virtual drives and configuration files of the virtual machines to where they used to be, after which the “dead” machine will reappear in the Proxmox VE GUI automatically. You will be able to run it the usual way.
You should not try unmounting the recovery point manually, but rather press the U key in the veeam utility.
That will be all.
May the Force be with you!
P.S. This article is based on the instructions posted on the Veeam forum.