diff --git a/PVE/Storage/GlusterfsPlugin.pm b/PVE/Storage/GlusterfsPlugin.pm index 951db50..1e63e24 100644 --- a/PVE/Storage/GlusterfsPlugin.pm +++ b/PVE/Storage/GlusterfsPlugin.pm @@ -135,6 +135,7 @@ sub options { maxfiles => { optional => 1 }, content => { optional => 1 }, format => { optional => 1 }, + mkdir => { optional => 1 }, }; } @@ -272,7 +273,7 @@ sub activate_storage { if (!glusterfs_is_mounted($volume, $path, $cache->{mountdata})) { - mkpath $path; + mkpath $path if !(defined($scfg->{mkdir}) && !$scfg->{mkdir}); die "unable to activate storage '$storeid' - " . "directory '$path' does not exist\n" if ! -d $path; diff --git a/PVE/Storage/NFSPlugin.pm b/PVE/Storage/NFSPlugin.pm index df00f37..2f75eee 100644 --- a/PVE/Storage/NFSPlugin.pm +++ b/PVE/Storage/NFSPlugin.pm @@ -85,6 +85,7 @@ sub options { options => { optional => 1 }, content => { optional => 1 }, format => { optional => 1 }, + mkdir => { optional => 1 }, }; } @@ -129,7 +130,7 @@ sub activate_storage { # NOTE: only call mkpath when not mounted (avoid hang # when NFS server is offline - mkpath $path; + mkpath $path if !(defined($scfg->{mkdir}) && !$scfg->{mkdir}); die "unable to activate storage '$storeid' - " . "directory '$path' does not exist\n" if ! -d $path; diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index cdc89ba..6e73547 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -834,6 +834,8 @@ sub activate_storage { die "unable to activate storage '$storeid' - " . "directory '$path' does not exist\n" if ! -d $path; + return if defined($scfg->{mkdir}) && !$scfg->{mkdir}; + if (defined($scfg->{content})) { foreach my $vtype (keys %$vtype_subdirs) { # OpenVZMigrate uses backup (dump) dir