]> git.proxmox.com Git - pve-storage.git/commitdiff
vdisk_list: skip scanning storages which cannot have images/rootdisks
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 9 Jul 2020 14:14:04 +0000 (16:14 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 9 Jul 2020 14:16:23 +0000 (16:16 +0200)
Do not try to scan (and thus activate) storages which aren't
configured to support (or cannot support) "vdisks" anyway.

Avoids seemingly strange failures of VM migrations due to a backup storage
not being currently online - even if that storage isn't referenced in
the VM config anywhere..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage.pm

index edf9a2ecd6651baf89839d8d78d4c411f4fba59b..8375a91063f4a9dbb8037e2cdbcd4ed09f01d595 100755 (executable)
@@ -882,6 +882,8 @@ sub vdisk_list {
        foreach my $sid (keys %$ids) {
            next if $storeid && $storeid ne $sid;
            next if !storage_check_enabled($cfg, $sid, undef, 1);
+           my $content = $ids->{$sid}->{content};
+           next if !($content->{rootdir} || $content->{images});
            push @$storage_list, $sid;
        }
     }