When removing a pool, we check against any storage that might have that
pool configured.
We need to check if that pool is used as data-pool too.
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
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;