properties => {
node => get_standard_option('pve-node'),
add_storages => {
- description => "Configure VM and CT storage using the new pool. ".
- "Always enabled for erasure coded pools.",
+ description => "Configure VM and CT storage using the new pool.",
type => 'boolean',
optional => 1,
+ default => "0; for erasure coded pools: 1",
},
'erasure-coding' => {
description => "Create an erasure coded pool for RBD with an ".
my $rpcenv = PVE::RPCEnvironment::get();
my $user = $rpcenv->get_user();
+ my $rados = PVE::RADOS->new();
+
+ my $ec = ec_parse_and_check(extract_param($param, 'erasure-coding'), $rados);
+ $add_storages = 1 if $ec && !defined $add_storages;
# Ceph uses target_size_bytes
if (defined($param->{'target_size'})) {
$param->{application} //= 'rbd';
$param->{pg_autoscale_mode} //= 'warn';
- my $rados = PVE::RADOS->new();
-
- my $ec = ec_parse_and_check(extract_param($param, 'erasure-coding'), $rados);
-
my $worker = sub {
# reopen with longer timeout
$rados = PVE::RADOS->new(timeout => PVE::Ceph::Tools::get_config('long_rados_timeout'));