From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox 1/1] pbs-api-types: define fstrim schedule on datastore config
Date: Thu, 19 Mar 2026 15:36:44 +0100 [thread overview]
Message-ID: <20260319143649.681937-2-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260319143649.681937-1-c.ebner@proxmox.com>
Allows to configure whether and how often to execute a fstrim on
the filesystem backing the datastore. Defaults to not run such
jobs if no schedule is given.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-api-types/src/datastore.rs | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 3e87eaaa..7b5c7027 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -419,6 +419,14 @@ impl FromStr for DatastoreBackendConfig {
}
}
+pub const FSTRIM_SCHEDULE_SCHEMA: Schema =
+ StringSchema::new("Run fstrim job at specified schedule.")
+ .format(&ApiStringFormat::VerifyFn(
+ proxmox_time::verify_calendar_event,
+ ))
+ .type_text("<calendar-event>")
+ .schema();
+
#[api(
properties: {
name: {
@@ -447,6 +455,10 @@ impl FromStr for DatastoreBackendConfig {
optional: true,
schema: PRUNE_SCHEDULE_SCHEMA,
},
+ "fstrim-schedule": {
+ optional: true,
+ schema: FSTRIM_SCHEDULE_SCHEMA,
+ },
keep: {
type: crate::KeepOptions,
},
@@ -495,6 +507,9 @@ pub struct DataStoreConfig {
#[serde(skip_serializing_if = "Option::is_none")]
pub prune_schedule: Option<String>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub fstrim_schedule: Option<String>,
+
#[serde(flatten)]
pub keep: crate::KeepOptions,
@@ -561,6 +576,7 @@ impl DataStoreConfig {
comment: None,
gc_schedule: None,
prune_schedule: None,
+ fstrim_schedule: None,
keep: Default::default(),
verify_new: None,
notify_user: None,
--
2.47.3
next prev parent reply other threads:[~2026-03-19 14:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 14:36 [RFC proxmox{,-backup} 0/6] add scheduled fstrim job for datastore's backing filesystems Christian Ebner
2026-03-19 14:36 ` Christian Ebner [this message]
2026-03-19 14:36 ` [PATCH proxmox-backup 1/5] tools: add helper to run fstrim command on path or mountpoint Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 2/5] api: config: expose fstrim schedule for datastores Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 3/5] bin: proxy: periodically schedule fstrim on datastore's filesystems Christian Ebner
2026-03-19 15:02 ` Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 4/5] ui: expose per-datastore fstrim job schedule Christian Ebner
2026-03-19 14:36 ` [PATCH proxmox-backup 5/5] api: set default fstrim schedule on datastore create Christian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260319143649.681937-2-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox