You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by ar...@apache.org on 2017/03/16 15:41:30 UTC

svn commit: r1787210 - /vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm

Author: arkurth
Date: Thu Mar 16 15:41:30 2017
New Revision: 1787210

URL: http://svn.apache.org/viewvc?rev=1787210&view=rev
Log:
VCL-1004
Updated VMware.pm::copy_vmdk to use a value of 1 if the copy was extremely fast and the duration was calculated to be 0 seconds.

Modified:
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm?rev=1787210&r1=1787209&r2=1787210&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm Thu Mar 16 15:41:30 2017
@@ -6144,7 +6144,9 @@ sub copy_vmdk {
 	}
 	
 	# Calculate how long it took to copy
-	my $duration_seconds = ($end_time - $start_time);
+	# It's possible the copy took less than 1 second (experienced this with VAAI-enabled datastore)
+	# If 0 seconds, set it to 1 second to avoid divide by 0 errors later on
+	my $duration_seconds = ($end_time - $start_time) || 1;
 	my $minutes = ($duration_seconds / 60);
 	$minutes =~ s/\..*//g;
 	my $seconds = ($duration_seconds - ($minutes * 60));