[pbs-devel] [PATCH proxmox-backup 2/2] api: create default garbage collection schedule

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Nov 29 14:27:27 CET 2023


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 at 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 at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 




More information about the pbs-devel mailing list