Author: arkurth
Date: Thu May 11 18:10:09 2017
New Revision: 1794862

URL: http://svn.apache.org/viewvc?rev=1794862&view=rev
Log:
VCL-915
Added '-o retry=0' to mount command in Linux.pm::nfs_mount_share. By default, 
NFS mount will retry for up to 2 minutes. VCL's execute attempt was giving up 
before the mount command.

Modified:
    vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=1794862&r1=1794861&r2=1794862&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Thu May 11 18:10:09 2017
@@ -585,7 +585,7 @@ sub post_reserve {
        my $variable_data;
        my $target_location = "/root/.vclcontrol/post_reserve_userdata";
        if ($self->data->is_variable_set($variable_name)) {
-               $variable_data = $self->data->get_variable($variable_name);
+               $variable_data = get_variable($variable_name);
                
                #write to local temp file
                my $tmpfile = "/tmp/$reservation_id" ."_post_reserve_userdata";
@@ -6057,6 +6057,15 @@ sub install_package {
                such as:
                rsize=1048576,wsize=1048576,vers=3
                
+               A 'retry=0' option is included in the mount command if $options
+               does not explicitly include it. This causes a single mount
+               attempt to be made rather than the default behavior of trying 
for
+               up to 2 minutes. This is required because the VCL code will
+               timeout before the Linux mount command gives up. As a result, 
VCL
+               does not receive the error message. This prevents automatic
+               corrective actions to happen such as creating the remote
+               directory.
+               
                The $options string must be formatted correctly and is passed
                directly to the mount command.
 
@@ -6120,7 +6129,16 @@ sub nfs_mount_share {
        
        my $mount_command = "mount -t nfs $remote_nfs_share 
\"$local_mount_directory\" -v";
        if ($nfs_options) {
-               $mount_command .= " -o $nfs_options";
+               # Add retry=0 if it wasn't explicitly specified in the argument
+               if ($nfs_options =~ /retry/) {
+                       $mount_command .= " -o $nfs_options";
+               }
+               else {
+                       $mount_command .= " -o retry=0,$nfs_options";
+               }
+       }
+       else {
+               $mount_command .= " -o retry=0";
        }
        
        # Save return value if error is encountered and don't return immediately


Reply via email to