Skip to content

Backing up Proxmox

Introduction

Here's a cool thing. Proxmox (like most hypervisors) stores virtual machines and containers as block level storage on top of another filing system (ZFS by default in this case). This lets proxmox do something cool: block level snapshots!

What's block level snapshots? Well, among other things, it lets us do super easy backups.

Requirements

  • A Secondary Proxmox Server

TL;DR

In this guide, we will:

  • Set up a 2 node cluster
  • Configure backups
  • Pat ourselves on the back

Backing up with Proxmox

Proxmox has a very robust set of backup options, depending on how you want to configure. You can configure to back up at a storage level, VM level, or even run a dedicated backup server.

proxmox-backup-server would be the preference if you can afford a dedicated backup server. It's easy, works great, and can be the target of multiple proxmox clusters.

However, let's assume we don't want to dedicate a whole device just to store backups. What else can we do? A second proxmox server!

Setting up the Second Proxmox Server

Well let's not step through that again, you can just refer to the first part of my guide. Get your second server on proxmox! Just follow the first two sections over again, with a unique name and IP.

Joining a Cluster

A cluster is just a fancy term for managing multiple cooperating devices from a single console. Sounds good now that we have two of them. Proxmox makes creating a cluster easy:

  • On your first server, go to the Datacenter view and choose a cluster. Create a cluster.

  • Copy out the join information

  • on your second proxmox server, log in and choose join cluster. Add in your encoded information and the first server's root password.

  • Now, it doesn't matter if you go to your first or second server. You can manage both of them from either console!

Enabling a Backup Server

Now if you aren't concerned about retention, you don't actually have to enable backups at all. Instead, you can use the replication feature of proxmox to clone VMs and containers from one device to the other. It's not really a backup though, as it also means deletions are also replicated across.

So let's do something cheeky. Let's install proxmox backup server on the second proxmox server! Then we can use it for both virtualization and backups.

Warning

The obvious downside to this is that if your relying proxmox server goes down, your backup server also goes down. As such it's always recommended to back up to a different destination. Which means if you plan to do this 2-in-1 config, you should do it bidirectionally (IE: VMs on the second proxmox server get backed up to the first proxmox server, and visa versa).

  • In the Shell of the new proxmox server, run the following:
echo "deb http://download.proxmox.com/debian/pbs bullseye pbs-no-subscription" > /etc/apt/sources.list.d/pbs.list
apt-get update
apt-get install -y proxmox-backup-server

  • Access the backup management interface at https://<your-second-server-ip>:8007

  • Turn off the enterprise repo (it doesn't work without a subscription anyway) under Administration

  • Create a new datastore under datastore. Give it a name of default and a backing path of /rpool/backup

Info

Feel free to clean up your prune options in the other tab as well. Default is "keep everything", where something more appropriate like "keep 7 daily, 4 weekly, 3 monthly might be better"

  • Back on the main screen, copy out the Fingerprint

  • Let's go back to the cluster configuration for proxmox. under Storage add a new Proxmox Backup Server. Set the ID to whatever you want (cbserv02 to make it easy to identify), set the server IP, use the second proxmox server credentials, and set the datastore to default. Copy in the Fingerprint and add

Using Backups

Woof, it's a bit of effort to get the backup server running. But now it's super easy to use!

  • On the backup section of the datacenter view, add a backup with:
  • The cbserv03 node
  • A schedule of every 2 hours
  • Choose all of the VMs/Containers

aaaaand that's it! Now all of your containers and VMs on your first server automatically back up to your second server! Coooool.

Info

If you start making VMs and containers on your second server, you would want to install proxmox backup server on your first server and repeat the process. That way both back up to eachother!

Proxmox backup is also crazy efficient:

3GB used to backup a full VM and container.

What's a backup without a restore

So how hard is it to restore a VM backed up this way? About 3 clicks! Doesn't even have to be to the same server:

You can even restore invidividual files and folders!!

But What about my direct attached hard-drive?

One thing to be aware of is we explicity excluded the hard-drive attached to our NAS from backups and replication. This is working under the assumption that there is too much data there to conveniently back up. Just to be aware.

That's all Folks

With that, we have all the tools we need to start setting up a docker infrastructure, LXC infrastructure, more proxmox servers, a windows VM if we're feeling sadistic, whatever we like!