]> git.proxmox.com Git - pve-manager.git/commitdiff
api: ceph: $get_storages check if data-pool too
authorAaron Lauterer <a.lauterer@proxmox.com>
Thu, 28 Apr 2022 11:58:05 +0000 (13:58 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 28 Apr 2022 18:26:38 +0000 (20:26 +0200)
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>
PVE/API2/Ceph/Pools.pm

index 002f7893d4ca37f30e2492d47c20e63453e85fa0..05855e15d317441264538e53e346ea34854235f2 100644 (file)
@@ -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;