From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 3A2CD1FF16A for ; Wed, 28 Aug 2024 10:14:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F146E3D7AB; Wed, 28 Aug 2024 10:15:02 +0200 (CEST) Date: Wed, 28 Aug 2024 10:14:58 +0200 From: Stoiko Ivanov To: Maximiliano Sandoval Message-ID: <20240828101458.3ed1c6fe@rosa.proxmox.com> In-Reply-To: <20240827142433.357779-1-m.sandoval@proxmox.com> References: <20240827142433.357779-1-m.sandoval@proxmox.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.078 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [zfs.pm, suse.com] Subject: Re: [pve-devel] [PATCH storage v2] api: disks: zfs: enable monthly scrub when creating a pool X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Tue, 27 Aug 2024 16:24:33 +0200 Maximiliano Sandoval wrote: > And disable it when destroying the pool. > can be fine in general - but why? our packages ship: /etc/cron.d/zfsutils-linux (and /usr/lib/zfs-linux/scrub) which does (afair) run a monthly scrub (and trim) under certain conditions (including by default on healthy pools) what do we gain by explicitly enabling a unit for scrubbing (which at least from experiences with the per-pool import unit, will cause odd warnings in the journal, resulting in support requests)? > Signed-off-by: Maximiliano Sandoval > --- > > Differences from v1: > - Add --now flag to commands so they are `started` on top of `enabled`. a short explanation on why this is/was necessary would help (maybe even with a link to the relevant documentation e.g.: https://documentation.suse.com/smart/systems-management/html/systemd-working-with-timers/index.html#systemd-timer-manage > > > src/PVE/API2/Disks/ZFS.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/src/PVE/API2/Disks/ZFS.pm b/src/PVE/API2/Disks/ZFS.pm > index 6fb6bd6b..6d9ace5b 100644 > --- a/src/PVE/API2/Disks/ZFS.pm > +++ b/src/PVE/API2/Disks/ZFS.pm > @@ -490,6 +490,13 @@ __PACKAGE__->register_method ({ > run_command($cmd); > } > > + if (-e '/lib/systemd/system/zfs-scrub-monthly@.timer') { > + my $scrubtimer = 'zfs-scrub-monthly@'. PVE::Systemd::escape_unit($name, undef) . '.timer'; > + $cmd = ['systemctl', 'enable', $scrubtimer, '--now']; > + print "# ", join(' ', @$cmd), "\n"; > + run_command($cmd); > + } > + > PVE::Diskmanage::udevadm_trigger($devs->@*); > > if ($param->{add_storage}) { > @@ -583,6 +590,11 @@ __PACKAGE__->register_method ({ > run_command(['systemctl', 'disable', $importunit]); > } > > + if (-e '/lib/systemd/system/zfs-scrub-monthly@.timer') { > + my $scrubtimer = 'zfs-scrub-monthly@' . PVE::Systemd::escape_unit($name) . '.timer'; > + run_command(['systemctl', 'disable', $scrubtimer, '--now']); > + } > + > run_command(['zpool', 'destroy', $name]); > > my $config_err; _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel