dah85.com

*not* just another blog ;)

Proxmox allows a lot of powerful options when it comes to shared file systems, but nothing could be simpler than using sshfs and adding the directory to Proxmox as a storage option for backups, VMs and ISOs.

In my case, I have 2 Proxmox servers and a 3rd server running Ubuntu which I would like to store backups on.

I my 2 Proxmox servers which are an i5 and an i7 from SerweryDedyKowane.pl which are both hosted on the same network in Poland, and the backup server is an i5 V-Dedi from Wishosting which is hosted in Canada.

Here's what I did:

First, I set up sshfs to point to the storage on the backup server.

In this example, I have set up sshfs on both Proxmox servers. So, on each Proxmox server there is a folder called /mnt/remotebackup which is where I'd like to store my backups.

In the Proxmox UI, we need to click on Datacenter then click on Storage. From there, we need to Add a Directory.

  • I gave mine the ID of remotebackup
  • For Directory, I put in /mnt/remotebackup which if you're following this example, feel free to change to what you're using.
  • For Content, I have selected VZ Dump Backup File which allows me to store backups there. I have not tried using it to store anything else, but I plan to test that out at some stage.
  • Nodes are set to all, Enabled set with a tick, same with Shared.
  • I have set Max Backups to 5, but you can change that as you wish. This is the number of copies of the backup it will keep before it starts deleting the old ones to make room for new ones.

Now that we have that set up, on BOTH Proxmox servers (In my case, it actually copied across by itself so you may only need to do it once, but if not, do it on all the other Proxmox servers) - we can start using the storage.

To verify that backups will work, I will select a VM, and then go to the Backup tab and click on Backup Now - on this screen make sure that Storage is showing the new storage we made, in my case it's called remotebackups

Go ahead an make a backup, it'll take a little while depending on the size of the VM but it will be stored on the remote server.

Neat eh?

Setting up SSHFS

- Posted in Quick Tip by with comments

Today I will be setting up SSHFS, which will allow me to mount a remote folder as a local folder by using SSH.

In this example, I will be creating a folder called remotestorage which will link to a remote folder on a remote server.

First thing we need to do is install SSHFS:

sudo apt update & apt install -y sshfs

Then we need to create the local mount point, just like this:

sudo mkdir /mnt/remotestorage

Now, we can manually mount the remote folder:

sudo sshfs -o allow_other [email protected]:/ /mnt/remotestorage

Log in as requested, and you should be able to see the contents of your remote folder.

If you want to unmount, we just need to do this:

sudo umount /mnt/remotestorage

It's possible to have it automatically mount when the system starts, but it's a bit of a security risk and I wouldn't recommend it.