How to Backup VMs To A Remote Proxmox Backup Server

final feature image-backup vm on remote Proxmox Backup Server.png

If you are using Proxmox Virtual Environment Solution (PVE), then you may be taking VM backups to local storage, and you may also be using PVE Cluster for the High Availability of your critical VMs. All these services provide redundancy, data retention, and data security but still, your data is always at risk of disasters such as fire, short-circuiting, storage failure, hardware theft, and hacking, etc, So to avoid such disasters it would be a wise approach to backup your critical VMs to a remote Proxmox Backup Server (PBS) facility.

For an Offsite backup, you may choose a block in the next building or another city but how about in another country on the cloud, the caveat with this approach is that you need a high internet bandwidth up/down and the VM size, the bigger the VM size the more bandwidth and time it takes for the first time upload to a remote facility and afterward just the dirty bits of data are transferred but in case of disaster the VM size and the bandwidth become significant again as you will be downloading the full VM to Restore it.

So to start, just decide on an offsite location depending on your internet bandwidth and offsite infrastructure and then install a proxmox backup server and configure it as mentioned in this guide: how-to-install-proxmox-offsite-backup-server-on-aws.

For this tutorial, I am following the above-mentioned guide for installing and configuring a proxmox backup server on AWS EC2 Instance. If you are also choosing a cloud location then I will suggest choosing the nearest location, and specs as per the number of backup jobs.

Assuming that you are done with making an offsite backup server by following my recommended tutorial, let us now connect remote Proxmox Backup Server (PBS) to our Proxmox VE Server.

There are two methods for connecting the remote Backup Server to the Local Proxmox VE server.

  1. Add our remote PBS as storage to Proxmox VE and then backup our VMs directly on this storage.
  2. Install a Local Proxmox Backup Server (PBS) as VM on Proxmox VE (PVE) and connect it to remote PBS.

Add remote Proxmox backup server storage to Proxmox VE

As mentioned in the recommended tutorial, the Proxmox Backup Server uses Datastore to store VMs and Snapshots, so we can add this Datastore as storage in Proxmox VE.

Although this approach sounds to be very easy and handy while it has the following caveats.

  1. This method not recommended for VMs in the running state as they will be Inaccesable or dead slow while the full backup or snapshot.
  2. A very high Internet bandwidth and very low latency is needed.
Caveats Explained

The above-mentioned caveats will not hold if the remote backup server latency is about 5ms or less and high bandwidth is available.

If we have high internet latency and low bandwidth then the running VMs will either stop responding or become dead slow because certain data segments will be locked during the backup process.

So this strategy may not be workable for the running VMs but definitely works for VMs in the Suspended or Stopped mode.

Note:

The method 2 is the recommended for VMs in the running state, and uses backup mode called snapshot, and works effeciently despite high latency and low bandwidth.

This topic shall be covered in the separate article.

Method #1

Adding Proxmox Backup Server Storage to PVE

Now to add the remote Proxmox Backup Server as storage to Proxmox VE, just follow the below-mentioned procedure.

Firstly log in to your Proxmox VE then select Server View –>Datacenter and then Select Storage–> Click Add–>and then Select Proxmox Backup Server as shown in the image.

adding proxmox offsite backup storage to local Proxmox ve server

Once you select Proxmox Backup Server then the following dialog box appears.

Add Proxmox Backup Server Dialog Box

Now fill the form with the following entries:

ID: Type any name, this will appear as the storage name in the PVE left pane.

Server: Type the IP Address of your remote Proxmox Backup Server.

Username: In most cases, it is root@pam, or if you have changed your PBS username to something else then type in that.

Password: The remote PBS password for the user.

Datastore: The name for the remote PBS Datastore that you learned to create in the guide.

Nodes: If you are using a cluster then choose the desired nodes else let it be at default.

Fingerprint: Log in to your remote PBS web Interface then –> Click Dashboard–> from the right pane click Show Fingerprint–> then copy the Fingerprint and paste it here in the Fingerprint section –> then click Add.

Then storage name mentioned in the ID: will be added to PVE.

Here is an example snapshot for you, as it can be seen that storage ID is vmbkp and Type is Proxmox Backup Server and PBS is added as storage in the left pane on PVE.

remote proxmox backup server added as a storage to proxmox virtual environment.

Now that we have the PBS added to PVE it’s time to take backups, for this I have just created a small VM 100 for the test purpose.

Things to Know Before Taking Backup

  • There are three modes of backup.
    • Snapshot
    • Suspend
    • Stop
  • There are two ways to take VM backup.
    • Manual one-time backup
    • The second is scheduled backup.

Here is a brief explanation for these modes: Snapshot offers backup while keeping the VM running, Suspend mode is also applicable on running VMs but it suspends or freezes the VM during the backup operation so that no data can be written to VM while the backup is in process. In the Stop mode, the VM is turned Off manually and then the backup process is started.

Manual Backups

For unscheduled backups, Select VM –> Backup –> Backup now, as shown.

onetime backup on remote pbs storage in pve

So when you click the Backup now button then the following pop-up will be shown.

choosing cloud storage, remote backup server storage. for one time proxmox backup

So choose your Storage to be the remote offsite PBS storage (mine is vmbkp), for Mode choose Stop and then click the Backup button.

starting manual backup in the stop mode PBS

TIP:

Whenever you go for storage type local, it will always do Full Backup for the VM no matter how many times you try to take backup, But if you change the storage to remote PBS storage then it will start doing incremental backups right after you take the first full VM backup, This is also evident from the snapshot as it is not writing any data to the remote storage because 1: A full Backup has already been taken 2: Since the VM is off so there are no dirty/changed bits, as no data is being written.

manual proxmox backup on pbs stoarge in process.

So the first backup might take a long time depending on the VM size (First Backup is always full VM transfer) but after that only the dirty bits will be transferred this is also referred to as incremental backups. The speed of incremental backups also depends on latency and bandwidth for your remote offsite proxmox backup server.

Scheduled Backups To Remote Proxmox Backup Server

It would be a good idea if critical VMs are backed up to our remote backup server on a daily, weekly, or monthly basis in an automatic fashion. We can avail such functionality by creating a backup job, for this select–> Server View –> then select Datacenter –> then select Backup–> then click Add from the right pane as shown in the snapshot.

add a backup job on proxmox pve

Once you click Add then the following pop-up will appear as in the snapshot.

creating a backup job proxmox ve.

Let’s say you would like to create a backup job that backs up VM 100 on daily basis and the backup job starts at 02:00 AM.

Here are the required settings for such a backup schedule as shown in the snapshot.

creating an example schedule for a backup job on proxmox ve

Here is a brief explanation of these settings.

Node: Select your local proxmox ve server from the drop-down list.

Storage: Do not select Local storage only select your Remote Proxmox Backup Storage.

Day of the Week: Select all days from the drop-down list.

StartTime: Choose your desired time such as 02:00 AM from the 24 hr format.

SelectionMode: leave at default & then select the desired VM from the list.

Send email to: Leave it blank for now, as you will need to configure SMTP, POP settings, which is not in the scope of the article.

Compression: It is greyed out and chooses by default ZSTD which is by far the best compression type.

Mode: You can choose the mode to be Stop or Suspend, that is up to you.

Enable: Make sure the Enable check box is selected, otherwise, the job schedule will not execute, on the other hand, you can always disable a backup job by unchecking the box.

After this click Create and your job will be created, furthermore you can start the job immediately by selecting the Run now button.

Full VM backup started on Proxmox VE and its transferred to  Remote Proxmox Backup Server.

As shown in the snapshot the VM job has started and it is being backed up on the remote Proxmox Backup Server storage. Since the VM is in the off state there will be no incremental backups as no data is being written to the VM so you can schedule your backup jobs accordingly.

The incremental backup shall take place if the VM is turned on for a while and then after some usage, it is turned off, then only the changed data is written to remote storage and this data is called dirty-bitmap, while the size of changed data is equal to the size of dirty-bitmap.

There are a few maintenance tasks that are related once you start backing up your VM data to the remote Proxmox Backup Server:

For now, I am sharing links to such tasks and hopefully, I will write about them in separate articles with tutorials.

Related Proxmox Backup Mentenance Tasks

  1. Snapshot Pruning
  2. Garbage Collection
  3. Remote
  4. Sync Jobs
  5. Restore VMs

Leave a Reply

Your email address will not be published. Required fields are marked *