diff --git a/PVE/Storage.pm b/PVE/Storage.pm index c86ce0c..4b0805c 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -93,6 +93,12 @@ sub storage_check_enabled { return undef; } + my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + if (!$plugin->check_connection($storeid, $scfg)) { + die "storage '$storeid' is not available\n" if !$noerr; + return undef; + } + return storage_check_node($cfg, $storeid, $node, $noerr); } diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 7c0e3e9..27f004c 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -579,4 +579,10 @@ sub deactivate_volume { # do nothing by default } +sub check_connection { + my ($class, $storeid, $scfg) = @_; + # do nothing by default + return 1; +} + 1;