Author: arkurth
Date: Mon Jul 26 20:08:24 2010
New Revision: 979423

URL: http://svn.apache.org/viewvc?rev=979423&view=rev
Log:
VCL-359
Removed sections from provisioning modules where the dynamic IP address is 
retrieved or the static IP address is set.  This is not handled by 
OS.pm::update_public_ip_address().  This is called by new.pm for every 
reservation.

Modified:
    
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm?rev=979423&r1=979422&r2=979423&view=diff
==============================================================================
--- 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
 (original)
+++ 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
 Mon Jul 26 20:08:24 2010
@@ -494,8 +494,7 @@ sub copy_virtual_disk {
        notify($ERRORS{'DEBUG'}, 0, "attempting to copy file: '$source_path' 
--> '$destination_path'
                         adapter type: $source_adapter_type --> 
$destination_adapter_type
                         disk type: $source_disk_type --> $destination_disk_type
-                        source file size: " . 
format_number($source_file_size_bytes) .
-                        "disk spec:\n" . format_data($virtual_disk_spec));
+                        source file size: " . 
format_number($source_file_size_bytes));
        
        my $start_time = time;
        eval { $virtual_disk_manager->CopyVirtualDisk(sourceName => 
$source_path,

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm?rev=979423&r1=979422&r2=979423&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm Mon 
Jul 26 20:08:24 2010
@@ -501,50 +501,6 @@ sub load {
                notify($ERRORS{'DEBUG'}, 0, ref($self->os) . "::post_load() has 
not been implemented");
        }
 
-       # Set IP info
-       if ($ip_configuration ne "manualDHCP") {
-               #not default setting
-               if ($ip_configuration eq "dynamicDHCP") {
-                       insertloadlog($reservation_id, $vmclient_computerid, 
"dynamicDHCPaddress", "collecting dynamic IP address for node");
-                       notify($ERRORS{'DEBUG'}, 0, "Attempting to query 
vmclient for its public IP...");
-                       my $assignedIPaddress = 
getdynamicaddress($computer_shortname, $vmclient_OSname, $image_os_type);
-                       if ($assignedIPaddress) {
-                               #update computer table
-                               notify($ERRORS{'DEBUG'}, 0, " Got dynamic 
address from vmclient, attempting to update database");
-                               if 
(update_computer_address($vmclient_computerid, $assignedIPaddress)) {
-                                       notify($ERRORS{'DEBUG'}, 0, " 
succesfully updated IPaddress of node $computer_shortname");
-                               }
-                               else {
-                                       notify($ERRORS{'CRITICAL'}, 0, "could 
not update dynamic address $assignedIPaddress for $computer_shortname 
$image_name");
-                                       return 0;
-                               }
-                       } ## end if ($assignedIPaddress)
-                       else {
-                               notify($ERRORS{'CRITICAL'}, 0, "could not fetch 
dynamic address from $computer_shortname $image_name");
-                               insertloadlog($reservation_id, 
$vmclient_computerid, "failed", "could not collect dynamic IP address for 
node");
-                               return 0;
-                       }
-               } ## end if ($ip_configuration eq "dynamicDHCP")
-               elsif ($ip_configuration eq "static") {
-                       notify($ERRORS{'CRITICAL'}, 0, "STATIC ASSIGNMENT NOT 
SUPPORTED. See vcld.conf");
-                       return 0;
-                       #insertloadlog($reservation_id, $vmclient_computerid, 
"staticIPaddress", "setting static IP address for node");
-                       #if (setstaticaddress($computer_shortname, 
$vmclient_OSname, $vmclient_publicIPaddress)) {
-                       #       # good set static address
-                       #}
-               }
-       } ## end if ($ip_configuration ne "manualDHCP")
-
-       # Perform post load tasks
-
-       # Check if OS module has implemented a post_load() subroutine
-       if ($self->os->can('post_load')) {
-               # If post-load has been implemented by the OS module, don't 
perform these tasks here
-               # new.pm calls the OS module's post_load() subroutine
-               notify($ERRORS{'DEBUG'}, 0, "post_load() has been implemented 
by the OS module, returning 1");
-               return 1;
-       }
-
        return 1;
 
 } ## end sub load

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm?rev=979423&r1=979422&r2=979423&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm 
Mon Jul 26 20:08:24 2010
@@ -553,48 +553,6 @@ sub load {
                notify($ERRORS{'OK'}, 0, "IP is known for $computer_shortname");
        }
        
-       # Check if OS module has implemented a post_load() subroutine
-       if ($self->os->can('post_load')) {
-               # If post-load has been implemented by the OS module, don't 
perform these tasks here
-               # new.pm calls the OS module's post_load() subroutine
-               notify($ERRORS{'DEBUG'}, 0, "post_load() has been implemented 
by the OS module, returning 1");
-               return 1;
-       }
-
-       # Set IP info
-       if ($ip_configuration ne "manualDHCP") {
-               #not default setting
-               if ($ip_configuration eq "dynamicDHCP") {
-                       insertloadlog($reservation_id, $vmclient_computerid, 
"dynamicDHCPaddress", "collecting dynamic IP address for node");
-                       notify($ERRORS{'DEBUG'}, 0, "Attempting to query 
vmclient for its public IP...");
-                       my $assignedIPaddress = 
getdynamicaddress($computer_shortname, $vmclient_OSname, $image_os_type);
-                       if ($assignedIPaddress) {
-                               #update computer table
-                               notify($ERRORS{'DEBUG'}, 0, " Got dynamic 
address from vmclient, attempting to update database");
-                               if 
(update_computer_address($vmclient_computerid, $assignedIPaddress)) {
-                                       notify($ERRORS{'DEBUG'}, 0, " 
succesfully updated IPaddress of node $computer_shortname");
-                               }
-                               else {
-                                       notify($ERRORS{'CRITICAL'}, 0, "could 
not update dynamic address $assignedIPaddress for $computer_shortname 
$image_name");
-                                       return 0;
-                               }
-                       } ## end if ($assignedIPaddress)
-                       else {
-                               notify($ERRORS{'CRITICAL'}, 0, "could not fetch 
dynamic address from $computer_shortname $image_name");
-                               insertloadlog($reservation_id, 
$vmclient_computerid, "failed", "could not collect dynamic IP address for 
node");
-                               return 0;
-                       }
-               } ## end if ($ip_configuration eq "dynamicDHCP")
-               elsif ($ip_configuration eq "static") {
-                       notify($ERRORS{'CRITICAL'}, 0, "STATIC ASSIGNMENT NOT 
SUPPORTED. See vcld.conf");
-                       return 0;
-                       #insertloadlog($reservation_id, $vmclient_computerid, 
"staticIPaddress", "setting static IP address for node");
-                       #if (setstaticaddress($computer_shortname, 
$vmclient_OSname, $vmclient_publicIPaddress)) {
-                       #       # good set static address
-                       #}
-               }
-       } ## end if ($ip_configuration ne "manualDHCP")
-       
        return 1;
 
 } ## end sub load

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm?rev=979423&r1=979422&r2=979423&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 
Mon Jul 26 20:08:24 2010
@@ -876,6 +876,8 @@ sub load {
                notify($ERRORS{'DEBUG'}, 0, ref($self->os) . "::post_load() has 
not been implemented");
        }
        
+       insertloadlog($reservation_id, $vmclient_computerid, "info", "starting 
post configurations on node");
+       
        #clear ssh public keys from /root/.ssh/known_hosts
        my $known_hosts = "/root/.ssh/known_hosts";
        my $ssh_keyscan = "/usr/bin/ssh-keyscan";
@@ -911,47 +913,6 @@ sub load {
                notify($ERRORS{'OK'}, 0, "could not open $known_hosts for 
editing the $computer_shortname public ssh key");
        }
 
-       insertloadlog($reservation_id, $vmclient_computerid, "info", "starting 
post configurations on node");
-       
-       #ipconfiguration
-       if ($ip_configuration ne "manualDHCP") {
-               #not default setting
-               if ($ip_configuration eq "dynamicDHCP") {
-                       insertloadlog($reservation_id, $vmclient_computerid, 
"dynamicDHCPaddress", "collecting dynamic IP address for node");
-                       my $assignedIPaddress = 
getdynamicaddress($computer_shortname, $vmclient_OSname, $image_os_type);
-                       if ($assignedIPaddress) {
-                               #update computer table
-                               if 
(update_computer_address($vmclient_computerid, $assignedIPaddress)) {
-                                       notify($ERRORS{'DEBUG'}, 0, " 
succesfully updated IPaddress of node $computer_shortname");
-                               }
-                               else {
-                                       notify($ERRORS{'CRITICAL'}, 0, "could 
not update dynamic address $assignedIPaddress for $computer_shortname 
$requestedimagename");
-                                       return 0;
-                               }
-                       } ## end if ($assignedIPaddress)
-                       else {
-                               notify($ERRORS{'CRITICAL'}, 0, "could not fetch 
dynamic address from $computer_shortname $requestedimagename");
-                               insertloadlog($reservation_id, 
$vmclient_computerid, "failed", "could not collect dynamic IP address for 
node");
-                               return 0;
-                       }
-               } ## end if ($ip_configuration eq "dynamicDHCP")
-               elsif ($ip_configuration eq "static") {
-                       insertloadlog($reservation_id, $vmclient_computerid, 
"staticIPaddress", "setting static IP address for node");
-                       if ($self->os->can("set_static_public_address") && 
$self->os->set_static_public_address()) {
-                               notify($ERRORS{'DEBUG'}, 0, "set static public 
address using OS module's set_static_public_address() method");
-                               insertloadlog($reservation_id, 
$vmclient_computerid, "staticIPaddress", "SUCCESS set static IP address on 
public interface");
-                       }
-                       elsif (setstaticaddress($computer_shortname, 
$vmclient_OSname, $vmclient_publicIPaddress, $image_os_type)) {
-                               # good set static address
-                               insertloadlog($reservation_id, 
$vmclient_computerid, "staticIPaddress", "SUCCESS set static IP address on 
public interface");
-                       }
-                       else {
-                               insertloadlog($reservation_id, 
$vmclient_computerid, "staticIPaddress", "failed to set static IP address on 
public interface");
-                               return 0;
-                       }
-               }
-       } ## end if ($ip_configuration ne "manualDHCP")
-           #
        insertloadlog($reservation_id, $vmclient_computerid, "vmwareready", 
"preformed post config on node");
        return 1;
 

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm?rev=979423&r1=979422&r2=979423&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm Mon 
Jul 26 20:08:24 2010
@@ -772,54 +772,6 @@ sub load {
                notify($ERRORS{'CRITICAL'}, 0, "could not execute 
$XCAT_ROOT/sbin/makesshgkh $computer_node_name $!");
        }
 
-       # IP configuration
-       if ($ip_configuration ne "manualDHCP") {
-               insertloadlog($reservation_id, $computer_id, "info", "detected 
change required in IP address configuration on node");
-
-               #not default setting
-               if ($ip_configuration eq "dynamicDHCP") {
-                       my $assignedIPaddress = 
getdynamicaddress($computer_node_name, $image_os_name, $image_os_type);
-                       if ($assignedIPaddress) {
-
-                               #update computer table
-                               if (update_computer_address($computer_id, 
$assignedIPaddress)) {
-                                       notify($ERRORS{'OK'}, 0, "dynamic 
address collected $assignedIPaddress -- updated computer table");
-                                       insertloadlog($reservation_id, 
$computer_id, "dynamicDHCPaddress", "SUCCESS collected dynamicDHCP address");
-                               }
-                               else {
-                                       notify($ERRORS{'OK'}, 0, "failed to 
update dynamic address $assignedIPaddress for$computer_id $computer_node_name 
");
-                                       insertloadlog($reservation_id, 
$computer_id, "dynamicDHCPaddress", "FAILED to update dynamicDHCP address 
failing reservation");
-                                       return 0;
-                               }
-                       } ## end if ($assignedIPaddress)
-                       else {
-                               notify($ERRORS{'CRITICAL'}, 0, "could not fetch 
dynamic address from $computer_node_name $image_name");
-                               insertloadlog($reservation_id, $computer_id, 
"dynamicDHCPaddress", "FAILED to collected dynamicDHCP address failing 
reservation");
-                               return 0;
-                       }
-               } ## end if ($ip_configuration eq "dynamicDHCP")
-               elsif ($ip_configuration eq "static") {
-                       insertloadlog($reservation_id, $computer_id, "info", 
"setting staticIPaddress");
-
-                       if ($self->os->can("set_static_public_address") && 
$self->os->set_static_public_address()) {
-                               notify($ERRORS{'DEBUG'}, 0, "set static public 
address using OS module's set_static_public_address() method");
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "SUCCESS set static IP address on public interface");
-                       }
-                       elsif (setstaticaddress($computer_node_name, 
$image_os_name, $computer_ip_address, $image_os_type)) {
-                               notify($ERRORS{'DEBUG'}, 0, "set static address 
on $computer_ip_address $computer_node_name ");
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "SUCCESS set static IP address on public interface");
-                       }
-                       else {
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "failed to set static IP address on public interface");
-                               return 0;
-                       }
-               } ## end elsif ($ip_configuration eq "static")  [ if 
($ip_configuration eq "dynamicDHCP")
-       } ## end if ($ip_configuration ne "manualDHCP")
-
-       # Perform post load tasks
-       
-
-
        return 1;
 } ## end sub load
 

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm?rev=979423&r1=979422&r2=979423&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT2.pm Mon 
Jul 26 20:08:24 2010
@@ -744,53 +744,6 @@ sub load {
                notify($ERRORS{'DEBUG'}, 0, ref($self->os) . "::post_load() has 
not been implemented");
        }
 
-       # Clear ssh public keys from /root/.ssh/known_hosts
-
-
-       # IP configuration
-       if ($ip_configuration ne "manualDHCP") {
-               insertloadlog($reservation_id, $computer_id, "info", "detected 
change required in IP address configuration on node");
-
-               #not default setting
-               if ($ip_configuration eq "dynamicDHCP") {
-                       my $assignedIPaddress = 
getdynamicaddress($computer_node_name, $image_os_name, $image_os_type);
-                       if ($assignedIPaddress) {
-
-                               #update computer table
-                               if (update_computer_address($computer_id, 
$assignedIPaddress)) {
-                                       notify($ERRORS{'OK'}, 0, "dynamic 
address collected $assignedIPaddress -- updated computer table");
-                                       insertloadlog($reservation_id, 
$computer_id, "dynamicDHCPaddress", "SUCCESS collected dynamicDHCP address");
-                               }
-                               else {
-                                       notify($ERRORS{'OK'}, 0, "failed to 
update dynamic address $assignedIPaddress for$computer_id $computer_node_name 
");
-                                       insertloadlog($reservation_id, 
$computer_id, "dynamicDHCPaddress", "FAILED to update dynamicDHCP address 
failing reservation");
-                                       return 0;
-                               }
-                       } ## end if ($assignedIPaddress)
-                       else {
-                               notify($ERRORS{'CRITICAL'}, 0, "could not fetch 
dynamic address from $computer_node_name $image_name");
-                               insertloadlog($reservation_id, $computer_id, 
"dynamicDHCPaddress", "FAILED to collected dynamicDHCP address failing 
reservation");
-                               return 0;
-                       }
-               } ## end if ($ip_configuration eq "dynamicDHCP")
-               elsif ($ip_configuration eq "static") {
-                       insertloadlog($reservation_id, $computer_id, "info", 
"setting staticIPaddress");
-
-                       if ($self->os->can("set_static_public_address") && 
$self->os->set_static_public_address()) {
-                               notify($ERRORS{'DEBUG'}, 0, "set static public 
address using OS module's set_static_public_address() method");
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "SUCCESS set static IP address on public interface");
-                       }
-                       elsif (setstaticaddress($computer_node_name, 
$image_os_name, $computer_ip_address, $image_os_type)) {
-                               notify($ERRORS{'DEBUG'}, 0, "set static address 
on $computer_ip_address $computer_node_name ");
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "SUCCESS set static IP address on public interface");
-                       }
-                       else {
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "failed to set static IP address on public interface");
-                               return 0;
-                       }
-               } ## end elsif ($ip_configuration eq "static")  [ if 
($ip_configuration eq "dynamicDHCP")
-       } ## end if ($ip_configuration ne "manualDHCP")
-
        return 1;
 } ## end sub load
 

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm?rev=979423&r1=979422&r2=979423&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm 
Mon Jul 26 20:08:24 2010
@@ -860,50 +860,6 @@ sub load {
        }
 =cut
 
-       # IP configuration
-       if ($ip_configuration ne "manualDHCP") {
-               insertloadlog($reservation_id, $computer_id, "info", "detected 
change required in IP address configuration on node");
-
-               #not default setting
-               if ($ip_configuration eq "dynamicDHCP") {
-                       my $assignedIPaddress = 
getdynamicaddress($computer_node_name, $image_os_name, $image_os_type);
-                       if ($assignedIPaddress) {
-
-                               #update computer table
-                               if (update_computer_address($computer_id, 
$assignedIPaddress)) {
-                                       notify($ERRORS{'OK'}, 0, "dynamic 
address collected $assignedIPaddress -- updated computer table");
-                                       insertloadlog($reservation_id, 
$computer_id, "dynamicDHCPaddress", "SUCCESS collected dynamicDHCP address");
-                               }
-                               else {
-                                       notify($ERRORS{'OK'}, 0, "failed to 
update dynamic address $assignedIPaddress for$computer_id $computer_node_name 
");
-                                       insertloadlog($reservation_id, 
$computer_id, "dynamicDHCPaddress", "FAILED to update dynamicDHCP address 
failing reservation");
-                                       return 0;
-                               }
-                       } ## end if ($assignedIPaddress)
-                       else {
-                               notify($ERRORS{'CRITICAL'}, 0, "could not fetch 
dynamic address from $computer_node_name $image_name");
-                               insertloadlog($reservation_id, $computer_id, 
"dynamicDHCPaddress", "FAILED to collected dynamicDHCP address failing 
reservation");
-                               return 0;
-                       }
-               } ## end if ($ip_configuration eq "dynamicDHCP")
-               elsif ($ip_configuration eq "static") {
-                       insertloadlog($reservation_id, $computer_id, "info", 
"setting staticIPaddress");
-
-                       if ($self->os->can("set_static_public_address") && 
$self->os->set_static_public_address()) {
-                               notify($ERRORS{'DEBUG'}, 0, "set static public 
address using OS module's set_static_public_address() method");
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "SUCCESS set static IP address on public interface");
-                       }
-                       elsif (setstaticaddress($computer_node_name, 
$image_os_name, $computer_ip_address, $image_os_type)) {
-                               notify($ERRORS{'DEBUG'}, 0, "set static address 
on $computer_ip_address $computer_node_name ");
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "SUCCESS set static IP address on public interface");
-                       }
-                       else {
-                               insertloadlog($reservation_id, $computer_id, 
"staticIPaddress", "failed to set static IP address on public interface");
-                               return 0;
-                       }
-               } ## end elsif ($ip_configuration eq "static")  [ if 
($ip_configuration eq "dynamicDHCP")
-       } ## end if ($ip_configuration ne "manualDHCP")
-
        return 1;
 } ## end sub load
 


Reply via email to