my $res = {};
foreach my $storeid (keys %$storages) {
my $curr = $storages->{$storeid};
- $res->{$storeid} = $storages->{$storeid}
- if $curr->{type} eq 'rbd' && $pool eq $curr->{pool};
+ next if $curr->{type} ne 'rbd';
+ if (
+ $pool eq $curr->{pool} ||
+ (defined $curr->{'data-pool'} && $pool eq $curr->{'data-pool'})
+ ) {
+ $res->{$storeid} = $storages->{$storeid};
+ }
}
return $res;
PVE::Ceph::Tools::create_pool($pool, $param);
if ($add_storages) {
- my $err;
- eval { $add_storage->($pool, "${pool}"); };
- if ($@) {
- warn "failed to add storage: $@";
- $err = 1;
- }
- die "adding storage for pool '$pool' failed, check log and add manually!\n"
- if $err;
+ eval { $add_storage->($pool, "${pool}") };
+ die "adding PVE storage for ceph pool '$pool' failed: $@\n" if $@;
}
};