Commit ce09e072 authored by Dietmar Maurer's avatar Dietmar Maurer

pveceph: allow to set min_size for pools

parent 5468b95b
......@@ -965,6 +965,14 @@ __PACKAGE__->register_method ({
minimum => 1,
maximum => 3,
},
min_size => {
description => 'Minimum number of replicas per object',
type => 'integer',
default => 1,
optional => 1,
minimum => 1,
maximum => 3,
},
pg_num => {
description => "Number of placement groups.",
type => 'integer',
......@@ -986,9 +994,12 @@ __PACKAGE__->register_method ({
my $pg_num = $param->{pg_num} || 512;
my $size = $param->{size} || 2;
my $min_size = $param->{min_size} || 1;
&$run_ceph_cmd(['osd', 'pool', 'create', $param->{name}, $pg_num]);
&$run_ceph_cmd(['osd', 'pool', 'set', $param->{name}, 'min_size', $min_size]);
&$run_ceph_cmd(['osd', 'pool', 'set', $param->{name}, 'size', $size]);
return undef;
......
......@@ -32,6 +32,15 @@ Ext.define('PVE.CephCreatePool', {
maxValue: 3,
allowBlank: false
},
{
xtype: 'numberfield',
fieldLabel: gettext('Min. Size'),
name: 'min_size',
value: 1,
minValue: 1,
maxValue: 3,
allowBlank: false
},
{
xtype: 'numberfield',
fieldLabel: 'pg_num',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment