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

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon May 22 09:54:30 CEST 2017


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};
-- 
2.1.4





More information about the pve-devel mailing list