Author: fapeeler
Date: Fri Dec  5 15:59:04 2014
New Revision: 1643339

URL: http://svn.apache.org/r1643339
Log:
VCL-308, VCL-568

cleaned up modules in relation to the computer load flow. removed duplicates 
insertloadlog calls,
this caused duplicates to be presented to the end-user "pending" link for 
loading status.

Modified:
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
    vcl/trunk/managementnode/lib/VCL/Module/State.pm
    vcl/trunk/managementnode/lib/VCL/new.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm?rev=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning.pm Fri Dec  5 15:59:04 
2014
@@ -475,7 +475,6 @@ sub retrieve_image {
        }
        
        notify($ERRORS{'OK'}, 0, "found $image_name on partner management 
nodes:\n" . join("\n", map { $partner_info{$_}{hostname} } (sort 
@partners_with_image)));
-       insertloadlog($reservation_id, $computer_id, "copyfrompartnerMN", 
"copying image files from partner management node");
        
        # Choose a random partner so that the same management node isn't used 
for most transfers
        my $random_index = int(rand(scalar(@partners_with_image)));

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=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm 
(original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm Fri 
Dec  5 15:59:04 2014
@@ -520,7 +520,6 @@ sub load {
        my $image_name = $self->data->get_image_name() || return;
        my $vmhost_name = $self->data->get_vmhost_short_name() || return;
 
-       insertloadlog($reservation_id, $computer_id, "doesimageexists", "image 
exists $image_name");
        
        insertloadlog($reservation_id, $computer_id, "startload", 
"$computer_name $image_name");
        
@@ -597,7 +596,7 @@ sub load {
        # Call the OS module's post_load() subroutine if implemented
        if ($self->os->can("post_load")) {
                if ($self->os->post_load()) {
-                       insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "performed OS post-load tasks on $computer_name");
+                       notify($ERRORS{'OK'}, 0, "performed OS post-load tasks 
on $computer_name");
                }
                else {
                        notify($ERRORS{'WARNING'}, 0, "failed to perform OS 
post-load tasks on VM $computer_name on VM host: $vmhost_name");
@@ -605,7 +604,7 @@ sub load {
                }
        }
        else {
-               insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "OS post-load tasks not necessary on $computer_name");
+               notify($ERRORS{'OK'}, 0, "OS post-load tasks not necessary on 
$computer_name");
        }
        
        # Check if the VM has the expected number of CPUs

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm?rev=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm Fri Dec  5 
15:59:04 2014
@@ -196,7 +196,6 @@ sub load {
        my $driver_name = $self->get_driver_name();
        my $domain_xml_file_path = $self->get_domain_xml_file_path();
        
-       insertloadlog($reservation_id, $computer_id, "doesimageexists", "image 
exists $image_name");
        insertloadlog($reservation_id, $computer_id, "startload", 
"$computer_name $image_name");
 
 =item *
@@ -294,7 +293,7 @@ Call the domain guest OS module's 'post_
 
        if ($self->os->can("post_load")) {
                if ($self->os->post_load()) {
-                       insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "performed OS post-load tasks '$domain_name' domain on 
$node_name");
+                       notify($ERRORS{'OK'}, 0, "performed OS post-load tasks 
'$domain_name' domain on $node_name");
                }
                else {
                        notify($ERRORS{'WARNING'}, 0, "failed to perform OS 
post-load tasks on '$domain_name' domain on node $node_name");
@@ -302,7 +301,7 @@ Call the domain guest OS module's 'post_
                }
        }
        else {
-               insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "OS post-load tasks not necessary '$domain_name' domain on 
$node_name");
+               notify($ERRORS{'OK'}, 0, "OS post-load tasks not necessary 
'$domain_name' domain on $node_name");
        }
 
 =back

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm?rev=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/one.pm Fri Dec  5 
15:59:04 2014
@@ -268,7 +268,7 @@ sub load {
        # VM is created and loading, execute "post_load"
        if ($self->os->can("post_load")) {
                if ($self->os->post_load()) {
-                       insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "performed OS post-load tasks for $computer_name");
+                       notify($ERRORS{'OK'}, 0, "performed OS post-load tasks 
for $computer_name");
                }
                else {
                        notify($ERRORS{'WARNING'}, 0, "failed to perform OS 
post-load tasks on $computer_name");
@@ -276,7 +276,7 @@ sub load {
                }
        }
        else {
-               insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "OS post-load tasks not necessary $computer_name");
+               notify($ERRORS{'OK'}, 0, "OS post-load tasks not necessary 
$computer_name");
        }
        
        return 1;

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm?rev=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/openstack.pm Fri Dec  
5 15:59:04 2014
@@ -150,7 +150,6 @@ sub load {
        my $image_name = $self->data->get_image_name() || return;
        my $vmhost_name = $self->data->get_vmhost_short_name() || return;
 
-       insertloadlog($reservation_id, $computer_id, "doesimageexists", "image 
exists $image_name");
        insertloadlog($reservation_id, $computer_id, "startload", 
"$computer_name $image_name");
 
        # Remove existing VMs which were created for the reservation computer

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm?rev=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm Fri Dec  5 
15:59:04 2014
@@ -427,7 +427,7 @@ sub load {
        insertloadlog($reservation_id, $computer_id, "xcatround3", "initiating 
OS post-load configuration");
        if ($self->os->can("post_load")) {
                if ($self->os->post_load()) {
-                       insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "performed OS post-load tasks on $computer_node_name");
+                       notify($ERRORS{'OK'}, 0,  "performed OS post-load tasks 
on $computer_node_name");
                }
                else {
                        notify($ERRORS{'WARNING'}, 0, "failed to perform OS 
post-load tasks on VM $computer_node_name");
@@ -435,7 +435,7 @@ sub load {
                }
        }
        else {
-               insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "OS post-load tasks not necessary on $computer_node_name");
+               notify($ERRORS{'OK'}, 0, "OS post-load tasks not necessary on 
$computer_node_name");
        }
        
        return 1;

Modified: vcl/trunk/managementnode/lib/VCL/Module/State.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/State.pm?rev=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/State.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/State.pm Fri Dec  5 15:59:04 2014
@@ -704,12 +704,13 @@ sub state_exit {
                        }
                }
 
-               if($request_state_name_new eq 'complete') {
+               if($request_state_name_old =~ /complete|timeout|deleted/) {
                        
                        
delete_computerloadlog_reservation(\@reservation_ids,0,1);
                }
                
                # Delete all computerloadlog rows with loadstatename = 'begin' 
for all reservations in this request
+               # beginacknowledgetimeout required for web gui
                delete_computerloadlog_reservation(\@reservation_ids, 
'!beginacknowledgetimeout');
                
                # Update log.ending if this is the parent reservation and 
argument was supplied

Modified: vcl/trunk/managementnode/lib/VCL/new.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/new.pm?rev=1643339&r1=1643338&r2=1643339&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/new.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/new.pm Fri Dec  5 15:59:04 2014
@@ -332,6 +332,7 @@ sub process {
        
        # Parent only checks and waits for any other images to complete and 
checkin
        if ($reservation_is_parent && $reservation_count > 1) {
+               # Needed for computerloadflow   
                insertloadlog($reservation_id, $computer_id, "nodeready", 
"$computer_short_name is loaded with $image_name (cluster parent)");
                
                # Wait on child reservations
@@ -433,6 +434,7 @@ sub process {
        }
        
        # Add nodeready last before process exits, this is used by the cluster 
parent to determine when child reservations are ready
+       # Needed for computerloadflow   
        insertloadlog($reservation_id, $computer_id, "nodeready", 
"$computer_short_name is loaded with $image_name");
        
        notify($ERRORS{'OK'}, 0, "exiting");
@@ -582,6 +584,7 @@ sub reload_image {
                        
                        if ($self->provisioner->does_image_exist($image_name)) {
                                notify($ERRORS{'OK'}, 0, "$image_name exists on 
this management node");
+                               # Needed for computerloadflow   
                                insertloadlog($reservation_id, $computer_id, 
"doesimageexists", "confirmed image exists");
                        }
                        else {
@@ -590,6 +593,7 @@ sub reload_image {
                                # Try to retrieve the image files from another 
management node
                                if ($self->provisioner->can("retrieve_image")) {
                                        notify($ERRORS{'DEBUG'}, 0, "calling " 
. ref($self->provisioner) . "->retrieve_image()");
+                                       # Needed for computerloadflow   
                                        insertloadlog($reservation_id, 
$computer_id, "copyfrompartnerMN", "Retrieving image");
                                        
                                        if 
($self->provisioner->retrieve_image($image_name)) {
@@ -901,6 +905,8 @@ sub reserve_computer {
        my $request_state_name              = 
$self->data->get_request_state_name();
        my $request_logid                   = $self->data->get_request_log_id();
        my $reservation_is_parent           = 
$self->data->is_parent_reservation;
+       my $reservation_id                  = $self->data->get_reservation_id();
+       my $computer_id                     = $self->data->get_computer_id();
        my $computer_short_name             = 
$self->data->get_computer_short_name();
        my $image_prettyname                = 
$self->data->get_image_prettyname();
        my $user_affiliation_sitewwwaddress = 
$self->data->get_user_affiliation_sitewwwaddress();
@@ -910,6 +916,9 @@ sub reserve_computer {
        my $user_imtype_name                = 
$self->data->get_user_imtype_name();
        my $user_im_id                      = $self->data->get_user_im_id();
 
+       # Needed for computerloadflow   
+       insertloadlog($reservation_id, $computer_id, "addinguser", "Adding user 
to $computer_short_name");
+
        # Call OS module's reserve subroutine
        if (!$self->os->reserve()) {
                $self->reservation_failed("OS module failed to reserve 
resources for this reservation");


Reply via email to