You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by fa...@apache.org on 2014/10/03 17:24:17 UTC

svn commit: r1629227 - in /vcl/trunk/managementnode: bin/S99vcld.linux lib/VCL/DataStructure.pm lib/VCL/Module/Predictive/Level_0.pm lib/VCL/Module/Predictive/Level_1.pm

Author: fapeeler
Date: Fri Oct  3 15:24:17 2014
New Revision: 1629227

URL: http://svn.apache.org/r1629227
Log:
VCL-170

changed DataStructure to check for exactly 4 values returned from Predictives modules
fixed missing action "reload" from Level_0, Level_1 modules 
this was causing noimage to be inserted for reload image

Update Level_0 to explictely return the current image that was previously being used


Modified:
    vcl/trunk/managementnode/bin/S99vcld.linux
    vcl/trunk/managementnode/lib/VCL/DataStructure.pm
    vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm
    vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm

Modified: vcl/trunk/managementnode/bin/S99vcld.linux
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/bin/S99vcld.linux?rev=1629227&r1=1629226&r2=1629227&view=diff
==============================================================================
--- vcl/trunk/managementnode/bin/S99vcld.linux (original)
+++ vcl/trunk/managementnode/bin/S99vcld.linux Fri Oct  3 15:24:17 2014
@@ -22,14 +22,14 @@
 # description: VCL management node daemon
 
 # DAEMON: Name of the daemon executable
-DAEMON=vcld
+DAEMON=vcldfap
 
 # DAEMON_PATH: Path to the daemon, no trailing '/'
-DAEMON_PATH=/usr/local/vcl/bin
+DAEMON_PATH=/usr/local/vcldev/fap/managementnode/bin
 
 # DAEMON_OPTIONS: options for the daemon, these can be overridden by
 # setting DAEMON_OPTIONS in /etc/sysconfig/$DAEMON
-DAEMON_OPTIONS='-v -conf=/etc/vcl/vcld.conf'
+DAEMON_OPTIONS='-v -conf=/usr/local/vcldev/fap/managementnode/etc/vcl/vcld_fap.conf'
 
 
 # You shouldn't need to edit anything below here
@@ -51,6 +51,7 @@ umask 077
 
 start() {
  	echo -n $"Starting $DAEMON daemon: "
+	cp /dev/null /usr/local/vcldev/fap/managementnode/vcldfap.log
 	daemon $DAEMON_PATH/$DAEMON $DAEMON_OPTIONS
 	RETVAL=$?
     if [ $RETVAL -eq 0 ]; then
@@ -65,7 +66,7 @@ start() {
 stop() {
 	echo -n $"Shutting down $DAEMON daemon: "
 	kill -9 `/bin/cat /var/run/$DAEMON.pid` 2>/dev/null
-	RETVAL=$?
+    RETVAL=$?
     if [ $RETVAL -eq 0 ]; then
         rm -f /var/lock/subsys/$DAEMON
         success

Modified: vcl/trunk/managementnode/lib/VCL/DataStructure.pm
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=1629227&r1=1629226&r2=1629227&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/DataStructure.pm Fri Oct  3 15:24:17 2014
@@ -1321,7 +1321,7 @@ sub get_next_image_dataStructure {
 			@nextimage = $predictor->get_next_image();
 			notify($ERRORS{'OK'}, 0, ref($predictor) . " predictive loading object successfully created");
 				notify($ERRORS{'OK'}, 0, "predictive loading module retreived image information: @nextimage");
-			if (scalar(@nextimage) >= 3) {
+			if (scalar(@nextimage) == 4) {
 				return @nextimage;
 			}
 			else {

Modified: vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm?rev=1629227&r1=1629226&r2=1629227&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_0.pm Fri Oct  3 15:24:17 2014
@@ -87,6 +87,8 @@ sub get_next_image {
 	my $current_image_id    = $self->data->get_image_id();
 	my $current_image_name  = $self->data->get_image_name();
 	my $current_imagerevision_id = $self->data->get_imagerevision_id();
+
+	my @current_image_ret_array = ('reload', $current_image_name, $current_image_id, $current_imagerevision_id );
 	
 	my $notify_prefix = "predictive_reload_Level_0: ";
 	my @ret_array;
@@ -152,7 +154,7 @@ sub get_next_image {
 			notify($ERRORS{'OK'}, 0, "$notify_prefix diff= $diff image= $reservation_row{imagename} imageid=$reservation_row{imageid}");
 			if ($diff < (50 * 60)) {
 				notify($ERRORS{'OK'}, 0, "$notify_prefix future reservation detected diff= $diff image= $reservation_row{imagename} imageid=$reservation_row{imageid}");
-				push(@ret_array, $reservation_row{imagename}, $reservation_row{imageid}, $reservation_row{imagerevisionid});
+				push(@ret_array, "reload", $reservation_row{imagename}, $reservation_row{imageid}, $reservation_row{imagerevisionid});
 				return @ret_array;
 			}
 		} ## end for (@selected_rows)
@@ -184,11 +186,11 @@ sub get_next_image {
 	# Check to make sure at least 1 row were returned
 	if (scalar @next_selected_rows == 0) {
 		notify($ERRORS{'OK'}, 0, "$notify_prefix next image for computerid $computer_id is not set");
-		return;
+		return @current_image_ret_array;
 	}
 	elsif (scalar @next_selected_rows > 1) {
 		notify($ERRORS{'OK'}, 0, "" . scalar @next_selected_rows . " rows were returned from database select");
-		return;
+		return @current_image_ret_array;
 	}
 	notify($ERRORS{'OK'}, 0, "$notify_prefix returning nextimage image=$next_selected_rows[0]{imagename} imageid=$next_selected_rows[0]{imageid}");
 	push (@ret_array, "reload", $next_selected_rows[0]{imagename}, $next_selected_rows[0]{imageid}, $next_selected_rows[0]{imagerevisionid});

Modified: vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
URL: http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=1629227&r1=1629226&r2=1629227&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Fri Oct  3 15:24:17 2014
@@ -135,7 +135,7 @@ sub get_next_image {
 		else {
 			notify($ERRORS{'OK'}, 0, "$notify_prefix returning nextimage image=$next_selected_rows[0]{imagename} imageid=$next_selected_rows[0]{imageid}");
 			my @next_image_ret_array;
-			push (@next_image_ret_array, $next_selected_rows[0]{imagename}, $next_selected_rows[0]{imageid}, $next_selected_rows[0]{imagerevisionid});
+			push (@next_image_ret_array, "reload", $next_selected_rows[0]{imagename}, $next_selected_rows[0]{imageid}, $next_selected_rows[0]{imagerevisionid});
 			
 			#Clear next_imageid
 			if(!clear_next_image_id($computer_id)){