Hi,
I’m using syncoid for replication (from host pve1 to pve2 and from pve1 to bak1).
To prune old snapshots, I set up sanoid, but I made some mistakes I fail to see…
On pve2
, I have many unexpected syncoid snaps for bak1, and vice versa.
How do I prune syncoid snapshots?
Detailed description of my setup.
Via cron I run on pve1
:
syncoid --quiet --identifier=pve2 --no-privilege-elevation --recursive rpool/homes syncoid@pve2:dpool/pve1/homes
syncoid --quiet --identifier=bak1 --no-privilege-elevation --recursive rpool/homes syncoid@bak1:dpool/pve1/homes
Currently, I’m having thousands of snapshots on each replication destination for the other destination, i.e. on pve2
I have many for bak1
and on bak1
many for pve2
.
Example:
On pve2
:
1 x syncoid_pve1-pve2_2024-04-17:20:05:14-GMT00:00
10,000 x syncoid_pve1-bak1_2024-04-17:20:05:16-GMT00:00
on bak1
:
1 x syncoid_pve1-bak1_2024-04-17:20:05:16-GMT00:00
10,000 x syncoid_pve1-pve2_2024-04-17:20:05:14-GMT00:00
(of course, date and time differs for each)
On target pve2
, when I run sanoid --prune-snapshots --verbose --debug
I get only 63
total, such as syncoid snapshots (to bak1
) are not considered:
Filesystem rpool/pve1/homes has:
63 total snapshots (newest: 0.7 hours old)
36 hourly
desired: 36
newest: 0.4 hours old, named autosnap_2024-04-18_20:00:12_hourly
25 daily
desired: 30
newest: 21.3 hours old, named autosnap_2024-04-18_00:00:14_daily
2 monthly
desired: 3
newest: 429.3 hours old, named autosnap_2024-04-01_00:00:13_monthly
I took a look to the source code and saw my ($snaptype) = ($snapname =~ m/.*_(\w*ly)/);
which could possibly mean only to take snapshots with ending with “ly”, and if ($snapname =~ /^autosnap/)
seems to limit working on “autosnap” snapshots only, but so many sources tell sanoid
is to be used to manage syncoid
snapshots that I think I must miss something?!
How do I prune syncoid snapshots?
Any hint appreciated!
my sanoid.conf:
[rpool/pve1/homes]
use_template = prune_prod
[template_prune_prod]
hourly = 36
daily = 30
monthly = 3
yearly = 0
daily_hour = 23
daily_min = 59
autosnap = no
autoprune = yes