[SOLVED] Installing PBS inside a VE server

bly

New Member
Mar 15, 2024
20
4
3
Hello, for personal use I am making a configuration with a single VE server hosting everything inside, including the PBS as a VM, and the backup disk connected to it as an external USB3 disk (speed is not a problem, backups are made the night), and have two questions about this:

1) In case of failure of the disk where the PBS is installed, is it correct I can install a new temporary PBS and attach there the backup disk to be able to recover any other involved VM ?

2) the backup job is set up to backup all VMs including the PBS one, it works ok for all VMs but PBS backup fails with timeout errors, is this expected?
(I did installed qemu-guest-agent inside the PBS)

Task viewer: VM/CT 101 - Backup

OutputStatus

Stop

Download
INFO: starting new backup job: vzdump 101 --storage backup --notes-template '{{guestname}}' --remove 0 --notification-mode auto --node pve --mode snapshot
INFO: Starting Backup of VM 101 (qemu)
INFO: Backup started at 2024-07-24 13:42:35
INFO: status = running
INFO: VM Name: backup
INFO: include disk 'virtio0' 'local-lvm:vm-101-disk-1' 32G
INFO: include disk 'efidisk0' 'local-lvm:vm-101-disk-0' 4M
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: creating Proxmox Backup Server archive 'vm/101/2024-07-24T11:42:35Z'
INFO: issuing guest-agent 'fs-freeze' command
INFO: issuing guest-agent 'fs-thaw' command
ERROR: VM 101 qmp command 'backup' failed - backup connect failed: command error: http request timed out
INFO: aborting backup job
INFO: resuming VM again
ERROR: Backup of VM 101 failed - VM 101 qmp command 'backup' failed - backup connect failed: command error: http request timed out
INFO: Failed at 2024-07-24 13:44:37
INFO: Backup job finished with errors
INFO: notified via target `mail-to-root`
TASK ERROR: job errors


TIA for any help!
 
Hey! It's certainly possible to run PBS on your PVE, but there are some caveats. You might want to read this thread for more information.

The reason why your PBS hangs and you get timeout errors is because PVE freezes the VM for a short moment during the backup process. So, while backing up to PBS, PBS gets frozen. That's how you get a timeout. It's recommended to not disable this, as you might get backups with inconsistent filesystems. (See our docs, section 10.2.17. QEMU Guest Agent for more information).

Regarding attaching the backup disk to a different PBS: There's a patch series regarding removable datastores that's being worked on. Once that's out, you could just attach your disk to a different PBS, yes. Alternatively, you should also be able to edit /etc/proxmox-backup/datastore.cfg on the temporary PBS and configure the datastore manually there. If you try to re-configure it via the UI you'll get an error (it wants to create the chunks directory, but fails, IIRC).

You could fore example set up another PBS on bare metal somewhere and configure a sync job that pulls from the PBS VM instead. You would need an extra disk for that (you obviously shouldn't use the same disk for both PBSes in such case, have the other PBS on a different machine), but one of the benefits is is that you'll have local backups that are then periodically synced to your other PBS - your VM backups are therefore stored at two locations at once. Then you don't have to worry about disk failure as much.

Keep in mind that if your backups are encrypted, you'll only be able to access them if you've still got your client encryption key, in case of a disk failure. Be sure to have a backup of that one as well - on a different location, offsite and offline if you really value your data. Otherwise you won't be able to access your backups (with either method) if the disk of your PVE instance dies.

I hope this answers all of your questions!
 
  • Like
Reactions: bly
You should consider the filesystem you are mounting on the USB storage. You want it to be easy to recover.

For one, don't make it part of an LVM. Think about having to re-attach that disk from inside an LVM to another machine. Not fun!

And for another ... There's an easy way! Spin up that vm on a 20gb disk, install PBS, get it going.
Add the larger 'data' virtual disk (stored on the USB drive) later.
Then in PBS GUI go to Storage > ZFS tab, and use the freshly added disk to make the new datastore.

If you need to attach that disk to another PBS in the future, mounting it is so easy.
Code:
zpool import
 
Last edited:
  • Like
Reactions: bly and pmra
... Spin up that vm on a 20gb disk, install PBS, get it going.
Add the larger 'data' virtual disk (stored on the USB drive) later.
Then in PBS GUI go to Storage > ZFS tab, and use the freshly added disk to make the new datastore.
...
Actually, from the Directory tab I created a new one using the attached usb disk, adding it as a datastore. But I take note of the ZFS option you pointed to me :)

To give you the whole picture, I had a separate PBS machine that died a while ago, and until I get a replacement I am running the PBS as a VM inside the pve.
 
  • Like
Reactions: tcabernoch

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!