Proxmox Backup Server: Proxmox VE Integration and Basic Operations
At 11:11 on 11/11/2020, Singles’ Day, Proxmox Server Solutions GmbH released version 1.0.1. Let’s take a closer look at how to use Proxmox Backup Server (PBS) and what it could be used for.
The PBS developers focused on its compatibility and usability with Proxmox VE (PVE). They did their best to simplify the integration process and make all interface elements, as well as the approach to backup management, intuitive for PVE users.
Here is a short but condensed introductory video on the features of Proxmox Backup Server:
First, you need to install Proxmox Backup Server. The installer has not changed since the beta version release.
Note that the system can assemble a ZFS array and immediately install itself in it. There is also an option to select the traditional Linux EXT4 file system.
I would not recommend the XFS option because it has a number of significant drawbacks, such as the inability to reduce the size of the existing file system, and the complexity of data restore in case of failures.
After installing and restarting the system, you can log into the PBS web interface. You should note that you cannot use this interface to perform all actions, as some of them require the use of CLI. Maybe this situation will fundamentally change with the product’s further development.
The Dashboard is quite informative. It displays in real-time useful information on server load, datastore usage, longest tasks over the past 30 days, and running backup tasks.
Updating is key here
To avoid painful errors (such as HTTP Error 404 Not Found: Path ‘/fixed_index’ not found) when creating your backup tasks, make sure to update PVE and PBS to their latest versions. If you have a paid subscription to the Enterprise datastore, you can update the distributions with the following simple command:
apt update && apt full-upgrade
No subscription? No problem. You can create a ‘no-subscription’ datastore in the system and use it for updates.
Transform the line of the paid datastore into a comment by using the # symbol and add the following line.
For Proxmox Backup Server:
deb http://download.proxmox.com/debian/pbs buster pbs-no-subscription
For Proxmox Virtual Environment:
deb http://download.proxmox.com/debian/pve buster pve-no-subscription
Press Ctrl + X to exit and select y. Now, you can use the above command to update the packages and start PBS integration.
Adding PBS to Proxmox VE
Before adding a backup server to Proxmox VE, you need to take a number of preliminary steps on the Proxmox Backup Server.
Before proceeding to backups, you must first set access permissions. We recommend that you open Configuration — Access Control and create users for the datastore. As a demo, we created a test@pbs user to test the connection. Note that the ‘@pbs’ part of the user name is mandatory, otherwise, the system will display an incorrect data entry error message.
Now, let’s move on to creating the required datastores (in PBS, the term ‘datastore’ means a repository). This enables the system administrator to clearly distribute backups according to the selected criteria and grant access permissions. To create a datastore, we need a directory located on a mounted disk.
Creating a datastore and granting access permissions
Go to Administration — Storage / Disks. Select the desired disk and initialize it by clicking Initialize Disk with GPT. Now, go to Directory — Create:Directory and create a directory for storing data. Here, specify the name of the datastore and the absolute path to the created directory. If you check the Add as Datastore box, then the new datastore will immediately be connected as a data storage entity.
All you have to do now is to specify the users with access to this datastore and their access level. To do this, click the name of the created datastore, go to Permissions and click Add — User Permission. Select the desired user and their role, then click Add to confirm. This completes the preliminary preparation.
Saving the Server’s Fingerprint
By default, PBS comes with a self-signed SSL certificate. To establish a trusted connection between the PBS client and server in the future, its fingerprint must be read and saved for later use.
Go to Administration — Shell and take the server’s fingerprint:
proxmox-backup-manager cert info | grep Fingerprint
In response to the command, the server will return a line similar to this example:
Fingerprint (sha256): bb:fb:13:0f:f7:59:df:32:f0:bf:70:38:22:f8:22:93:05:2f:22:80:bc:71:07:cc:8d:1f:6e:f8:0f:da:bf:73
In the future, you can use this fingerprint to establish a connection.
Adding a Server as a Storage
You can add a storage either directly from the Proxmox VE web interface (Datacenter — Storage — Add) or manually. We will use the console and go through the following steps. To add a datastore, use the following command:
pvesm add pbs PVE_STORAGE_NAME — server PBS_SERVER_ADDRESS — datastore STORAGE_NAME
Let’s have a closer look at what this command actually does:
- pvesm add pbs — adding a storage;
- PVE_STORAGE_NAME — this name will be displayed in the PVE web interface and may differ from the storage name;
- --server PBS_SERVER_ADDRESS — specify the hostname or IP address of the PBS server (if necessary, you can specify another connection port via --port);
- --datastore STORAGE_NAME — specify here the name of the existing datastore on the PBS server.
pvesm set PVE_STORAGE_NAME --username test@pbs --password PASSWORD
Everything here is also logical. We need to specify the details for connecting to the storage. This is why we created a user earlier and granted access permissions. Now, to establish a trusted connection, we just need to register the server fingerprint.
pvesm set PVE_STORAGE_NAME — fingerprint
After performing these steps, we will see our storage in the list of virtual machines and container backups available for storing data, as well as usage statistics. It’s time to make the first backup.
LXC Container Backup
For the test, we used a standard template to create and launch a CT100 container with a running Ubuntu 16.04 operating system. Next, go to Backup, select the desired Storage, and click Backup Now. Select the backup type (you can read more about it in one of our previous posts) and make a backup.
When we go to the PBS server, we can also see information on the completed backup task.
Restoring a Container
Making a backup is only half the battle. It is much more important to use it for restoring the system. Let’s remove our LXC container from Ubuntu and try a restore procedure. To do this in the PVE web interface, go to Storage and then to Content, and select the backup file.
For the container to be restored, select the location, new ID (by default, this will be the same as at the time of the backup), as well as the data read limit. This will make it possible to avoid overloading the input channel of the virtualization server. Click Restore and start the container.
The container has been successfully restored. On our testbed, the backup procedure took just over 9 seconds and the restore procedure was completed in 14 seconds. The speed depends on selected options and the characteristics of both servers.
Virtual Machine Backup
The procedure for backing up a full-blown virtual machine is no different from the one used for backing up a container, except that it takes more time. For our test, we created a machine with ID 100 and deployed Ubuntu 16.04, and made a backup.
This looked like this on the Proxmox Backup Server side:
As in the case of the container, the restore procedure is quick and easy. Specify the backup, where to deploy it and whether you want to run the machine after the procedure is completed.
Data Backup from any Linux Host
It was announced that, in addition to virtual machines and containers, Proxmox Backup Server can entirely back up any Linux host. Let’s test this in practice. We will use the same PBS server. To run the test correctly, we need to perform a number of additional steps on the host that we want to back up in order to install the agent called ‘proxmox-backup-client’. As a test machine, we will use a computer with the same Ubuntu 16.04.
Ubuntu does not have ‘proxmox-backup-client’ utility in its datastores. So, we will start by adding 3 datastores. Two of them are needed in order to resolve the utility’s dependencies, and another one contains the required client:
sudo nano /etc/apt/sources.list
Add the following lines to the end:
deb http://ftp.debian.org/debian buster main contrib
deb http://ftp.debian.org/debian buster-updates main contrib
deb http://download.proxmox.com/debian/pbs buster pbs-no-subscription
Exit the editor by pressing Ctrl + X and select y when prompted to save data. Extract and install the keys of the datastores:
sudo apt-key adv — recv-keys — keyserver keyserver.ubuntu.com 7BF2812E8A6E88E0sudo apt-key adv — recv-keys — keyserver keyserver.ubuntu.com 04EE7237B7D453ECsudo apt-key adv — recv-keys — keyserver keyserver.ubuntu.com DCC9EFBF77E11517
Update the list of application sources:
sudo apt update
Install the backup client:
sudo apt install proxmox-backup-client
Now, we only have to perform the backup. In this example, we will back up the root directory of our test machine:
sudo proxmox-backup-client backup root.pxar:/ — repository PBS_IP_ADDRESS:DATASTORE_NAME
Restoring Individual Files from a Backup
Often, there is no need to restore all data, as you just want to extract a specific file or directory. You can do this in two clicks directly from the PBS web interface:
Proxmox Backup Server is the missing piece of the puzzle for creating a comprehensive enterprise-level virtualization environment. Once you configure the backup schedule, you can be sure that virtual machines or containers will not be lost, for example, in case of storage media failure. It is now simple to restore them, with hardly any hassle. You mount a new host, add a datastore and start the restore.
In addition, the developers are actively expanding the capabilities of their software and do not leave users to ‘their own devices’. They publish well-written documentation and provide assistance within the community forum.