From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 2/2] api: create default garbage collection schedule
Date: Wed, 29 Nov 2023 14:27:27 +0100 [thread overview]
Message-ID: <1701264012.iyam5az1x7.astroid@yuna.none> (raw)
In-Reply-To: <20231129113637.204053-3-c.ebner@proxmox.com>
one nit below, but the same general remark as with patch #1 applies here
as well..
On November 29, 2023 12:36 pm, Christian Ebner wrote:
> Create a default garbage collection schedule when a datastore is created
> as part of a disk/zpool creation transaction via e.g.
> `proxmox-backup-manager disk fs create <storage-name> --disk <block-device>
> --add-datastore true`
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> src/api2/node/disks/directory.rs | 5 +++--
> src/api2/node/disks/zfs.rs | 5 +++--
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/api2/node/disks/directory.rs b/src/api2/node/disks/directory.rs
> index 89260b8e..a3e1ba71 100644
> --- a/src/api2/node/disks/directory.rs
> +++ b/src/api2/node/disks/directory.rs
> @@ -196,8 +196,9 @@ pub fn create_datastore_disk(
>
> if add_datastore {
> let lock = pbs_config::datastore::lock_config()?;
> - let datastore: DataStoreConfig =
> - serde_json::from_value(json!({ "name": name, "path": mount_point }))?;
> + let datastore: DataStoreConfig = serde_json::from_value(
> + json!({ "name": name, "path": mount_point, "gc-schedule": String::from("daily") }),
> + )?;
>
> let (config, _digest) = pbs_config::datastore::config()?;
>
> diff --git a/src/api2/node/disks/zfs.rs b/src/api2/node/disks/zfs.rs
> index 7bc46986..7b8a3891 100644
> --- a/src/api2/node/disks/zfs.rs
> +++ b/src/api2/node/disks/zfs.rs
> @@ -311,8 +311,9 @@ pub fn create_zpool(
>
> if add_datastore {
> let lock = pbs_config::datastore::lock_config()?;
> - let datastore: DataStoreConfig =
> - serde_json::from_value(json!({ "name": name, "path": mount_point }))?;
> + let datastore: DataStoreConfig = serde_json::from_value(
> + json!({ "name": name, "path": mount_point, "gc-scheudle": String::from("daily") }),
typo: s/scheudle/schedule
> + )?;
>
> let (config, _digest) = pbs_config::datastore::config()?;
>
> --
> 2.39.2
>
>
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
>
>
>
prev parent reply other threads:[~2023-11-29 13:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 11:36 [pbs-devel] [PATCH proxmox-backup 0/2] add default prune job and gc-schedule Christian Ebner
2023-11-29 11:36 ` [pbs-devel] [PATCH proxmox-backup 1/2] api: create default prune job on datastore creation Christian Ebner
2023-11-29 13:27 ` Fabian Grünbichler
2023-11-29 13:31 ` Thomas Lamprecht
2023-11-29 13:54 ` Christian Ebner
2023-11-29 11:36 ` [pbs-devel] [PATCH proxmox-backup 2/2] api: create default garbage collection schedule Christian Ebner
2023-11-29 13:27 ` Fabian Grünbichler [this message]
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=1701264012.iyam5az1x7.astroid@yuna.none \
--to=f.gruenbichler@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