Cleaning up Incus export orphaned backup file and general backup question

I’ve been playing with remote backups and setting the backup dir as the same remote and final export location for speed increases.

Version 1: I tried something like this (V1)

#pseudocode
mount -t nfs4 REMOTE_DETAILS /path/to/localmount
incus storage pool create BackupPool dir source=/path/to/localmount
incus storage volume create BackupPool BackupVolume
incus config set storage.backups_volume BackupPool/BackupVolume
cd /path/to/localmount && incus export FOO
incus config unset storage.backups_volume
umount /path/to/localmount

But I found when I interrupted the NFS connection , incus storage list still shows the status as “CREATED” instead of “offline” or anything like that. Can incus test a remote pool/volume incus to know if it is an NFS directory and online or not?

I’ve read that for remote NFS connections, the local server can hang waiting for the NFS server to return.

Version 2: I also tried something like (V2)

#pseudocode 
mount -t nfs4 REMOTE_DETAILS /path/to/localmount
mv /var/lib/incus/backups /var/lib/incus/backups.dist
ln -s /path/to/localmount/backups /var/lib/incus/backups 
cd /path/to/localmount && incus export FOO
rm /var/lib/incus/backups 
mv /var/lib/incus/backups.dist  /var/lib/incus/backups
umount /path/to/localmount

Both ended up with a mv command on the NFS remote directory being instantly executed (NFS server took care of it nearly instantly). For example here’s what incus reported for a just under 2 GB export. The “local” backup part is slowed by the process of creating the snapshot and not the network. The “exporting the backup” part was so fast it just reported it as the entire file in one second

Backing up instance: 1.35GB (13.88MB/s)
Exporting the backup: 100% (1.37GB/s)

V1 uses the native incus server config commands to change directories, however it seems incus storage commands all just trust that a pool/volume on a remote NFS server is available.

So I’m moving forward with some test scripts for backups using V2 for NFS ( GitHub - AJRepo/incus_tools: Tools for Incus )

Questions:

  1. Thoughts about adding an NFS handler for remote backups? Something like

incus storage remote create BackupRemote nfs source=/path/to/localmount

I found this issue ( Add a `nfs` storage driver · Issue #1311 · lxc/incus · GitHub ) but it seemed just for generic storage.

  1. What do you think of a configuration setting for backups as a directory or an NFS location instead of a pool/volume? ( e.g. set storage.backups_LOCATION /path/to/nfs/mount ) .