From 9125880215f5d67738f9c4ead41d997358f34e29 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 29 Sep 2011 20:34:06 +0000 Subject: [PATCH] Have vmfs:// also honor automount preference in vmware infrastructures git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10681 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index e23855056..364be5e84 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -3666,6 +3666,10 @@ sub validate_datastore_prereqs_inlock { my $uri = "vmfs://$name"; # check and see if this vmfs is on the node. unless ($hyphash{$hyp}->{datastoremap}->{$uri}) { #If not already there, try creating it. + unless ($datastoreautomount) { + xCAT::SvrUtils::sendmsg([1,": $uri is not currently accessible at the given location and automount is disabled in site table"], $output_handler,$node); + return 0; + } $refresh_names=1; ($hyphash{$hyp}->{datastoremap}->{$uri},$hyphash{$hyp}->{datastorerefmap}->{$uri})=create_vmfs_datastore($hostview,$name,$hyp); unless($hyphash{hyp}->{datastoremap}->{$uri}){ return 0; } @@ -3721,6 +3725,10 @@ sub validate_datastore_prereqs_inlock { $name =~ s/:$//; #remove a : if someone put it in for some reason. my $uri = "vmfs://$name"; unless ($hyphash{$hyp}->{datastoremap}->{$uri}) { #If not already there, it should be! + unless ($datastoreautomount) { + xCAT::SvrUtils::sendmsg([1,": $uri is not currently accessible at the given location and automount is disabled in site table"], $output_handler,$node); + return 0; + } $refresh_names=1; ($hyphash{$hyp}->{datastoremap}->{$uri},$hyphash{$hyp}->{datastorerefmap}->{$uri})=create_vmfs_datastore($hostview,$name,$hyp); unless($hyphash{hyp}->{datastoremap}->{$uri}){ return 0; } @@ -3825,6 +3833,9 @@ sub create_vmfs_datastore { my $hostview = shift; # VM object my $name = shift; # name of storage we wish to create. my $hyp = shift; + unless ($datastoreautomount) { + die "automount of VMware datastores is disabled in site configuration, not continuing"; + } # call some VMware API here to create my $hdss = $hostview->{vim}->get_view(mo_ref=>$hostview->configManager->datastoreSystem);