From: Aaron Lauterer Date: Thu, 28 Apr 2022 11:58:05 +0000 (+0200) Subject: api: ceph: $get_storages check if data-pool too X-Git-Url: https://git.proxmox.com/?p=pve-manager.git;a=commitdiff_plain;h=29fe1eea7a057d239a7f5f86f354fff084520674 api: ceph: $get_storages check if data-pool too 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 --- diff --git a/PVE/API2/Ceph/Pools.pm b/PVE/API2/Ceph/Pools.pm index 002f7893..05855e15 100644 --- a/PVE/API2/Ceph/Pools.pm +++ b/PVE/API2/Ceph/Pools.pm @@ -302,8 +302,13 @@ my $get_storages = sub { 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;