sanoid icon indicating copy to clipboard operation
sanoid copied to clipboard

sanoid snasphots at wrong time interval

Open devZer0 opened this issue 4 years ago • 5 comments

I'm using sanoid with proxmox pve (latest).

sanoid is running on the proxmox servers and syncoid is being run in "pull mode" from a backup server and replicating several proxmox zfs datasets to the backup server. i'm running it from the backup-server because i do not want every proxmox server having write access to the backup server.

i'm seeing weird snapshot times in sandoid, it seems sanoid does extra snapshots which are not needed. it seems it does not recognize that the correct snapshot is already there.

root@pve-node3:~# zfs list -t snapshot -r rpool|grep hourly|sort rpool/vms-files@autosnap_2020-06-10_20:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-10_21:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-10_21:32:50_hourly 0B - 4.75G - rpool/vms-files@autosnap_2020-06-10_22:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-10_22:00:01_hourly 0B - 2.23G - * rpool/vms-files@autosnap_2020-06-10_22:01:01_hourly 0B - 2.23G - * rpool/vms-files@autosnap_2020-06-10_22:02:01_hourly 0B - 2.23G - * rpool/vms-files@autosnap_2020-06-10_22:03:02_hourly 0B - 2.23G - * rpool/vms-files@autosnap_2020-06-10_23:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_00:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_01:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_02:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_03:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_03:00:01_hourly 0B - 2.23G - * rpool/vms-files@autosnap_2020-06-11_04:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_05:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_06:00:00_hourly 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_06:00:01_hourly 0B - 2.23G - *

root@pve-node3:~# zfs list -t snapshot -r rpool|grep frequent|sort rpool/vms-files@autosnap_2020-06-11_03:00:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_03:15:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_03:30:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_03:45:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_04:00:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_04:15:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_04:30:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_04:45:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_05:00:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_05:15:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_05:30:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_05:45:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_06:00:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_06:00:01_frequently 0B - 2.23G - * rpool/vms-files@autosnap_2020-06-11_06:15:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_06:30:00_frequently 0B - 2.23G - rpool/vms-files@autosnap_2020-06-11_06:45:00_frequently 0B - 2.23G -

is this a bug ?

i'm using v2.0.3 (debian package, built myself)

devZer0 avatar Jun 11 '20 06:06 devZer0

ok, found this one: https://github.com/jimsalterjrs/sanoid/issues/553

could you perhaps add a note to this paragraph that cron entry is not needed on debian ? i did not see that there is a systemd timer in place (which was installed by the package) - so i was adding cron entry which was not needed.

https://github.com/jimsalterjrs/sanoid More prosaically, you can use Sanoid to create, automatically thin, and monitor snapshots and pool health from a single eminently human-readable TOML config file at /etc/sanoid/sanoid.conf. (Sanoid also requires a "defaults" file located at /etc/sanoid/sanoid.defaults.conf, which is not user-editable.) A typical Sanoid system would have a single cron job:

          • TZ=UTC /usr/local/bin/sanoid --cron

devZer0 avatar Jun 11 '20 07:06 devZer0

Small note, but I found sanoid runs better when it's run every 5 minutes, not every minute. If you don't have a snapshot using a frequently setting of less than 5 minutes, you can slow it down a little.

secabeen avatar Jun 11 '20 18:06 secabeen

i'm running it at 15min interval, which is the default setting from the debian package:

# cat /etc/systemd/system/timers.target.wants/sanoid.timer |grep OnCalendar
OnCalendar=*:0/15

devZer0 avatar Jun 11 '20 20:06 devZer0

Believe this is a duplicate of #566 I have edited the wiki to reflect that a time unit is created.

hallamjeff avatar Aug 21 '20 21:08 hallamjeff

I tripped over this one too. I have filed a small bug against the Debian package suggesting that README.Debian include a note saying adding a cron job is not necessary as the package handles it.

troffasky avatar Aug 31 '20 11:08 troffasky