[pve-devel] [PATCH manager] fix #2292: ceph osd create: use size parameter for db/wal

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jul 19 11:08:29 CEST 2019


On 7/19/19 8:56 AM, Dominik Csapak wrote:
> commit
> 5e0a75882378eb55ad16fd8e405a831cc4806c20
> did not account for getting the correct size parameter from the api
> call, so we ignored it always resulting in uses not be able to
> set an explicit db/wal size
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/API2/Ceph/OSD.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
> index 3b432784..3c12abb5 100644
> --- a/PVE/API2/Ceph/OSD.pm
> +++ b/PVE/API2/Ceph/OSD.pm
> @@ -275,7 +275,8 @@ __PACKAGE__->register_method ({
>  		name => $type_devname,
>  	    };
>  
> -	    if (my $size = $param->{"${type}_size"}) {
> +	    (my $shorttype = $type) =~ s/_dev$//;
> +	    if (my $size = $param->{"${shorttype}_size"}) {
>  		$devs->{$type}->{size} = PVE::Tools::convert_size($size, 'gb' => 'b') ;
>  	    }
>  	}
> 

I replaced the proposed fix with the one below. if we'd had seen this before Tuesday
I'd just renamed the params, but now it's a little to late to make that incompatible
change (and our param alias/depreacation wish is not yet fulfilled ;) ).
Thanks for the notice!

----8<----
diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index 3b432784..954859e9 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -261,6 +261,10 @@ __PACKAGE__->register_method ({
        # extract parameter info and fail if a device is set more than once
        my $devs = {};
 
+       # FIXME: rename params on next API compatibillity change (7.0)
+       $param->{wal_dev_size} = delete $param->{wal_size};
+       $param->{db_dev_size} = delete $param->{db_size};
+
        for my $type ( qw(dev db_dev wal_dev) ) {
            next if !$param->{$type};
 




More information about the pve-devel mailing list