[pve-devel] [PATCH manager] pveceph: init: add min_size, change default to 3/2

Thomas Lamprecht t.lamprecht at proxmox.com
Tue May 23 08:26:02 CEST 2017


I had the same patch- semantic wise - here, just wasn't sure if it was 
better to not set them at allif not explicitly passed.
As ceph uses 3 as default for size and 0 for min_size, where 0 results 
in `size - (size / 2)`

But as this are sane and more important safe defaults:

Reviewed-by: Thomas Lamprecht <t.lamprecht at proxmox.com>

On 05/22/2017 09:54 AM, Fabian Grünbichler wrote:
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
> follow up to previous patches for pool creation
>
>   PVE/API2/Ceph.pm | 15 +++++++++++----
>   1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
> index 12ea28a..7783465 100644
> --- a/PVE/API2/Ceph.pm
> +++ b/PVE/API2/Ceph.pm
> @@ -716,7 +716,15 @@ __PACKAGE__->register_method ({
>   		maxLength => 128,
>   	    },
>   	    size => {
> -		description => 'Number of replicas per object',
> +		description => 'Targeted number of replicas per object',
> +		type => 'integer',
> +		default => 3,
> +		optional => 1,
> +		minimum => 1,
> +		maximum => 7,
> +	    },
> +	    min_size => {
> +		description => 'Minimum number of available replicas per object to allow I/O',
>   		type => 'integer',
>   		default => 2,
>   		optional => 1,
> @@ -769,7 +777,8 @@ __PACKAGE__->register_method ({
>   		'auth service required' => $auth,
>   		'auth client required' => $auth,
>   		'osd journal size' => $pve_osd_default_journal_size,
> -		'osd pool default min size' => 1,
> +		'osd pool default size' => $param->{size} // 3,
> +		'osd pool default min size' => $param->{min_size} // 2,
>   	    };
>   
>   	    # this does not work for default pools
> @@ -780,8 +789,6 @@ __PACKAGE__->register_method ({
>   	$cfg->{global}->{keyring} = '/etc/pve/priv/$cluster.$name.keyring';
>   	$cfg->{osd}->{keyring} = '/var/lib/ceph/osd/ceph-$id/keyring';
>   
> -	$cfg->{global}->{'osd pool default size'} = $param->{size} if $param->{size};
> -
>   	if ($param->{pg_bits}) {
>   	    $cfg->{global}->{'osd pg bits'} = $param->{pg_bits};
>   	    $cfg->{global}->{'osd pgp bits'} = $param->{pg_bits};






More information about the pve-devel mailing list