How to handle datastore on NFS share that is offline most of the time?

Dunuin

Distinguished Member
Jun 30, 2020
14,793
4,630
258
Germany
Hi,

Right now I got a single PBS-VM1 on Host2 that got its datastore from Host2 via NFS. And this PBS-VM1 and NFS share is available all the time.

Problem is that I can't backup Host2 or guests on it, because if Host2 fails there would be no running PBS to restore them from.

I also got Host1 that is running PVE 24/7 and Host3 that is only power on for some hours per week to receive the ZFS replication of Host2.
So my idea was to setup a second PBS-VM2 on Host1 that syncs/pulls once per week the backups of PBS-VM1 on Host2 and stores them on a datastore on Host3 via NFS.
So in case Host2 fails I can boot up Host3 and restore my host backup and all of Host2s guest from PVE-VM2 on Host1.

In theory this should work fine in case Host1 and Host3 would be available all the time.
But how will PBS handle a offline datastore?
Would it be no problem if the NFS share with the datastore is offline, as long as it is online again when the sync, prune, GC and verify jobs are triggered?
Or would it be recommenden to send PBS into the new maintaince mode before shutting down Host3 with its NFS share and keep the PBS-VM2 running?
Or should I completely shutdown PBS-VM2 before shutting down Host3?
Is there also a way to disable a datastore like it is possible in PVE to disable a NFS storage to prevent annoying logs that the NFS share isn't reachable?

I guess shutting down PBS-VM2 before the NFS share goes offline should but would be good to know if maintaince mode or normal operation would work too.

Host3 will always boot up at the same time but is shutdown dynamically at different times by a script that monitors the state of the ZFS replication, scrub and resilvering as soon as all is finished. My idea was to edit this script and use the PBS API to also only allow to shutdown Host3 after all GC, verify, prune and sync jobs are finished. So I guess starting the PBS-VM2 using PVE API or enableing/disableing maintaince mode or shutting down the VM by using the PBS API shouldn't be a problem.

Edit:
I could think of something like that:

Sat 23:45: send command (IPMI) to boot up Host3. NFS should be available in within 5 minutes.
Sun 00:00: ZFS replication starts to backup Pools from Host2 to Host3. Usually finished within 1 hour. All 4 weeks a scrub will additionally run that needs around 20 hours to finish.
Sun 00:45: boot up PBS-VM2 using PVE API
Sun 01:00: PBS sync job starts pulling backups (only namespaces for weekly and manual backups as daily backups woulnd't make sense when only syncing once a week) from PBS-VM1 to PBS-VM2
Sun 02:00: prune job starts on PVE-VM2
Sun 02:10: GC job starts on PVE-VM2
Sun 02:20: Verify job starts on PVE-VM2
Sun 02:30: start checking if ZFS replication/scrub/resilvering is finished on Host3 (TrueNAS API) and if sync/GC/prune/verify jobs on PBS-VM2 are finished (PBS-API). As soon as all is finished shutdown PBS-VM2 (PVE API), wait until PBS-VM2 is stopped, then shutdown Host3 (TrueNAS API).

Would that work is there a better way to do it?
 
Last edited:
Is there also a way to disable a datastore like it is possible in PVE to disable a NFS storage to prevent annoying logs that the NFS share isn't reachable?
I thought that maintenance mode offline was implemented for this.
As I also use disable/enable storage on my pve for a host that's not always on, I wanted to now if on pbs datastore this works the same. A simple test with a datastore on a local folder, seems to work as designed, offline will stop logging errors for unavailable datastore.
According to the docs , in your script you could use:
proxmox-backup-manager datastore update <name> [OPTIONS]
 
  • Like
Reactions: Burny and Dunuin

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!