canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.38k stars 931 forks source link

Feature request: Add a flag to lxc copy/ lxc volume copy to only create new snapshots and do not delete old snapshots. #14473

Open manfromafar opened 4 hours ago

manfromafar commented 4 hours ago

Storage backend zfs

For backups we like to keep snapshots on remote backup servers for longer then what is on the local machines. This means there could be say 10 snapshots locally and 100 snapshots remotely for the same container. Too facilitate this we've written our own backup wrapper that sends the snapshots to the remote server and injects the snapshots into the lxd database for later use. The reason we've had to do this is that even though copy does have a --refresh flag to make local and remote trees identical, this also causes older snapshots on the remote system to get deleted, hence we can't use this.

I'd like to see a new flag or maybe refresh could be reworked I don't know to not remove old snapshots on a remote host. Maybe it would be better to add a option to refresh that says I want to refresh snapshots 5 to latest on the remote system. Which would leave historical snapshots before 5 alone on the remote system.

MggMuggins commented 3 hours ago

@mionaalex Loosely related to https://github.com/canonical/lxd/issues/14427