svn commit: r745658 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Wed Feb 18 21:20:30 2009 New Revision: 745658 URL: http://svn.apache.org/viewvc?rev=745658view=rev Log: VCL-97 missing 21 from system call and wasn't capturing the output Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=745658r1=745657r2=745658view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Wed Feb 18 21:20:30 2009 @@ -1363,7 +1363,7 @@ my $vmisoff = 0; - if (open(SSH, /usr/bin/ssh -x -i $IDENTITY_wxp $computer_nodename \C:\/Sysprep\/sysprep.cmd\ |)) { + if (open(SSH, /usr/bin/ssh -x -i $IDENTITY_wxp $computer_nodename \C:\/Sysprep\/sysprep.cmd\ 21 |)) { my $notstop = 1; my $loop= 0; while ($notstop) {
svn commit: r746313 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
Author: fapeeler Date: Fri Feb 20 18:06:29 2009 New Revision: 746313 URL: http://svn.apache.org/viewvc?rev=746313view=rev Log: VCL-99 change which of those are loaded query to determine loaded images modified to only consider a image loaded if exists two or more times Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=746313r1=746312r2=746313view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Fri Feb 20 18:06:29 2009 @@ -308,12 +308,15 @@ $inlist = join(',', @imgids); my $select_loaded = SELECT -DISTINCT(currentimageid) +DISTINCT(currentimageid), + COUNT(currentimageid) AS count FROM computer WHERE currentimageid IN ($inlist) -AND stateid = 2; +AND stateid = 2 + GROUP BY currentimageid + HAVING count 1; @data = database_select($select_loaded); my @loaded; foreach (@data) {
svn commit: r751700 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm
Author: fapeeler Date: Mon Mar 9 15:03:34 2009 New Revision: 751700 URL: http://svn.apache.org/viewvc?rev=751700view=rev Log: VCL-100 added a conditional check to account for new distro - This is the only location on the backend that still depends on the distro name. This will be removed at a future date once a method for generalizing Linux distros is pushed to the database or we get away from using distros in the prefix of the internal imagename. Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm?rev=751700r1=751699r2=751700view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm Mon Mar 9 15:03:34 2009 @@ -364,6 +364,10 @@ # Change rhelX -- rhXimage, rhfcX -- fcXimage $image_os_name_new = $1$2image; } + elsif($image_os_name =~ /^(centos)([0-9])/) { + # Change rhelX -- rhXimage, rhfcX -- fcXimage + $image_os_name_new = $1$2image; + } else { notify($ERRORS{'OK'}, 0, no corrections need to be made to image OS: $image_os_name); return 1;
svn commit: r752885 - in /incubator/vcl/trunk/managementnode/lib/VCL: inuse.pm new.pm
Author: fapeeler Date: Thu Mar 12 15:02:03 2009 New Revision: 752885 URL: http://svn.apache.org/viewvc?rev=752885view=rev Log: VCL-107 Added additional information about automated notice and instructions on how to disable email notifications. Modified: incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm incubator/vcl/trunk/managementnode/lib/VCL/new.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm?rev=752885r1=752884r2=752885view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm Thu Mar 12 15:02:03 2009 @@ -596,6 +596,19 @@ Thank You, VCL Team + + +** +This is an automated notice. If you need assistance please respond +with detailed information on the issue and a help ticket will be +generated. + +To disable email notices +-Visit $affiliation_sitewwwaddress +-Select User Preferences +-Select General Preferences + +** EOF my $subject = VCL -- $notice_interval until end of reservation; @@ -677,8 +690,21 @@ Visit $affiliation_sitewwwaddress and select Current Reservations to edit this reservation. -Thank you, +Thank You, VCL Team + + +** +This is an automated notice. If you need assistance please respond +with detailed information on the issue and a help ticket will be +generated. + +To disable email notices +-Visit $affiliation_sitewwwaddress +-Select User Preferences +-Select General Preferences + +** EOF my $short_message = $user_preferredname, You have $disconnect_string until the end of your reservation. Please save all work and prepare to log off.; @@ -751,8 +777,21 @@ To make another reservation, please revisit: $affiliation_sitewwwaddress -Thank you +Thank You, VCL Team + + +** +This is an automated notice. If you need assistance please respond +with detailed information on the issue and a help ticket will be +generated. + +To disable email notices +-Visit $affiliation_sitewwwaddress +-Select User Preferences +-Select General Preferences + +** EOF my $subject = VCL -- reservation timeout; @@ -807,6 +846,19 @@ Regards, VCL Team + + +** +This is an automated notice. If you need assistance please respond +with detailed information on the issue and a help ticket will be +generated. + +To disable email notices +-Visit $affiliation_sitewwwaddress +-Select User Preferences +-Select General Preferences + +** EOF # Send mail Modified: incubator/vcl/trunk/managementnode/lib/VCL/new.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/new.pm?rev=752885r1=752884r2=752885view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/new.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/new.pm Thu Mar 12 15:02:03 2009 @@ -1229,6 +1229,19 @@ $mailstring .= EOF; Thank You, VCL Team + + +** +This is an automated notice. If you need assistance please respond +with detailed information on the issue and a help ticket will be +generated. + +To disable email notices +-Visit $user_affiliation_sitewwwaddress +-Select User Preferences +-Select General Preferences + +** EOF if ($user_emailnotices) { mail($user_email, $subject, $mailstring, $user_affiliation_helpaddress); @@ -1266,8 +1279,23 @@ -Select Current Reservations -Click the Connect button to acknowledge + Thank You, VCL Team + + + +** +This is an automated notice. If you need assistance please respond +with detailed information on the issue and a help ticket will be +generated. + +To disable email notices +-Visit $user_affiliation_sitewwwaddress +-Select User Preferences +-Select General Preferences + +** EOF if ($user_emailnotices) {
svn commit: r757522 - in /incubator/vcl/trunk/managementnode: etc/vcl/vcld.conf lib/VCL/utils.pm
Author: fapeeler Date: Mon Mar 23 19:59:59 2009 New Revision: 757522 URL: http://svn.apache.org/viewvc?rev=757522view=rev Log: VCL-117 Left hardcoded value for the return-path sendmail -f option in the utils:mail routine created a global value that gets set in the vcld.conf file RETURNPATH Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=757522r1=757521r2=757522view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Mon Mar 23 19:59:59 2009 @@ -98,6 +98,11 @@ # Example: john_...@ncsu.edu,sysadm...@vcl.ncsu.edu sysadmin= +#Sendmail envelope sender -- Return-path +#The return-path should be set if you want email delivery failures to go +#to a common place +#set this to a known working address that would recieve mail like b...@yourdomain.com +RETURNPATH= # shared mailbox - # address of a shared mailbox for copies of all notices sent to users Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=757522r1=757521r2=757522view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Mon Mar 23 19:59:59 2009 @@ -7158,15 +7158,21 @@ predictivemodule.prettyname AS predictive_prettyname, predictivemodule.description AS predictive_description, predictivemodule.perlpackage AS predictive_perlpackage, - state.name AS statename + state.name AS statename, + resource.id AS resource_id FROM managementnode, module predictivemodule, - state + state, + resource, + resourcetype WHERE managementnode.predictivemoduleid = predictivemodule.id AND managementnode.stateid = state.id - AND + AND resource.resourcetypeid = resourcetype.id + AND resource.subid = managementnode.id + AND resourcetype.name = \'managementnode\' + AND ; # Figure out if the ID or hostname was passed as the identifier and complete the SQL statement @@ -7262,6 +7268,100 @@ #/ +=head2 get_management_node_resource_groups + + Parameters : mangement node resource id + Returns : Hash containing data contained in the managementnode table + Description : + +=cut + +sub get_management_node_resource_groups { + my ($management_resource_id) = @_; + my ($package, $filename, $line, $sub) = caller(0); + + if (!(defined($management_resource_id))) { + notify($ERRORS{'WARNING'}, 0, management resource ID was not specified); + return (); + } + + my $select_statement = + SELECT DISTINCT + resourcegroupid AS resourcegroupid + FROM + resourcegroupmembers + WHERE resourceid = $management_resource_id +; + + # Call the database select subroutine + # This will return an array of one or more rows based on the + # select statement + my @selected_rows = database_select($select_statement); + + # Check to make sure 1 or more rows were returned + if (scalar @selected_rows == 0) { + return (); + } + + #Build the list + my %ret_grouplist; + + for (@selected_rows) { +my %resroucegroupids = %{$_}; +$ret_grouplist{$resroucegroupids{resourcegroupid}}= $resroucegroupids{resourcegroupid}; + } + + return %ret_grouplist; + +} + +#/ + +=head2 get_managementnode_computer_groups + + Parameters : mangement node resource group id + Returns : Hash containing computer groups controlled by resource group + Description : + +=cut + +sub get_managementnode_computer_groups { + my $manging_resource_grp_id = @_; + my ($package, $filename, $line, $sub) = caller(0); + + if (!(defined($manging_resource_grp_id))) { + notify($ERRORS{'WARNING'}, 0, management resource group ID was not specified); + return (); + } + + my $select_statement = + SELECT DISTINCT + resourcemap.resourcegroupid2 + FROM + resourcemap, + resourcetype + WHERE + resourcemap.resourcetypeid2 = resourcetype.id + AND resourcemap.resourcegroupid1 = $manging_resource_grp_id + AND resourcetype.name = 'computer' +; + + # Call the database select subroutine + # This will return an array of one or more rows based on the + # select statement + my @selected_rows = database_select
svn commit: r760019 - /incubator/vcl/KEYS
Author: fapeeler Date: Mon Mar 30 15:50:52 2009 New Revision: 760019 URL: http://svn.apache.org/viewvc?rev=760019view=rev Log: Added Aaron Peeler's (fapeeler) GPG Key Modified: incubator/vcl/KEYS Modified: incubator/vcl/KEYS URL: http://svn.apache.org/viewvc/incubator/vcl/KEYS?rev=760019r1=760018r2=760019view=diff == --- incubator/vcl/KEYS (original) +++ incubator/vcl/KEYS Mon Mar 30 15:50:52 2009 @@ -128,3 +128,44 @@ rLU= =J6cL -END PGP PUBLIC KEY BLOCK- + +/* + ** Aaron Peeler + */ + +pub 1024D/B2FAB885 2009-03-30 +uid Aaron Peeler fapee...@apache.org +sig 3B2FAB885 2009-03-30 Aaron Peeler fapee...@apache.org +sub 2048g/7C3C65BB 2009-03-30 +sig B2FAB885 2009-03-30 Aaron Peeler fapee...@apache.org + +-BEGIN PGP PUBLIC KEY BLOCK- +Version: GnuPG v1.4.1 (Darwin) + +mQGhBEnQ6VoRBACojmRiL/dxXWqEn8MUwEXyzaSLawJxcj5SbQlDXrdqPZUCv7i+ +JdiTWdpVqdKaIzd/H9/6BrgpUo0kD4xVX5mf6z7akkXGQe/OZ46Br8FxJIE9VQ/K +F7a3VlMObsHLPT+sx2en+t43HW9ngssYBY4sqRrOfDtsQ0lL6eqvSOCADwCghuAN +4LXRMZb498jjVQD4gUq5z7sD/0ZOH9UtzH/x1TBzeV8TqzWL1ggM8uSkyjmjQcIZ +YxSox8fZdk5VRodh7+MyzDxF7qIv96rNBp19c3aCc3lu9P6Kl8cJFI8417FLDrag +ExJMjsUR5U48CNZl7ZvDUbN0NzgJtTJSZmV+jp28k+KZKjGFe//1QbxdFKIKm1ej +4lJ6A/jQtOk3d7R/2Xjk/SChT5WIsjwfbSR/Itqu4DR5kSZjq/HvMdZR8FS23Xzy +jOGL55Ulb3tU/xD3RorIQDRlArm2mOsXgyEbgf/tT6zxt9KS61qHFuEUPwlfzP2j +Le8D6EDoGMqg8aRxCj0U2pttvBmCTLfXU/nAlk9cO1fhYvh1tCJBYXJvbiBQZWVs +ZXIgPGZhcGVlbGVyQGFwYWNoZS5vcmc+iF4EExECAB4FAknQ6VoCGwMGCwkIBwMC +AxUCAwMWAgECHgECF4AACgkQO1It4bL6uIWX5wCfa1rx8qn9+AGTdG3TLvvmaIdM +uOgAnRtnw6Yme7hoXQlbMaYNLgM9egOQuQINBEnQ6X0QCACAcEclQLkBynn9rUss +oUqrP1hP7KwrQcNiByyRlYn0nFodX94AC3u4uno0G1OxXLlphQ/4tZwl7YqsZt4G +kKlPiwomiHhI6D+5MKjD4eqCHCnA1BPceFagLVKPJ5VHAtJ/wb41lPDJsDi0yBLP +JMq+pwmXwZcogyeNYfDp0eXbrxebm1ey3EYkMwUgZ9Dlr0yFJ0N1W0Jn87lQJZ8B +qXvBpuvsMx//sG6wsLhbO69nQfJOiIsrfwyO90X4NYmIPuBqtwcWl/Gi7pJKhVO9 +rZT/sCYwjZ2EILt7f+g4XEft0iX0LLKDbWl1ERb0uru7CUB1NrO2sWabtOuEBS51 +P9ZrAAMGB/46kzsxwXnb8iDmUmYK50/jqjv/o3K1kpEyGJwd4cE3hgMn//SnAKZG +HehaNWih+E7PJUIP3e0UHIpjmnW/3oHZxsvE/Yey4PDypr+J6vc8ZsbNAYGKQqyJ +06mQn5pcvp1zzJdS6UPars/WPoGufgMjl1n/W11DvEOAxY9DHsEpRicZOsXOPy1p +bGzFE/oaIx5yqkaBISzdhX/GDImxh/ZS02miTFgOrc+1zhVZD5ZBaDmTgBCiWlAF +uzXofrs+iLBOJMPgta7Hz8174LIS0oJnkdLZIevo+Uwn3HvfI2nNt4+kTtedJlFb +Ol3PhIHxUkwWPblsxcfSXeyAgVBt8QsPiEkEGBECAAkFAknQ6X0CGwwACgkQO1It +4bL6uIW4HwCffburiBiZASzV3NfeRhw8fySww3gAnjzcMd8ER94ykrdPEnji79GE +CCnD +=69L7 +-END PGP PUBLIC KEY BLOCK-
svn commit: r766850 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Mon Apr 20 20:19:08 2009 New Revision: 766850 URL: http://svn.apache.org/viewvc?rev=766850view=rev Log: VCL-1 added xCAT2.1 to module and provisioning tables Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=766850r1=766849r2=766850view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Mon Apr 20 20:19:08 2009 @@ -1251,7 +1251,8 @@ (7, 'os_winvista', 'Windows Vista OS Module', '', 'VCL::Module::OS::Windows::Desktop::Vista'), (8, 'predictive_level_0', 'Predictive Loading Level 0 Module', '', 'VCL::Module::Predictive::Level_0'), (9, 'predictive_level_1', 'Predictive Loading Level 1 Module', '', 'VCL::Module::Predictive::Level_1'), -(10, 'provisioning_esx_server', 'VMWare ESX Provisioning Module', '', 'VCL::Module::Provisioning::esx'); +(10, 'provisioning_esx_server', 'VMWare ESX Provisioning Module', '', 'VCL::Module::Provisioning::esx'), +(11, 'provisioning_xcat_2_1', 'xCAT 2.1 Provisioning Module', 'Extreme Cluster Administration Toolkit 2.1 VCL support module', 'VCL::Module::Provisioning::xCAT21'); -- -- Dumping data for table `OS` @@ -1332,7 +1333,8 @@ (1, 'xcat', 'xCAT 1.x Provisioning', 1), (2, 'vmware_server', 'VMWare Server Provisioning', 2), (3, 'lab', 'Computing Lab Provisioning', 3), -(4, 'esx', 'VMWare ESX', 10); +(4, 'esx', 'VMWare ESX', 10), +(5, 'xcat21', 'xCAT 2.1 Provisioning', 11); -- -- Dumping data for table `resource`
svn commit: r771912 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Tue May 5 16:38:37 2009 New Revision: 771912 URL: http://svn.apache.org/viewvc?rev=771912view=rev Log: VCL-6 Added two routines update_computer_lastcheck: updates the lastcheck time of a given computerid - primarily called by healthcheck update_computer_imagename: updates the computer imageid and imagerevisionid based on the input of a imagename Extended get_imagerevision_info to accept either a imagerevisionid or the imagename Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=771912r1=771911r2=771912view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Tue May 5 16:38:37 2009 @@ -184,7 +184,9 @@ update_cluster_info update_computer_address update_computer_state + update_computer_lastcheck update_currentimage + update_computer_imagename update_image_name update_lastcheckin update_log_ending @@ -2324,6 +2326,50 @@ #/ +=head2 update_computer_lastcheck + + Parameters : $computer_id, $datestring, $log + Returns : 1 success 0 failure + Description : update computer state + +=cut + +sub update_computer_lastcheck { + my ($computer_id, $datestring, $log) = @_; + + my ($package, $filename, $line, $sub) = caller(0); + $log = 0 unless (defined $log); + + notify($ERRORS{'WARNING'}, $log, computer id is not defined) unless (defined($computer_id)); + notify($ERRORS{'WARNING'}, $log, $datestring is not defined) unless (defined($datestring)); + return 0 unless (defined $computer_id); + + unless (defined($datestring) ) { + $datestring = makedatestring; + } + + my $update_statement = + UPDATE + computer + SET + computer.lastcheck = '$datestring' + WHERE + computer.id = $computer_id + ; + + # Call the database execute subroutine + if (database_execute($update_statement)) { + # Update successful + notify($ERRORS{'DEBUG'}, $log, computer $computer_id lastcheck updated to: $datestring); + return 1; + } + else { + notify($ERRORS{'CRITICAL'}, $log, unable to update datestring for computer $computer_id); + return 0; + } +} ## end +#/ + =head2 update_request_password Parameters : $reservation_id, $password @@ -6289,34 +6335,39 @@ =cut - sub get_imagerevision_info { - my ($imagerevision_id) = @_; + my ($imagerevision) = @_; my ($package, $filename, $line, $sub) = caller(0); # Check the passed parameter - if (!(defined($imagerevision_id))) { + if (!(defined($imagerevision))) { notify($ERRORS{'WARNING'}, 0, imagerevision ID was not specified); return (); } - # If imagemetaid isnt' NULL, perform another query to get the meta info my $select_statement = SELECT imagerevision.* FROM imagerevision WHERE - imagerevision.id = '$imagerevision_id' ; + #Check input value - complete select_statement + if($imagerevision =~ /^\d/){ + $select_statement .= imagerevision.id = '$imagerevision'; + } + else{ + $select_statement .= imagerevision.imagename = '$imagerevision'; + } + # Call the database select subroutine # This will return an array of one or more rows based on the select statement my @selected_rows = database_select($select_statement); # Check to make sure 1 row was returned if (scalar @selected_rows == 0) { - notify($ERRORS{'OK'}, 0, imagerevision id $imagerevision_id was not found in the database, 0 rows were returned); + notify($ERRORS{'OK'}, 0, imagerevision id $imagerevision was not found in the database, 0 rows were returned); return (); } elsif (scalar @selected_rows 1) { @@ -7284,6 +7335,56 @@ #/ +=head2 update_computer_imagename + + Parameters : $computerid, $imagename + Returns : 0 failed or 1 success + Description : Updates currentimage on a node, based on imagename only + +=cut +sub update_computer_imagename { + my ($computerid, $imagename, $log) = @_; + + my ($package,$filename, $line,$sub) = caller(0); + + # Check the passed parameters + if (!(defined($computerid))) { + notify($ERRORS{'WARNING'}, 0, computer ID was not specified
svn commit: r771936 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Tue May 5 17:06:23 2009 New Revision: 771936 URL: http://svn.apache.org/viewvc?rev=771936view=rev Log: VCL-7 updated node_status routine so it can be called by tools outside of vcld - specifically healthcheck node_status: - extended to accept non-class method calls - changed basic flow to always get the state of a vm - vmstate is now on,off,stuck instead of 0,1 Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=771936r1=771935r2=771936view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Tue May 5 17:06:23 2009 @@ -53,6 +53,7 @@ use strict; use warnings; use diagnostics; +use English qw( -no_match_vars ); use VCL::utils; use Fcntl qw(:DEFAULT :flock); @@ -391,12 +392,12 @@ if ($a =~ /^(on|off|stuck)/i) { $vmlist{$v}{state} = $a; } - else{ + else { notify($ERRORS{'WARNING'}, 0, unknown state $a for $vmlist{$v}{path} on $hostnode); $vmlist{$v}{state} = $a; } - } + } ## end foreach $a (@{$sshcmd_2[1]}) } ## end foreach my $v (keys %vmlist) notify($ERRORS{'OK'}, 0, ls datastorepath $datastorepath ); my @sshcmd_3 = run_ssh_command($hostnode, $identity, ls -1 $datastorepath, root); @@ -831,18 +832,18 @@ #good vm still on notify($ERRORS{'OK'}, 0, vm $computer_shortname reports on); - if($sloop 15 ){ + if ($sloop 15) { my $sshd_status = _sshd_status($computer_shortname, $requestedimagename); - if ($sshd_status eq on) { -notify($ERRORS{'OK'}, 0, $computer_shortname now has active sshd running, maybe we missed the READY flag setting STAGE5 flag); -$s5 = 1; -#speed this up a bit -close(TAIL); -goto VMWAREROUND2; - } - } + if ($sshd_status eq on) { + notify($ERRORS{'OK'}, 0, $computer_shortname now has active sshd running, maybe we missed the READY flag setting STAGE5 flag); + $s5 = 1; + #speed this up a bit + close(TAIL); + goto VMWAREROUND2; + } + } ## end if ($sloop 15) - } + } ## end if ($l =~ /= on/) elsif ($l =~ /= off/) { #good vm still on notify($ERRORS{'CRITICAL'}, 0, state of vm $computer_shortname reports off after pass number $sloop attempting to restart: start attempts $vmware_starts); @@ -918,7 +919,7 @@ $sloop = $sloop - 5; } - my $sshd_status = _sshd_status($computer_shortname, $requestedimagename,$image_os_type); + my $sshd_status
svn commit: r772300 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Wed May 6 15:20:15 2009 New Revision: 772300 URL: http://svn.apache.org/viewvc?rev=772300view=rev Log: VCL-7 changed return value for node_status to always return hash - if node was not pingable it returned a scalar value with just RELOAD - tobe consistent - removed the return value at affected check Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=772300r1=772299r2=772300view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Wed May 6 15:20:15 2009 @@ -2134,7 +2134,7 @@ else { notify($ERRORS{'OK'}, $log, $vmclient_shortname is not pingable ($status{ping})); $status{status} = 'RELOAD'; - return $status{status}; + $status{ping} = 0; } my $vmx_directory = $requestedimagename$vmclient_shortname;
svn commit: r781760 - /incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm
Author: fapeeler Date: Thu Jun 4 14:51:06 2009 New Revision: 781760 URL: http://svn.apache.org/viewvc?rev=781760view=rev Log: VCL-15 Converted to use xmlrpc calls, eliminates duplication of code on backend. moved all sql queries to sub routines in utils. Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm?rev=781760r1=781759r2=781760view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Thu Jun 4 14:51:06 2009 @@ -75,7 +75,7 @@ =cut sub initialize { - my $self= shift; + my $self = shift; # Initialize the database handle count $ENV{dbh_count} = 0; @@ -88,18 +88,12 @@ notify($ERRORS{'WARNING'}, 0, unable to obtain a database handle for this state process); } - # Store the name of this class in an environment variable $ENV{class_name} = ref($self); # Rename this process to include some request info rename_vcld_process($self-data); - # Call the old _initialize subroutine - if (!$self-_initialize()) { - return 0; - } - notify($ERRORS{'OK'}, 0, returning 1); return 1; @@ -108,354 +102,6 @@ =pod /// -/// \fn function _initialize -/// -/// \param hash data structure of the referenced object -/// -/// \return -/// -/// \brief collects data based this modules goals, sets up data structure -/// - -=cut - -sub _initialize { - my $self= shift; - my $request = $self-data-get_blockrequest_data(); - my ($package, $filename, $line) = caller; - - # Create a new database handler - my $dbh = getnewdbh(); - - # Retrieve data from the data structure - my $blockrequest_id = $self-data-get_blockrequest_id(); - my $blockrequest_mode= $self-data-get_blockrequest_mode(); - my $blockrequest_image_id= $self-data-get_blockrequest_image_id(); - my $blockrequest_number_machines = $self-data-get_blockrequest_number_machines(); - my $blockrequest_expire = $self-data-get_blockrequest_expire(); - my $blocktime_id = $self-data-get_blocktime_id(); - my $blocktime_processed = $self-data-get_blocktime_processed(); - my $blocktime_start = $self-data-get_blocktime_start(); - my $blocktime_end= $self-data-get_blocktime_end(); - - notify($ERRORS{'DEBUG'}, 0, blockrequest id: $blockrequest_id); - notify($ERRORS{'DEBUG'}, 0, blockrequest mode: $blockrequest_mode); - notify($ERRORS{'DEBUG'}, 0, blockrequest image id: $blockrequest_image_id); - notify($ERRORS{'DEBUG'}, 0, blockrequest number machines: $blockrequest_number_machines); - notify($ERRORS{'DEBUG'}, 0, blockrequest expire: $blockrequest_expire); - notify($ERRORS{'DEBUG'}, 0, blocktime id: $blocktime_id); - notify($ERRORS{'DEBUG'}, 0, blocktime processed: $blocktime_processed); - notify($ERRORS{'DEBUG'}, 0, blocktime start: $blocktime_start); - notify($ERRORS{'DEBUG'}, 0, blocktime end: $blocktime_end); - - sleep 2; - - #record my process start time - $request-{myprocessStart} = convert_to_epoch_seconds(); - - - # active db handle ? - if (!($dbh-ping)) { - notify($ERRORS{'WARNING'}, 0, database handle died, trying to create another one); - $dbh = getnewdbh(); - notify($ERRORS{'OK'}, 0, database handle re-est) if ($dbh-ping); - notify($ERRORS{'WARNING'}, 0, database handle NOT re-set) if (!($dbh-ping)); - } - - #get the production imagerevision - my $imageselh = $dbh-prepare( - SELECT ir.imagename,ir.id - FROM imagerevision ir - WHERE ir.production = 1 AND ir.imageid = ?) or notify($ERRORS{'WARNING'}, 0, block request Could not prepare selecting production image from imagerevision . $dbh-errstr()); - - $imageselh-execute($blockrequest_image_id) or notify($ERRORS{'WARNING'}, 0, block request Could not execute selecting production image from imagerevision . $dbh-errstr()); - my $imagerows = $imageselh-rows; - my @imagerow; - if ($imagerows != 0) { - @imagerow = $imageselh-fetchrow_array; - $request-{imagename} = $imagerow[0]; - $request-{imagerevisionid
svn commit: r785361 - in /incubator/vcl/trunk/managementnode/lib/VCL: DataStructure.pm utils.pm
Author: fapeeler Date: Tue Jun 16 20:05:03 2009 New Revision: 785361 URL: http://svn.apache.org/viewvc?rev=785361view=rev Log: VCL-3 Removed deptid and all references to dept table. This is an unused variable. Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=785361r1=785360r2=785361view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Tue Jun 16 20:05:03 2009 @@ -180,7 +180,6 @@ $SUBROUTINE_MAPPINGS{computer_current_image_id} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimageid}'; $SUBROUTINE_MAPPINGS{computer_deleted} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{deleted}'; -$SUBROUTINE_MAPPINGS{computer_department_id}= '$self-request_data-{reservation}{RESERVATION_ID}{computer}{deptid}'; $SUBROUTINE_MAPPINGS{computer_drive_type} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{drivetype}'; $SUBROUTINE_MAPPINGS{computer_dsa} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{dsa}'; $SUBROUTINE_MAPPINGS{computer_dsa_pub} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{dsapub}'; @@ -255,7 +254,6 @@ $SUBROUTINE_MAPPINGS{computer_currentimage_architecture}= '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimage}{architecture}'; $SUBROUTINE_MAPPINGS{computer_currentimage_deleted} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimage}{deleted}'; -$SUBROUTINE_MAPPINGS{computer_currentimage_deptid} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimage}{deptid}'; $SUBROUTINE_MAPPINGS{computer_currentimage_forcheckout} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimage}{forcheckout}'; $SUBROUTINE_MAPPINGS{computer_currentimage_id} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimage}{id}'; $SUBROUTINE_MAPPINGS{computer_currentimage_imagemetaid} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimage}{imagemetaid}'; @@ -286,13 +284,10 @@ $SUBROUTINE_MAPPINGS{computer_currentimagerevision_revision}= '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimagerevision}{revision}'; $SUBROUTINE_MAPPINGS{computer_currentimagerevision_userid} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{currentimagerevision}{userid}'; -$SUBROUTINE_MAPPINGS{computer_dept_name} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{dept}{name}'; -$SUBROUTINE_MAPPINGS{computer_dept_prettyname} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{dept}{prettyname}'; $SUBROUTINE_MAPPINGS{computer_platform_name} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{platform}{name}'; $SUBROUTINE_MAPPINGS{computer_preferredimage_architecture} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{preferredimage}{architecture}'; $SUBROUTINE_MAPPINGS{computer_preferredimage_deleted}= '$self-request_data-{reservation}{RESERVATION_ID}{computer}{preferredimage}{deleted}'; -$SUBROUTINE_MAPPINGS{computer_preferredimage_deptid} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{preferredimage}{deptid}'; $SUBROUTINE_MAPPINGS{computer_preferredimage_forcheckout}= '$self-request_data-{reservation}{RESERVATION_ID}{computer}{preferredimage}{forcheckout}'; $SUBROUTINE_MAPPINGS{computer_preferredimage_id} = '$self-request_data-{reservation}{RESERVATION_ID}{computer}{preferredimage}{id}'; $SUBROUTINE_MAPPINGS{computer_preferredimage_imagemetaid}= '$self-request_data-{reservation}{RESERVATION_ID}{computer}{preferredimage}{imagemetaid}'; @@ -329,7 +324,6 @@ $SUBROUTINE_MAPPINGS{image_architecture} = '$self-request_data-{reservation}{RESERVATION_ID}{image}{architecture}'; $SUBROUTINE_MAPPINGS{image_deleted}= '$self-request_data-{reservation}{RESERVATION_ID}{image}{deleted}'; -$SUBROUTINE_MAPPINGS{image_deptid} = '$self-request_data-{reservation}{RESERVATION_ID}{image}{deptid}'; $SUBROUTINE_MAPPINGS{image_forcheckout}= '$self-request_data-{reservation}{RESERVATION_ID}{image}{forcheckout}'; $SUBROUTINE_MAPPINGS{image_id} = '$self-request_data-{reservation}{RESERVATION_ID}{image}{id}'; $SUBROUTINE_MAPPINGS{image_identity} = '$self-request_data-{reservation}{RESERVATION_ID}{image}{IDENTITY}'; @@ -354,8 +348,6 @@ $SUBROUTINE_MAPPINGS{image_test}= '$self-request_data-{reservation}{RESERVATION_ID}{image
svn commit: r785700 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Wed Jun 17 16:18:06 2009 New Revision: 785700 URL: http://svn.apache.org/viewvc?rev=785700view=rev Log: VCL-3 removed: computer.deptid image.deptid dept table curriculum table schedule.?start schedule.?end schedule.contactemail schedule.interlockid schedule.deptid app table request.reservationid user.middlename group table reservation.start reservation.end reservation.daterequested reservation.datemodified request.imageid imageapplist tabl Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=785700r1=785699r2=785700view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Wed Jun 17 16:18:06 2009 @@ -194,7 +194,6 @@ `id` smallint(5) unsigned NOT NULL auto_increment, `stateid` tinyint(5) unsigned NOT NULL default '10', `ownerid` mediumint(8) unsigned default '1', - `deptid` tinyint(3) unsigned NOT NULL default '1', `platformid` tinyint(3) unsigned NOT NULL default '0', `scheduleid` tinyint(3) unsigned default NULL, `currentimageid` smallint(5) unsigned NOT NULL default '0', @@ -231,7 +230,6 @@ UNIQUE KEY `eth0macaddress` (`eth0macaddress`), KEY `ownerid` (`ownerid`), KEY `stateid` (`stateid`), - KEY `deptid` (`deptid`), KEY `platformid` (`platformid`), KEY `scheduleid` (`scheduleid`), KEY `currentimageid` (`currentimageid`), @@ -313,33 +311,6 @@ KEY `expiretime` (`expiretime`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; --- - --- --- Table structure for table `curriculum` --- - -CREATE TABLE IF NOT EXISTS `curriculum` ( - `id` smallint(5) unsigned NOT NULL auto_increment, - `name` varchar(30) NOT NULL default '', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; - --- - --- --- Table structure for table `dept` --- - -CREATE TABLE IF NOT EXISTS `dept` ( - `id` tinyint(3) unsigned NOT NULL auto_increment, - `name` varchar(5) NOT NULL default '', - `prettyname` varchar(50) NOT NULL default '', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`), - UNIQUE KEY `prettyname` (`prettyname`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- @@ -365,7 +336,6 @@ `name` varchar(70) NOT NULL default '', `prettyname` varchar(60) NOT NULL default '', `ownerid` mediumint(8) unsigned default '1', - `deptid` tinyint(3) unsigned NOT NULL default '1', `platformid` tinyint(3) unsigned NOT NULL default '0', `OSid` tinyint(3) unsigned NOT NULL default '0', `imagemetaid` smallint(5) unsigned default NULL, @@ -390,7 +360,6 @@ UNIQUE KEY `name` (`name`), UNIQUE KEY `prettyname` (`prettyname`), KEY `ownerid` (`ownerid`), - KEY `deptid` (`deptid`), KEY `platformid` (`platformid`), KEY `OSid` (`OSid`), KEY `imagemetaid` (`imagemetaid`) @@ -656,7 +625,6 @@ `id` mediumint(8) unsigned NOT NULL auto_increment, `stateid` tinyint(3) unsigned NOT NULL default '0', `userid` mediumint(8) unsigned NOT NULL default '0', - `reservationid` mediumint(8) unsigned NOT NULL default '0', `laststateid` tinyint(3) unsigned NOT NULL default '0', `logid` int(10) unsigned NOT NULL default '0', `forimaging` tinyint(1) unsigned NOT NULL default '0', @@ -888,9 +856,7 @@ `uid` int(10) unsigned default NULL, `unityid` varchar(80) NOT NULL default '', `affiliationid` mediumint(8) unsigned NOT NULL default '1', - `curriculumid` smallint(5) unsigned NOT NULL default '1', `firstname` varchar(20) NOT NULL default '', - `middlename` varchar(25) default NULL, `lastname` varchar(25) NOT NULL default '', `preferredname` varchar(25) default NULL, `email` varchar(80) NOT NULL, @@ -1102,21 +1068,6 @@ -- --- Dumping data for table `curriculum` --- - -INSERT INTO `curriculum` (`id`, `name`) VALUES -(1, 'vcl'); - --- --- Dumping data for table `dept` --- - -INSERT INTO `dept` (`id`, `name`, `prettyname`) VALUES -(1, 'engr', 'Engineering'), -(2, 'hpc', 'High Performance Computing'); - --- -- Dumping data for table `computerloadflow` -- INSERT INTO `computerloadflow` (`computerloadstateid`, `nextstateid`, `type`) VALUES @@ -1208,16 +1159,16 @@ -- Dumping data for table `image` -- -INSERT INTO `image` (`id`, `name`, `prettyname`, `ownerid`, `deptid`, `platformid`, `OSid`, `imagemetaid`, `minram`, `minprocnumber`, `minprocspeed`, `minnetwork`, `maxconcurrent`, `reloadtime`, `deleted`, `test`, `lastupdate`, `forcheckout`, `maxinitialtime`, `project`, `size`) VALUES -(1, 'winxp-base1-v0', 'No Apps (WinXP)', 1, 1, 1, 7, NULL, 0, 1, 0, 10, NULL, 14, 0, 0, '2007-04-11 16:07:38', 1, 0, 'vcl', 1045), -(2, 'rhel4-base2-v0', 'Red
svn commit: r790356 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm
Author: fapeeler Date: Wed Jul 1 20:09:53 2009 New Revision: 790356 URL: http://svn.apache.org/viewvc?rev=790356view=rev Log: VCL-173 copied power_* routines from xcat.pm module Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm 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=790356r1=790355r2=790356view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm Wed Jul 1 20:09:53 2009 @@ -3012,6 +3012,262 @@ #/ +=head2 power_reset + + Parameters : $computer_node_name (optional) + Returns : + Description : + +=cut + +sub power_reset { + my $argument_1 = shift; + my $argument_2 = shift; + + my $computer_node_name; + + # Check if subroutine was called as an object method + if (ref($argument_1) =~ /xcat/i) { + my $self = $argument_1; + + $computer_node_name = $argument_2; + + # Check if computer argument was specified + # If not, use computer node name in the data object + if (!$computer_node_name) { + $computer_node_name = $self-data-get_computer_node_name(); + } + } ## end if (ref($argument_1) =~ /xcat/i) + else { + # Subroutine was not called as an object method, 2 arguments must be specified + $computer_node_name = $argument_1; + } + + # Check if computer was determined + if (!$computer_node_name) { + notify($ERRORS{'WARNING'}, 0, computer could not be determined from arguments); + return; + } + + # Turn computer off + my $off_attempts = 0; + while (!power_off($computer_node_name)) { + $off_attempts++; + + if ($off_attempts == 3) { + notify($ERRORS{'WARNING'}, 0, failed to turn $computer_node_name off, rpower status not is off after 3 attempts); + return; + } + + sleep 2; + } ## end while (!power_off($computer_node_name)) + + # Turn computer on + my $on_attempts = 0; + while (!power_on($computer_node_name)) { + $on_attempts++; + + if ($on_attempts == 3) { + notify($ERRORS{'WARNING'}, 0, failed to turn $computer_node_name on, rpower status not is on after 3 attempts); + return; + } + + sleep 2; + } ## end while (!power_on($computer_node_name)) + + notify($ERRORS{'OK'}, 0, successfully reset power on $computer_node_name); + return 1; +} ## end sub power_reset + +#/ + +=head2 power_on + + Parameters : $computer_node_name (optional) + Returns : + Description : + +=cut + +sub power_on { + my $argument_1 = shift; + my $argument_2 = shift; + + my $computer_node_name; + + # Check if subroutine was called as an object method + if (ref($argument_1) =~ /xcat/i) { + my $self = $argument_1; + + $computer_node_name = $argument_2; + + # Check if computer argument was specified + # If not, use computer node name in the data object + if (!$computer_node_name) { + $computer_node_name = $self-data-get_computer_node_name(); + } + } ## end if (ref($argument_1) =~ /xcat/i) + else { + # Subroutine was not called as an object method, 2 arguments must be specified + $computer_node_name = $argument_1; + } + + # Check if computer was determined + if (!$computer_node_name) { + notify($ERRORS{'WARNING'}, 0, computer could not be determined from arguments); + return; + } + + # Turn computer on + my $on_attempts = 0; + my $power_status = 'unknown'; + while ($power_status !~ /on/) { + $on_attempts++; + + if ($on_attempts == 3) { + notify($ERRORS{'WARNING'}, 0, failed to turn $computer_node_name on, rpower status not is on after 3 attempts); + return; + } + + _rpower($computer_node_name, 'on'); + + # Wait up to 1 minute for the computer power status to be on + if (wait_for_on($computer_node_name, 1)) { + last; + } + + $power_status = power_status($computer_node_name
svn commit: r796405 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
Author: fapeeler Date: Tue Jul 21 17:43:05 2009 New Revision: 796405 URL: http://svn.apache.org/viewvc?rev=796405view=rev Log: VCL-187 added code to grant_access routine which enables the external ssh port Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm?rev=796405r1=796404r2=796405view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Tue Jul 21 17:43:05 2009 @@ -318,6 +318,40 @@ return 0; } + my $user = $self-data-get_user_login_id(); + my $computer_node_name = $self-data-get_computer_node_name(); + my $identity = $self-data-get_image_identity; + + notify($ERRORS{'OK'}, 0, In grant_access routine $user,$computer_node_name); + my @sshcmd; + my $clear_extsshd = perl -pi -e \'s/^AllowUsers .*\n//' /etc/ssh/external_sshd_config; + if(run_ssh_command($computer_node_name, $identity, $clear_extsshd, root)) { + notify($ERRORS{'DEBUG'}, 0, cleared AllowUsers directive from external_sshd_config); + } + else { + notify($ERRORS{'CRITICAL'}, 0, failed to add AllowUsers $user to external_sshd_config); + } + + my $cmd = echo \AllowUsers $user\ /etc/ssh/external_sshd_config; + if (run_ssh_command($computer_node_name, $identity, $cmd, root)) { + notify($ERRORS{'DEBUG'}, 0, added AllowUsers $user to external_sshd_config); + } + else { + notify($ERRORS{'CRITICAL'}, 0, failed to add AllowUsers $user to external_sshd_config); + return 0; + } + undef @sshcmd; + @sshcmd = run_ssh_command($computer_node_name, $identity, /etc/init.d/ext_sshd restart, root); + + foreach my $l (@{$sshcmd[1]}) { + if ($l =~ /Stopping ext_sshd:/i) { + #notify($ERRORS{'OK'},0,stopping sshd on $computer_node_name ); + } + if ($l =~ /Starting ext_sshd:[ OK ]/i) { + notify($ERRORS{'OK'}, 0, ext_sshd on $computer_node_name started); + } + }#foreach + notify($ERRORS{'OK'}, 0, started ext_sshd on $computer_node_name); return 1; }
svn commit: r796423 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
Author: fapeeler Date: Tue Jul 21 18:14:16 2009 New Revision: 796423 URL: http://svn.apache.org/viewvc?rev=796423view=rev Log: VCL-187 continued improvements on the Ubuntu.pm typo in grant_access routine extended reserve routine to add $user_name to /etc/sudoers file Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm?rev=796423r1=796422r2=796423view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Tue Jul 21 18:14:16 2009 @@ -284,7 +284,7 @@ my $image_identity = $self-data-get_image_identity; my $reservation_password = $self-data-get_reservation_password(); - my $useradd_string = /usr/sbin/useradd -d /home/$user_name -m -g users $user_name; + my $useradd_string = /usr/sbin/useradd -d /home/$user_name -m -g admin $user_name; my @sshcmd = run_ssh_command($computer_node_name, $image_identity, $useradd_string, root); foreach my $l (@{$sshcmd[1]}) { @@ -308,6 +308,25 @@ notify($ERRORS{'DEBUG'}, 0, Updated the user password L is $l); } + #FIXME: This needs to pull from imagemeta data rootaccess - if rootaccess==1 then set + # Add to sudoers file + #clear user from sudoers file + my $clear_cmd = perl -pi -e 's/^$user_name .*\n//' /etc/sudoers; + if(run_ssh_command($computer_node_name, $image_identity, $clear_cmd, root)) { + notify($ERRORS{'DEBUG'}, 0, cleared $user_name from /etc/sudoers); + } + else { + notify($ERRORS{'CRITICAL'}, 0, failed to clear $user_name from /etc/sudoers); + } + my $sudoers_cmd = echo \$user_name ALL= NOPASSWD: ALL\ /etc/sudoers; + if(run_ssh_command($computer_node_name, $image_identity, $sudoers_cmd, root)) { + notify($ERRORS{'DEBUG'}, 0, added $user_name to /etc/sudoers); + } + else { + notify($ERRORS{'CRITICAL'}, 0, failed to add $user_name to /etc/sudoers); + } + + return 1; } @@ -324,7 +343,7 @@ notify($ERRORS{'OK'}, 0, In grant_access routine $user,$computer_node_name); my @sshcmd; - my $clear_extsshd = perl -pi -e \'s/^AllowUsers .*\n//' /etc/ssh/external_sshd_config; + my $clear_extsshd = perl -pi -e 's/^AllowUsers .*\n//' /etc/ssh/external_sshd_config; if(run_ssh_command($computer_node_name, $identity, $clear_extsshd, root)) { notify($ERRORS{'DEBUG'}, 0, cleared AllowUsers directive from external_sshd_config); }
svn commit: r796472 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
Author: fapeeler Date: Tue Jul 21 18:55:15 2009 New Revision: 796472 URL: http://svn.apache.org/viewvc?rev=796472view=rev Log: VCL-187 Added check for image profile root access allowed cleaned up delete_user routine added step to remove user from sudoers ran perltidy Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm?rev=796472r1=796471r2=796472view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Tue Jul 21 18:55:15 2009 @@ -198,6 +198,8 @@ return 0; } + my $imagemeta_rootaccess = $self-data-get_imagemeta_rootaccess(); + # Use userdel to delete the user my $user_delete_command = /usr/sbin/userdel $user_login_id; my @user_delete_results = run_ssh_command($computer_node_name, $IDENTITY_bladerhel, $user_delete_command, root); @@ -208,64 +210,30 @@ } } - # User successfully deleted - # Remove user from sshd config - my $external_sshd_config_path = $computer_node_name:/etc/ssh/external_sshd_config; - my $external_sshd_config_temp_path = /tmp/$computer_node_name.sshd; - - # Retrieve the node's external_sshd_config file - if (run_scp_command($external_sshd_config_path, $external_sshd_config_temp_path, $IDENTITY_bladerhel)) { - notify($ERRORS{'DEBUG'}, 0, retrieved $external_sshd_config_path); + #Clear user from external_sshd_config + my $clear_extsshd = perl -pi -e 's/^AllowUsers .*\n//' /etc/ssh/external_sshd_config; + if (run_ssh_command($computer_node_name, $identity, $clear_extsshd, root)) { + notify($ERRORS{'DEBUG'}, 0, cleared AllowUsers directive from external_sshd_config); } else { - notify($ERRORS{'WARNING'}, 0, sshd config not cleaned up, failed to retrieve $external_sshd_config_path); - return 0; + notify($ERRORS{'CRITICAL'}, 0, failed to add AllowUsers $user to external_sshd_config); } - # Remove user from sshd config file - # Get the contents of the sshd config file - if (open(SSHD_CFG_TEMP, $external_sshd_config_temp_path)) { - my @external_sshd_config_lines = SSHD_CFG_TEMP; - close SSHD_CFG_TEMP; - - # Loop through the lines, clear out AllowUsers lines - foreach my $external_sshd_config_line (@external_sshd_config_lines) { - $external_sshd_config_line = if ($external_sshd_config_line =~ /AllowUsers/); - } + #Clear user from sudoers - # Rewrite the temp sshd config file with the modified contents - if (open(SSHD_CFG_TEMP, $external_sshd_config_temp_path)) { - print SSHD_CFG_TEMP @external_sshd_config_lines; - close SSHD_CFG_TEMP; + if ($imagemeta_rootaccess) { + #clear user from sudoers file + my $clear_cmd = perl -pi -e 's/^$user_name .*\n//' /etc/sudoers; + if (run_ssh_command($computer_node_name, $image_identity, $clear_cmd, root)) { + notify($ERRORS{'DEBUG'}, 0, cleared $user_name from /etc/sudoers); } - - # Copy the modified file back to the node - if (run_scp_command($external_sshd_config_temp_path, $external_sshd_config_path, $IDENTITY_bladerhel)) { - notify($ERRORS{'DEBUG'}, 0, modified file copied back to node: $external_sshd_config_path); - - # Delete the temp file - unlink $external_sshd_config_temp_path; - - # Restart external sshd - if (run_ssh_command($computer_node_name, $IDENTITY_bladerhel, /etc/init.d/ext_sshd restart)) { - notify($ERRORS{'DEBUG'}, 0, restarted ext_sshd on $computer_node_name); - } - - return 1; - } ## end if (run_scp_command($external_sshd_config_temp_path... else { - notify($ERRORS{'WARNING'}, 0, failed to copy modified file back to node: $external_sshd_config_path); + notify($ERRORS{'CRITICAL'}, 0, failed to clear $user_name from /etc/sudoers); + } + } ## end if ($imagemeta_rootaccess) - # Delete the temp file - unlink $external_sshd_config_temp_path; + return 1; - return 0; - } - } ## end if (open(SSHD_CFG_TEMP
svn commit: r801360 - /incubator/vcl/trunk/managementnode/INSTALL
Author: fapeeler Date: Wed Aug 5 18:58:10 2009 New Revision: 801360 URL: http://svn.apache.org/viewvc?rev=801360view=rev Log: added ASF 2.0 license Modified: incubator/vcl/trunk/managementnode/INSTALL Modified: incubator/vcl/trunk/managementnode/INSTALL URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/INSTALL?rev=801360r1=801359r2=801360view=diff == --- incubator/vcl/trunk/managementnode/INSTALL (original) +++ incubator/vcl/trunk/managementnode/INSTALL Wed Aug 5 18:58:10 2009 @@ -1,6 +1,26 @@ ## # $Id$ -## +### +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version +# 2.0 +# (the License); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an AS IS BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +### +# Installer for collecting additional perl modules +### + mkdir /usr/local/vcl/source wget --directory-prefix=/usr/local/vcl/source http://search.cpan.org/CPAN/authors/id/M/MA/MARKOV/MailTools-2.04.tar.gz
svn commit: r802863 - /incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install
Author: fapeeler Date: Mon Aug 10 17:01:01 2009 New Revision: 802863 URL: http://svn.apache.org/viewvc?rev=802863view=rev Log: VCL-199 post script for automatically installing vmware Free server Added: incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install (with props) Added: incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install?rev=802863view=auto == --- incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install (added) +++ incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install Mon Aug 10 17:01:01 2009 @@ -0,0 +1,22 @@ +#!/bin/ksh +# +# Install additional rpms +# + +logger -t xcat Install: vmware-install + +if [ -r /etc/vmware1 ]; then + mkdir /post + mount -r -o nolock ${MASTER}:/install/post /post 21 | logger -t xcat + cd /post/otherrpms/VMware/ + rpm -ihv *.rpm 21 | logger -t xcat + cd / + rm -rf /etc/vmware /etc/vmware1 + cp -r /post/otherrpms/VMware/vmware /etc/vmware + /bin/chmod 755 /etc/vmware + logger -t xcat Install: injecting vmware-config.pl --d into rc.local + echo vmware-config.pl --d /etc/rc.local + echo /sbin/chkconfig --levels 2345 vmware on /etc/rc.local + umount /post + rmdir /post +fi Propchange: incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install -- svn:executable = *
svn commit: r803900 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Thu Aug 13 14:27:36 2009 New Revision: 803900 URL: http://svn.apache.org/viewvc?rev=803900view=rev Log: VCL-185 added get_public_interface routine simply returns defined ethdevice from vcld.conf Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=803900r1=803899r2=803900view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Thu Aug 13 14:27:36 2009 @@ -410,6 +410,22 @@ #/ +=head2 get_public_interface_name + + Parameters : + Returns : + Description : + +=cut + +sub get_public_interface_name { + + #global varible pulled from vcld.conf + return $ETHDEVICE; + +} +#/ + =head2 delete_user Parameters :
svn commit: r803918 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Thu Aug 13 15:03:04 2009 New Revision: 803918 URL: http://svn.apache.org/viewvc?rev=803918view=rev Log: VCL-185 missing global variable $GATEWAY for static IP address assignment Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=803918r1=803917r2=803918view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Thu Aug 13 15:03:04 2009 @@ -207,6 +207,7 @@ $DEFAULTHELPEMAIL $DEFAULTURL $ETHDEVICE + $GATEWAY $FQDN $IDENTITY_bladerhel $IDENTITY_wxp
svn commit: r803921 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Thu Aug 13 15:09:27 2009 New Revision: 803921 URL: http://svn.apache.org/viewvc?rev=803921view=rev Log: VCL-185 added routine get_public_default_gateway Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=803921r1=803920r2=803921view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Thu Aug 13 15:09:27 2009 @@ -424,6 +424,24 @@ return $ETHDEVICE; } + +#/ + +=head2 get_public_default_gateway + + Parameters : + Returns : + Description : + +=cut + +sub get_public_default_gateway { + + #global varible pulled from vcld.conf + return $GATEWAY; +} + + #/ =head2 delete_user
svn commit: r805009 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Mon Aug 17 15:22:49 2009 New Revision: 805009 URL: http://svn.apache.org/viewvc?rev=805009view=rev Log: VCL-185 left out uid in reserve routine Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=805009r1=805008r2=805009view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Mon Aug 17 15:22:49 2009 @@ -546,13 +546,15 @@ my $image_identity = $self-data-get_image_identity; my $imagemeta_rootaccess = $self-data-get_imagemeta_rootaccess(); my $user_standalone = $self-data-get_user_standalone(); + my $user_uid = $self-data-get_user_uid(); - my $useradd_string = /usr/sbin/useradd -d /home/$user_name -m $user_name; + my $useradd_string = /usr/sbin/useradd -u $user_uid -d /home/$user_name -m $user_name; my @sshcmd = run_ssh_command($computer_node_name, $image_identity, $useradd_string, root); foreach my $l (@{$sshcmd[1]}) { if ($l =~ /user $user_name exists/) { notify($ERRORS{'OK'}, 0, detected user already has account); + } }
svn commit: r805010 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Mon Aug 17 15:31:25 2009 New Revision: 805010 URL: http://svn.apache.org/viewvc?rev=805010view=rev Log: VCL-182 Added generic Linux OS type Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=805010r1=805009r2=805010view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Mon Aug 17 15:31:25 2009 @@ -624,11 +624,12 @@ } notify($ERRORS{'OK'}, 0, adapter= $adapter drivetype $vmclient_drivetype); - my $guestOS; + my $guestOS = other; $guestOS = winxppro if ($requestedimagename =~ /(winxp)/i); $guestOS = winnetenterprise if ($requestedimagename =~ /(win2003|win2008)/i); $guestOS = ubuntu if ($requestedimagename =~ /(ubuntu)/i); $guestOS = winvista if ($requestedimagename =~ /(vista)/i); + $guestOS = linux if ($vmclient_OSname =~ /(linux)/i); my @vmxfile; my $tmpfile = /tmp/$myvmdir/$myvmdir.vmx;
svn commit: r806583 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Fri Aug 21 15:02:00 2009 New Revision: 806583 URL: http://svn.apache.org/viewvc?rev=806583view=rev Log: VCL-204 post-load option to clear known identity keys for Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=806583r1=806582r2=806583view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Fri Aug 21 15:02:00 2009 @@ -220,6 +220,17 @@ else { notify($ERRORS{'CRITICAL'}, 0, failed to clear AllowUsers from external_sshd_config); } + + #Clear ssh idenity keys from /root/.ssh + my $clear_private_keys = /bin/rm -f /root/.ssh/id_rsa /root/.ssh/id_rsa.pub; + if (run_ssh_command($computer_node_name, $management_node_keys, $clear_private_keys, root)) { + notify($ERRORS{'DEBUG'}, 0, cleared any id_rsa keys from /root/.ssh); + return 1; + } + else { + notify($ERRORS{'CRITICAL'}, 0, failed to clear any id_rsa keys from /root/.ssh); + } + return 1; } ## end sub post_load
svn commit: r806590 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Fri Aug 21 15:10:41 2009 New Revision: 806590 URL: http://svn.apache.org/viewvc?rev=806590view=rev Log: VCL-204 improved - moved the logic to a seperate routine that can be called during both the capture_prepare and post_load steps Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=806590r1=806589r2=806590view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Fri Aug 21 15:10:41 2009 @@ -107,6 +107,11 @@ notify($ERRORS{'DEBUG'}, 0, cleartmp precapture $computer_node_name ); } + #Clear ssh idenity keys from /root/.ssh + if (!$self-clear_private_keys()) { + notify($ERRORS{'WARNING'}, 0, unable to clear known identity keys); + } + if ($IPCONFIGURATION eq static) { #so we don't have conflicts we should set the public adapter back to dhcp # reset ifcfg-eth1 back to dhcp @@ -222,6 +227,26 @@ } #Clear ssh idenity keys from /root/.ssh + if (!$self-clear_private_keys()) { + notify($ERRORS{'WARNING'}, 0, unable to clear known identity keys); + } + + return 1; + +} ## end sub post_load + +sub clear_private_keys { + my $self = shift; + unless (ref($self) $self-isa('VCL::Module')) { + notify($ERRORS{'CRITICAL'}, 0, subroutine can only be called as a VCL::Module module object method); + return; + } + + my $management_node_keys = $self-data-get_management_node_keys(); + my $computer_short_name = $self-data-get_computer_short_name(); + my $computer_node_name = $self-data-get_computer_node_name(); + + #Clear ssh idenity keys from /root/.ssh my $clear_private_keys = /bin/rm -f /root/.ssh/id_rsa /root/.ssh/id_rsa.pub; if (run_ssh_command($computer_node_name, $management_node_keys, $clear_private_keys, root)) { notify($ERRORS{'DEBUG'}, 0, cleared any id_rsa keys from /root/.ssh); @@ -231,10 +256,7 @@ notify($ERRORS{'CRITICAL'}, 0, failed to clear any id_rsa keys from /root/.ssh); } - return 1; - -} ## end sub post_load - +} sub set_static_public_address { my $self = shift; if (ref($self) !~ /linux/i) {
svn commit: r807191 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm
Author: fapeeler Date: Mon Aug 24 12:46:38 2009 New Revision: 807191 URL: http://svn.apache.org/viewvc?rev=807191view=rev Log: VCL-191 Added paths for vsphere 4: module checks for the installed locations, based on the known paths it sets it either to vsphere4 or the previous vmware toolkit Added generic get_vmware_host_info routine to fetch various vmware server information. For this issue it is used to collect the true hostname of the esx server. In future additions it looks like it could be used to determine available capicity Added additional guestOS variables Added option for eth0 and eth1 vmware generated. The VMWARE_MAC_ETH0_GENERATED and VMWARE_MAC_ETH1_GENERATED are currently set in the vcld.conf file. If these are not set it skips the arp checks to find the vmware assigned MAC addresses Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm 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=807191r1=807190r2=807191view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm Mon Aug 24 12:46:38 2009 @@ -117,12 +117,12 @@ sub initialize { # Check for known vmware toolkit paths - if(-d '/usr/lib/vmware-vcli/apps/vm'){ - $VMTOOL_ROOT = '/usr/lib/vmware-vcli/apps/vm'; + if (-d '/usr/lib/vmware-vcli/apps') { + $VMTOOL_ROOT = '/usr/lib/vmware-vcli/apps'; $VMTOOLKIT_VERSION = vsphere4; } - elsif(-d '/usr/lib/vmware-viperl/apps/vm'){ - $VMTOOL_ROOT = '/usr/lib/vmware-viperl/apps/vm'; + elsif (-d '/usr/lib/vmware-viperl/apps') { + $VMTOOL_ROOT = '/usr/lib/vmware-viperl/apps'; $VMTOOLKIT_VERSION = vmtoolkit1; } else { @@ -131,7 +131,7 @@ } # Check to make sure one of the expected executables is where it should be - if (!-x $VMTOOL_ROOT/vmregister.pl) { + if (!-x $VMTOOL_ROOT/vm/vmregister.pl) { notify($ERRORS{'WARNING'}, 0, unable to initialize esx module, expected executable was not found: $VMTOOL_ROOT/vmregister.pl); return; } @@ -139,7 +139,7 @@ notify($ERRORS{'DEBUG'}, 0, vmware ESX module initialized); return 1; -} +} ## end sub initialize #/ @@ -186,7 +186,20 @@ my $vmhost_password = $self-data-get_vmhost_profile_password(); $vmhost_hostname =~ /([-_a-zA-Z0-9]*)(\.?)/; - my $vmhost_shortname = $1; + my $vmhost_shortname = $1; + + + #Collect the proper hostname of the ESX server through the vmware tool kit + notify($ERRORS{'DEBUG'}, 0, Calling get_vmware_host_info); + my $vmhost_hostname_value = $self-get_vmware_host_info(hostname); + + if ($vmhost_hostname_value) { + notify($ERRORS{'DEBUG'}, 0, Collected $vmhost_hostname_value for vmware host name); + $vmhost_hostname = $vmhost_hostname_value; + } + else { + notify($ERRORS{'DEBUG'}, 0, Unable to collect hostname_value for vmware host name using hostname from database); + } #Get the config datastore information from the database @@ -202,7 +215,7 @@ my $vmpath = $datastore_share_path/inuse/$computer_shortname; # query the host to see if the vm currently exists - my $vminfo_command = $VMTOOL_ROOT/vminfo.pl; + my $vminfo_command = $VMTOOL_ROOT/vm/vminfo.pl; $vminfo_command .= --server '$vmhost_shortname'; $vminfo_command .= --vmname $computer_shortname; $vminfo_command .= --username $vmhost_username; @@ -215,7 +228,7 @@ # parse the results from the host and determine if we need to remove an old vm if ($vminfo_output =~ /^Information of Virtual Machine $computer_shortname/m) { # Power off this vm - my $poweroff_command = $VMTOOL_ROOT/vmcontrol.pl; + my $poweroff_command = $VMTOOL_ROOT/vm/vmcontrol.pl; $poweroff_command .= --server '$vmhost_shortname'; $poweroff_command .= --vmname $computer_shortname; $poweroff_command .= --operation poweroff; @@ -227,7 +240,7 @@ notify($ERRORS{'DEBUG'}, 0, Powered off: $poweroff_output); # unregister old vm from host - my $unregister_command = $VMTOOL_ROOT/vmregister.pl; + my $unregister_command = $VMTOOL_ROOT/vm/vmregister.pl; $unregister_command .= --server '$vmhost_shortname'; $unregister_command .= --username $vmhost_username
svn commit: r807764 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Tue Aug 25 19:10:35 2009 New Revision: 807764 URL: http://svn.apache.org/viewvc?rev=807764view=rev Log: VCL-185 converted changepasswd to be called as a method Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=807764r1=807763r2=807764view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Tue Aug 25 19:10:35 2009 @@ -200,7 +200,7 @@ notify($ERRORS{'OK'}, 0, initiating Linux post_load: $image_name on $computer_short_name); # Change password - if (_changepasswd($computer_node_name, root)) { + if ($self-changepasswd($computer_node_name, root)) { notify($ERRORS{'OK'}, 0, successfully changed root password on $computer_node_name); #insertloadlog($reservation_id, $computer_id, info, SUCCESS randomized roots password); } @@ -225,10 +225,11 @@ else { notify($ERRORS{'CRITICAL'}, 0, failed to clear AllowUsers from external_sshd_config); } - + + notify($ERRORS{'DEBUG'}, 0, calling clear_private_keys); #Clear ssh idenity keys from /root/.ssh - if (!$self-clear_private_keys()) { - notify($ERRORS{'WARNING'}, 0, unable to clear known identity keys); + if ($self-clear_private_keys()) { + notify($ERRORS{'OK'}, 0, cleared known identity keys); } return 1; @@ -242,6 +243,7 @@ return; } + notify($ERRORS{'DEBUG'}, 0, perparing to clear known identity keys); my $management_node_keys = $self-data-get_management_node_keys(); my $computer_short_name = $self-data-get_computer_short_name(); my $computer_node_name = $self-data-get_computer_node_name(); @@ -254,6 +256,7 @@ } else { notify($ERRORS{'CRITICAL'}, 0, failed to clear any id_rsa keys from /root/.ssh); + return 0; } } @@ -596,7 +599,7 @@ my $reservation_password = $self-data-get_reservation_password(); #Set password - if (_changepasswd($computer_node_name, $user_name, $reservation_password, $image_identity)) { + if ($self-changepasswd($computer_node_name, $user_name, $reservation_password)) { notify($ERRORS{'OK'}, 0, Successfully set password on useracct: $user_name on $computer_node_name); } else { @@ -686,7 +689,7 @@ #/ -=head2 _changepasswd +=head2 changepasswd Parameters : called as an object Returns : 1 - success , 0 - failure @@ -694,10 +697,20 @@ =cut -sub _changepasswd { +sub changepasswd { + my $self = shift; + if (ref($self) !~ /linux/i) { + notify($ERRORS{'CRITICAL'}, 0, subroutine was called as a function, it must be called as a class method); + return 0; + } + + my $management_node_keys = $self-data-get_management_node_keys(); + # change the privileged account passwords on the blade images - my ($node,$account, $passwd, $identity_key) = @_; - my ($package, $filename, $line, $sub) = caller(0); + my $node = shift; + my $account = shift; + my $passwd = shift; + notify($ERRORS{'WARNING'}, 0, node is not defined)if (!(defined($node))); notify($ERRORS{'WARNING'}, 0, account is not defined) if (!(defined($account))); @@ -721,11 +734,11 @@ if (open(TMP, $tmpfile)) { print TMP $account:$passwd:13061:0:9:7:::\n; close(TMP); - if (run_ssh_command($node, $identity_key, cat /etc/shadow \|grep -v $account $tmpfile, root)) { + if (run_ssh_command($node, $management_node_keys, cat /etc/shadow \|grep -v $account $tmpfile, root)) { notify($ERRORS{'DEBUG'}, 0, collected /etc/shadow file from $node); - if (run_scp_command($tmpfile, $node:/etc/shadow, $identity_key)) { + if (run_scp_command($tmpfile, $node:/etc/shadow, $management_node_keys)) { notify($ERRORS{'DEBUG'}, 0, copied updated /etc/shadow file to $node); - if (run_ssh_command($node, $identity_key, chmod 600 /etc/shadow, root)) { + if (run_ssh_command($node
svn commit: r808460 - /incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm
Author: fapeeler Date: Thu Aug 27 15:36:18 2009 New Revision: 808460 URL: http://svn.apache.org/viewvc?rev=808460view=rev Log: VCL-169 Added restore option to reset management node to available state. Modified: incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm?rev=808460r1=808459r2=808460view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm Thu Aug 27 15:36:18 2009 @@ -152,9 +152,10 @@ notify($ERRORS{'OK'}, $LOG, in processing routine); $info-{globalmsg}-{body} = Summary of VCL node monitoring system:\n\n; + my $mn_hostname = $info-{managementnode}-{hostname}; + if($powerdownstage =~ /^(available|all)$/){ - my $mn_hostname = $info-{managementnode}-{hostname}; - notify($ERRORS{'OK'}, $LOG, ALERT: powerdown stage triggered,placing MN $mn_hostname in maintenance); + notify($ERRORS{'CRITICAL'}, $LOG, ALERT: powerdown stage triggered,placing MN $mn_hostname in maintenance); if (set_managementnode_state($info-{managementnode}, maintenance)) { notify($ERRORS{'OK'}, $LOG, Successfully set $mn_hostname into maintenance); } @@ -162,6 +163,18 @@ notify($ERRORS{'WARNING'}, $LOG, Failed to set $mn_hostname into maintenance); } } + elsif($powerdownstage =~ /^restore/){ + notify($ERRORS{'CRITICAL'}, $LOG, ALERT: Environment OK: restoring state of MN $mn_hostname in available); + if (set_managementnode_state($info-{managementnode}, available)) { + notify($ERRORS{'OK'}, $LOG, Successfully set $mn_hostname into available); + } + else{ + notify($ERRORS{'WARNING'}, $LOG, Failed to set $mn_hostname into available); + } + } + else{ + #proceed standard checks + } foreach my $cid (keys %{$info-{computertable}}) { #set some local variables
svn commit: r808969 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Fri Aug 28 17:45:18 2009 New Revision: 808969 URL: http://svn.apache.org/viewvc?rev=808969view=rev Log: VCL-185 renamed capture_prepare to pre_capture Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=808969r1=808968r2=808969view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Fri Aug 28 17:45:18 2009 @@ -62,7 +62,7 @@ #/ -=head2 capture_prepare +=head2 pre_capture Parameters : Returns : @@ -70,7 +70,7 @@ =cut -sub capture_prepare { +sub pre_capture { my $self = shift; if (ref($self) !~ /linux/i) { notify($ERRORS{'CRITICAL'}, 0, subroutine was called as a function, it must be called as a class method);
svn commit: r808983 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Fri Aug 28 18:36:11 2009 New Revision: 808983 URL: http://svn.apache.org/viewvc?rev=808983view=rev Log: VCL-185 added logoff_user routine, user del fails if user is still logged on Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=808983r1=808982r2=808983view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Fri Aug 28 18:36:11 2009 @@ -97,6 +97,11 @@ my @sshcmd; + # Force user off computer + if ($self-logoff_user()){ + notify($ERRORS{'OK'}, 0, forced $user_unityid off $computer_node_name); + } + # Remove user and clean external ssh file if ($self-delete_user()) { notify($ERRORS{'OK'}, 0, $user_unityid deleted from $computer_node_name); @@ -477,6 +482,47 @@ return $GATEWAY; } +sub logoff_user { + my $self = shift; + if (ref($self) !~ /linux/i) { + notify($ERRORS{'CRITICAL'}, 0, subroutine was called as a function, it must be called as a class method); + return 0; + } + + # Make sure the user login ID was passed + my $user_login_id = shift; + $user_login_id = $self-data-get_user_login_id() if (!$user_login_id); + if (!$user_login_id) { + notify($ERRORS{'WARNING'}, 0, user could not be determined); + return 0; + } + + # Make sure the user login ID was passed + my $computer_node_name = shift; + $computer_node_name = $self-data-get_computer_node_name() if (!$computer_node_name); + if (!$computer_node_name) { + notify($ERRORS{'WARNING'}, 0, computer node name could not be determined); + return 0; + } + + #Make sure the identity key was passed + my $image_identity = shift; + $image_identity = $self-data-get_image_identity() if (!$image_identity); + if (!$image_identity) { + notify($ERRORS{'WARNING'}, 0, image identity keys could not be determined); + return 0; + } + + my $logoff_cmd = pkill -KILL -u $user_login_id; + if (run_ssh_command($computer_node_name, $image_identity, $logoff_cmd, root)) { + notify($ERRORS{'DEBUG'}, 0, logged off $user_login_id from $computer_node_name); + } + else { + notify($ERRORS{'DEBUG'}, 0, failed to log off $user_login_id from $computer_node_name); + } + + return 1; +} #/
svn commit: r812688 - in /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning: xCAT.pm xCAT21.pm
Author: fapeeler Date: Tue Sep 8 20:44:23 2009 New Revision: 812688 URL: http://svn.apache.org/viewvc?rev=812688view=rev Log: VCL-217 extended to check for nodes in imaging mode Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm 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=812688r1=812687r2=812688view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm Tue Sep 8 20:44:23 2009 @@ -273,7 +273,7 @@ my $maxload = 1; while ($maxload) { notify($ERRORS{'DEBUG'}, 0, running 'nodeset all stat' to determine number of nodes currently being loaded); - if (open(NODESET, $XCAT_ROOT/bin/nodeset all stat \| grep install 21 | )) { + if (open(NODESET, $XCAT_ROOT/bin/nodeset all stat \| egrep \'install\|image\' 21 | )) { my @nodesetout = NODESET; close(NODESET); my $ld = @nodesetout; 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=812688r1=812687r2=812688view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm Tue Sep 8 20:44:23 2009 @@ -261,7 +261,7 @@ my $maxload = 1; while ($maxload) { notify($ERRORS{'DEBUG'}, 0, running 'nodeset all stat' to determine number of nodes currently being loaded); - if (open(NODESET, $XCAT_ROOT/bin/nodeset all stat \| grep install 21 | )) { + if (open(NODESET, $XCAT_ROOT/bin/nodeset all stat \| egrep \'install\|image\' 21 | )) { my @nodesetout = NODESET; close(NODESET); my $ld = @nodesetout;
svn commit: r818253 - /incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install
Author: fapeeler Date: Wed Sep 23 20:52:55 2009 New Revision: 818253 URL: http://svn.apache.org/viewvc?rev=818253view=rev Log: added ASF license Modified: incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install Modified: incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install?rev=818253r1=818252r2=818253view=diff == --- incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install (original) +++ incubator/vcl/trunk/managementnode/tools/xcat2_postscripts/vmware1-install Wed Sep 23 20:52:55 2009 @@ -2,6 +2,24 @@ # # Install additional rpms # +### +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version +# 2.0 +# (the License); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an AS IS BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +### logger -t xcat Install: vmware-install
svn commit: r818255 - /incubator/vcl/trunk/managementnode/tools/xcat_postscripts/vmware1-install
Author: fapeeler Date: Wed Sep 23 20:53:51 2009 New Revision: 818255 URL: http://svn.apache.org/viewvc?rev=818255view=rev Log: Adding for xcat1.3 installs Added: incubator/vcl/trunk/managementnode/tools/xcat_postscripts/vmware1-install (with props) Added: incubator/vcl/trunk/managementnode/tools/xcat_postscripts/vmware1-install URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/tools/xcat_postscripts/vmware1-install?rev=818255view=auto == --- incubator/vcl/trunk/managementnode/tools/xcat_postscripts/vmware1-install (added) +++ incubator/vcl/trunk/managementnode/tools/xcat_postscripts/vmware1-install Wed Sep 23 20:53:51 2009 @@ -0,0 +1,36 @@ +#!/bin/ksh +# +# Install additional rpms +# +### +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version +# 2.0 +# (the License); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an AS IS BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +### + +logger -t xcat Install: vmware-install + +if [ -r /etc/vmware1 ]; then + cd /post/otherrpms/VMware/ + rpm -ihv *.rpm 21 | logger -t xcat + cd / + rm -rf /etc/vmware /etc/vmware1 + cp -r /post/otherrpms/VMware/vmware /etc/vmware + /bin/chmod 755 /etc/vmware + logger -t xcat Install: injecting vmware-config.pl --d into rc.local + echo vmware-config.pl --d /etc/rc.local + echo /sbin/chkconfig --levels 2345 vmware on /etc/rc.local +fi Propchange: incubator/vcl/trunk/managementnode/tools/xcat_postscripts/vmware1-install -- svn:executable = *
svn commit: r818261 - /incubator/vcl/trunk/managementnode/tools/xcat_postscripts/
Author: fapeeler Date: Wed Sep 23 21:03:20 2009 New Revision: 818261 URL: http://svn.apache.org/viewvc?rev=818261view=rev Log: VCL-198 Removing all files copied from xCAT or files that are not used anymore. Removed: incubator/vcl/trunk/managementnode/tools/xcat_postscripts/addhttpdiptables incubator/vcl/trunk/managementnode/tools/xcat_postscripts/checksmp incubator/vcl/trunk/managementnode/tools/xcat_postscripts/checkswap incubator/vcl/trunk/managementnode/tools/xcat_postscripts/correctresolv-conf incubator/vcl/trunk/managementnode/tools/xcat_postscripts/defaultshell-tcsh incubator/vcl/trunk/managementnode/tools/xcat_postscripts/disipv6 incubator/vcl/trunk/managementnode/tools/xcat_postscripts/eths4dhcp incubator/vcl/trunk/managementnode/tools/xcat_postscripts/gpfs31 incubator/vcl/trunk/managementnode/tools/xcat_postscripts/hosts4dhcp incubator/vcl/trunk/managementnode/tools/xcat_postscripts/makesshgkh incubator/vcl/trunk/managementnode/tools/xcat_postscripts/mysyncdirs incubator/vcl/trunk/managementnode/tools/xcat_postscripts/name4dhcp incubator/vcl/trunk/managementnode/tools/xcat_postscripts/openafs incubator/vcl/trunk/managementnode/tools/xcat_postscripts/otherrpms incubator/vcl/trunk/managementnode/tools/xcat_postscripts/otherrpms-lamp incubator/vcl/trunk/managementnode/tools/xcat_postscripts/private.hardeths incubator/vcl/trunk/managementnode/tools/xcat_postscripts/remoteshell-dblssh incubator/vcl/trunk/managementnode/tools/xcat_postscripts/remoteshell-dblssh-dhcp incubator/vcl/trunk/managementnode/tools/xcat_postscripts/remoteshell-dblssh-dhcp-new incubator/vcl/trunk/managementnode/tools/xcat_postscripts/remoteshell-dblssh-dhcp-test incubator/vcl/trunk/managementnode/tools/xcat_postscripts/remoteshell-dblssh-dhcp.bak incubator/vcl/trunk/managementnode/tools/xcat_postscripts/remoteshell-dblssh-dhcp.bak2 incubator/vcl/trunk/managementnode/tools/xcat_postscripts/remoteshell-dblssh-dhcp.bak3 incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupESX incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupafs incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupafs64 incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupgpfs incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupntp incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupservices-dblssh incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupsudoers incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupsudoersFULL incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupusers incubator/vcl/trunk/managementnode/tools/xcat_postscripts/setupusers-ncsu incubator/vcl/trunk/managementnode/tools/xcat_postscripts/syncdirs incubator/vcl/trunk/managementnode/tools/xcat_postscripts/syslog incubator/vcl/trunk/managementnode/tools/xcat_postscripts/syslog-test incubator/vcl/trunk/managementnode/tools/xcat_postscripts/syslog.ver1 incubator/vcl/trunk/managementnode/tools/xcat_postscripts/syslog_ORIG incubator/vcl/trunk/managementnode/tools/xcat_postscripts/syslog_new
svn commit: r819995 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Tue Sep 29 15:49:49 2009 New Revision: 819995 URL: http://svn.apache.org/viewvc?rev=819995view=rev Log: VCL-238 moved shutdown -h now command into pre_capture routine removed legacy capture_start routine Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=819995r1=819994r2=819995view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Tue Sep 29 15:49:49 2009 @@ -143,42 +143,15 @@ } } ## end if ($IPCONFIGURATION eq static) - notify($ERRORS{'OK'}, 0, returning 1); - return 1; -} ## end sub capture_prepare - -#/ - -=head2 capture_start - - Parameters : - Returns : - Description : - -=cut - -sub capture_start { - my $self = shift; - if (ref($self) !~ /linux/i) { - notify($ERRORS{'CRITICAL'}, 0, subroutine was called as a function, it must be called as a class method); - return 0; - } - - my $management_node_keys = $self-data-get_management_node_keys(); - my $image_name = $self-data-get_image_name(); - my $computer_short_name = $self-data-get_computer_short_name(); - my $computer_node_name = $self-data-get_computer_node_name(); - - notify($ERRORS{'OK'}, 0, initiating Linux image capture: $image_name on $computer_short_name); - + #shutdown node notify($ERRORS{'OK'}, 0, initating reboot for Linux imaging sequence); run_ssh_command($computer_node_name, $management_node_keys, /sbin/shutdown -r now, root); - notify($ERRORS{'OK'}, 0, sleeping for 90 seconds while machine shuts down and reboots); - sleep 90; + notify($ERRORS{'OK'}, 0, sleeping for 60 seconds while machine shuts down and reboots); + sleep 60; notify($ERRORS{'OK'}, 0, returning 1); return 1; -} ## end sub capture_start +} ## end sub capture_prepare #/
svn commit: r820035 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Tue Sep 29 17:14:14 2009 New Revision: 820035 URL: http://svn.apache.org/viewvc?rev=820035view=rev Log: VCL-238 typo fix: should have -h for shutdown instead of -r for reboot Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=820035r1=820034r2=820035view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Tue Sep 29 17:14:14 2009 @@ -144,9 +144,9 @@ } ## end if ($IPCONFIGURATION eq static) #shutdown node - notify($ERRORS{'OK'}, 0, initating reboot for Linux imaging sequence); - run_ssh_command($computer_node_name, $management_node_keys, /sbin/shutdown -r now, root); - notify($ERRORS{'OK'}, 0, sleeping for 60 seconds while machine shuts down and reboots); + notify($ERRORS{'OK'}, 0, shutting down node for Linux imaging sequence); + run_ssh_command($computer_node_name, $management_node_keys, /sbin/shutdown -h now, root); + notify($ERRORS{'OK'}, 0, sleeping for 60 seconds while machine shuts down); sleep 60; notify($ERRORS{'OK'}, 0, returning 1);
svn commit: r820436 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Wed Sep 30 20:37:05 2009 New Revision: 820436 URL: http://svn.apache.org/viewvc?rev=820436view=rev Log: VCL-185 useradd fails if the user_name group exists added groupdel username to delete_user routine Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=820436r1=820435r2=820436view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Wed Sep 30 20:37:05 2009 @@ -548,6 +548,12 @@ } } + # Delete the group + my $user_group_cmd = /usr/sbin/groupdel $user_login_id; + if(run_ssh_command($computer_node_name, $image_identity, $user_delete_command, root)){ + notify($ERRORS{'DEBUG'}, 0, attempted to delete usergroup for $user_login_id); + } + my $imagemeta_rootaccess = $self-data-get_imagemeta_rootaccess(); #Clear user from external_sshd_config @@ -607,9 +613,11 @@ my @sshcmd = run_ssh_command($computer_node_name, $image_identity, $useradd_string, root); foreach my $l (@{$sshcmd[1]}) { - if ($l =~ /user $user_name exists/) { + if ($l =~ /$user_name exists/) { notify($ERRORS{'OK'}, 0, detected user already has account); - + if ($self-delete_user()) { + notify($ERRORS{'OK'}, 0, user has been deleted from $computer_node_name); + } } }
svn commit: r820704 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Thu Oct 1 16:23:46 2009 New Revision: 820704 URL: http://svn.apache.org/viewvc?rev=820704view=rev Log: VCL-185 left out 2nd attempt to add user Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=820704r1=820703r2=820704view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Thu Oct 1 16:23:46 2009 @@ -617,10 +617,12 @@ notify($ERRORS{'OK'}, 0, detected user already has account); if ($self-delete_user()) { notify($ERRORS{'OK'}, 0, user has been deleted from $computer_node_name); + @sshcmd = run_ssh_command($computer_node_name, $image_identity, $useradd_string, root); } } } + if ($user_standalone) { notify($ERRORS{'DEBUG'}, 0, Standalone user setting single-use password); my $reservation_password = $self-data-get_reservation_password();
svn commit: r820757 - /incubator/vcl/trunk/README
Author: fapeeler Date: Thu Oct 1 19:20:22 2009 New Revision: 820757 URL: http://svn.apache.org/viewvc?rev=820757view=rev Log: adding backend dependiences Modified: incubator/vcl/trunk/README Modified: incubator/vcl/trunk/README URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/README?rev=820757r1=820756r2=820757view=diff == --- incubator/vcl/trunk/README (original) +++ incubator/vcl/trunk/README Thu Oct 1 19:20:22 2009 @@ -29,3 +29,30 @@ MySQL 5.0 or later backend: +Tested on CentOS5, Red Hat Advanced Server 4,5, RedHat Fedora Core +MySQL 5 client +Nmap - security scanner +Perl 5.8.0 or later +perl modules (some of these may be built in for your distro): +- MailTools-2.04 +- Class-Data-Inheritable-0.08.tar.gz', +- Devel-StackTrace-1.20.tar.gz', +- Exception-Class-1.26.tar.gz', +- Object-InsideOut-3.52.tar.gz', +- Module-Build-0.30.tar.gz', +- Net-XMPP-1.02.tar.gz', +- GSSAPI-0.26.tar.gz', +- Digest-SHA1-2.12.tar.gz', +- Digest-HMAC-1.01.tar.gz', +- GBARR/Authen-SASL-2.12.tar.gz', +- XML-Stream-1.22.tar.gz', +- Net-Jabber-2.0.tar.gz', +- YAML-0.68.tar.gz', +- RPC-XML-0.64.tar.gz', +- XML-Parser-2.36.tar.gz', +- Crypt-SSLeay-0.57.tar.gz', +- Compress-Raw-Zlib-2.020.tar.gz', +- IO-Compress-2.020.tar.gz', +- DBI-1.609.tar.gz', +- libwww-perl-5.827 +- HTTP-Headers
svn commit: r820763 - /incubator/vcl/trunk/README
Author: fapeeler Date: Thu Oct 1 19:34:24 2009 New Revision: 820763 URL: http://svn.apache.org/viewvc?rev=820763view=rev Log: starting conditional dependiences section Modified: incubator/vcl/trunk/README Modified: incubator/vcl/trunk/README URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/README?rev=820763r1=820762r2=820763view=diff == --- incubator/vcl/trunk/README (original) +++ incubator/vcl/trunk/README Thu Oct 1 19:34:24 2009 @@ -32,6 +32,8 @@ Tested on CentOS5, Red Hat Advanced Server 4,5, RedHat Fedora Core MySQL 5 client Nmap - security scanner +openssh client +DHCP service q Perl 5.8.0 or later perl modules (some of these may be built in for your distro): - MailTools-2.04 @@ -56,3 +58,8 @@ - DBI-1.609.tar.gz', - libwww-perl-5.827 - HTTP-Headers + +Backend Conditional Dependencies: +xCAT 1.3,2.1 - used for provisioning bare-metal machines, using the xcat modules +vmware toolkit - for provisioning virtual machines on ESX and ESXi +Sysprep - for loading correct device drivers for Windows based environments
svn commit: r820767 - /incubator/vcl/trunk/README
Author: fapeeler Date: Thu Oct 1 19:52:29 2009 New Revision: 820767 URL: http://svn.apache.org/viewvc?rev=820767view=rev Log: adding additional deps. Modified: incubator/vcl/trunk/README Modified: incubator/vcl/trunk/README URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/README?rev=820767r1=820766r2=820767view=diff == --- incubator/vcl/trunk/README (original) +++ incubator/vcl/trunk/README Thu Oct 1 19:52:29 2009 @@ -62,4 +62,9 @@ Backend Conditional Dependencies: xCAT 1.3,2.1 - used for provisioning bare-metal machines, using the xcat modules vmware toolkit - for provisioning virtual machines on ESX and ESXi +Provisioning Windows OS: Sysprep - for loading correct device drivers for Windows based environments +NewSID - Windows SID Changing Utility +SPDrvScn - Windows Driver Scanning Utility +WSName - Workstation Name Changing Utility +
svn commit: r821025 - /incubator/vcl/trunk/README
Author: fapeeler Date: Fri Oct 2 14:05:48 2009 New Revision: 821025 URL: http://svn.apache.org/viewvc?rev=821025view=rev Log: more additions Modified: incubator/vcl/trunk/README Modified: incubator/vcl/trunk/README URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/README?rev=821025r1=821024r2=821025view=diff == --- incubator/vcl/trunk/README (original) +++ incubator/vcl/trunk/README Fri Oct 2 14:05:48 2009 @@ -32,8 +32,7 @@ Tested on CentOS5, Red Hat Advanced Server 4,5, RedHat Fedora Core MySQL 5 client Nmap - security scanner -openssh client -DHCP service q +openssh client - All tested OS's had this installed by default Perl 5.8.0 or later perl modules (some of these may be built in for your distro): - MailTools-2.04 @@ -62,6 +61,8 @@ Backend Conditional Dependencies: xCAT 1.3,2.1 - used for provisioning bare-metal machines, using the xcat modules vmware toolkit - for provisioning virtual machines on ESX and ESXi +DHCP service installed and running for managinging IP's on the private +network. Provisioning Windows OS: Sysprep - for loading correct device drivers for Windows based environments NewSID - Windows SID Changing Utility
svn commit: r821028 - /incubator/vcl/trunk/README
Author: fapeeler Date: Fri Oct 2 14:08:23 2009 New Revision: 821028 URL: http://svn.apache.org/viewvc?rev=821028view=rev Log: clean up - removed tar.gz extensions from perl libs deps. Modified: incubator/vcl/trunk/README Modified: incubator/vcl/trunk/README URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/README?rev=821028r1=821027r2=821028view=diff == --- incubator/vcl/trunk/README (original) +++ incubator/vcl/trunk/README Fri Oct 2 14:08:23 2009 @@ -36,25 +36,25 @@ Perl 5.8.0 or later perl modules (some of these may be built in for your distro): - MailTools-2.04 -- Class-Data-Inheritable-0.08.tar.gz', -- Devel-StackTrace-1.20.tar.gz', -- Exception-Class-1.26.tar.gz', -- Object-InsideOut-3.52.tar.gz', -- Module-Build-0.30.tar.gz', -- Net-XMPP-1.02.tar.gz', -- GSSAPI-0.26.tar.gz', -- Digest-SHA1-2.12.tar.gz', -- Digest-HMAC-1.01.tar.gz', -- GBARR/Authen-SASL-2.12.tar.gz', -- XML-Stream-1.22.tar.gz', -- Net-Jabber-2.0.tar.gz', -- YAML-0.68.tar.gz', -- RPC-XML-0.64.tar.gz', -- XML-Parser-2.36.tar.gz', -- Crypt-SSLeay-0.57.tar.gz', -- Compress-Raw-Zlib-2.020.tar.gz', -- IO-Compress-2.020.tar.gz', -- DBI-1.609.tar.gz', +- Class-Data-Inheritable-0.08 +- Devel-StackTrace-1.20 +- Exception-Class-1.26 +- Object-InsideOut-3.52 +- Module-Build-0.30 +- Net-XMPP-1.02 +- GSSAPI-0.26 +- Digest-SHA1-2.12 +- Digest-HMAC-1.01 +- GBARR/Authen-SASL-2.12 +- XML-Stream-1.22 +- Net-Jabber-2.0 +- YAML-0.68 +- RPC-XML-0.64 +- XML-Parser-2.36 +- Crypt-SSLeay-0.57 +- Compress-Raw-Zlib-2.020 +- IO-Compress-2.020 +- DBI-1.609 - libwww-perl-5.827 - HTTP-Headers
svn commit: r821055 - /incubator/vcl/trunk/INSTALLATION
Author: fapeeler Date: Fri Oct 2 15:25:36 2009 New Revision: 821055 URL: http://svn.apache.org/viewvc?rev=821055view=rev Log: adding content to backend section regarding xcat and vmware Modified: incubator/vcl/trunk/INSTALLATION Modified: incubator/vcl/trunk/INSTALLATION URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/INSTALLATION?rev=821055r1=821054r2=821055view=diff == --- incubator/vcl/trunk/INSTALLATION (original) +++ incubator/vcl/trunk/INSTALLATION Fri Oct 2 15:25:36 2009 @@ -238,6 +238,18 @@ 2009-06-16 16:57:15|15792|vcld:main(165)|lastcheckin time updated for management node 18: 2009-06-16 16:57:15 +6. Provisioning Engines and Hypervisors + +VCL supports the following, please see the related site for installation and setup. +xCAT - +Extreme Cluster Administration Tool versions 1.3 and 2.1. +http://xcat.sourceforge.net/ + +VMware - +Free server 1.x, ESX standard Server, ESXi +http://www.vmware.com +Vmware toolkit - http://www.vmware.com/support/developer/viperltoolkit/ + IV. Adding extra local accounts
svn commit: r822314 - /incubator/vcl/trunk/CHANGELOG
Author: fapeeler Date: Tue Oct 6 15:23:12 2009 New Revision: 822314 URL: http://svn.apache.org/viewvc?rev=822314view=rev Log: added comments on database and backend Added line explaining the Jira issues. Modified: incubator/vcl/trunk/CHANGELOG Modified: incubator/vcl/trunk/CHANGELOG URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/CHANGELOG?rev=822314r1=822313r2=822314view=diff == --- incubator/vcl/trunk/CHANGELOG (original) +++ incubator/vcl/trunk/CHANGELOG Tue Oct 6 15:23:12 2009 @@ -6,9 +6,19 @@ -no testing with PHP 4 was done. VCL may work under PHP 4, but PHP 5 was assumed during development. database: -no changes +removed department table and deptid references in other tables +added variable table backend: +Modularize OS and Provisioning modules +Created Datastructure - to provide ease of passing or fetching relevant +data with modules,routines. +Support for xCAT2.1 +Support for Linux Virtual machines +Support for VMware ESXi using vsphere toolkit + + +Bug/Feature issues exported from JIRA ** Sub-task * [VCL-67] - Allow OS, provisioning engine, and other module objects to access each other
svn commit: r832875 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Wed Nov 4 21:21:36 2009 New Revision: 832875 URL: http://svn.apache.org/viewvc?rev=832875view=rev Log: VCL-263 create a usergroup vcl added the -g vcl option to the useradd cmd Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=832875r1=832874r2=832875view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Wed Nov 4 21:21:36 2009 @@ -609,7 +609,11 @@ my $user_standalone = $self-data-get_user_standalone(); my $user_uid = $self-data-get_user_uid(); - my $useradd_string = /usr/sbin/useradd -u $user_uid -d /home/$user_name -m $user_name; + if($self-add_vcl_usergroup()){ + + } + + my $useradd_string = /usr/sbin/useradd -u $user_uid -d /home/$user_name -m $user_name -g vcl; my @sshcmd = run_ssh_command($computer_node_name, $image_identity, $useradd_string, root); foreach my $l (@{$sshcmd[1]}) { @@ -918,7 +922,34 @@ return 1; } ## end sub stop_external_sshd +#/ + +=head2 add_vcl_usergroup + + Parameters : + Returns : 1 + Description : step to add a user group to avoid group errors from useradd cmd + +=cut + +sub add_vcl_usergroup { + my $self = shift; + if (ref($self) !~ /linux/i) { + notify($ERRORS{'CRITICAL'}, 0, subroutine was called as a function, it must be called as a class method); + return; + } + + my $management_node_keys = $self-data-get_management_node_keys(); + my $computer_node_name = $self-data-get_computer_node_name(); + my $identity = $self-data-get_image_identity; + + if(run_ssh_command($computer_node_name, $identity, groupadd vcl, root)){ + notify($ERRORS{'DEBUG'}, 0, successfully added the vcl user group); + } + + return 1; +} sub is_connected { my $self = shift; if (ref($self) !~ /linux/i) {
svn commit: r880844 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Mon Nov 16 16:55:24 2009 New Revision: 880844 URL: http://svn.apache.org/viewvc?rev=880844view=rev Log: VCL-267 corrected how the parent id was determined Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=880844r1=880843r2=880844view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Mon Nov 16 16:55:24 2009 @@ -9154,18 +9154,34 @@ my $reservation_id = $request_data-{RESERVATIONID}; my $computer_short_name = $request_data-{reservation}{$reservation_id}{computer}{SHORTNAME}; my $image_OS_type = $request_data-{reservation}{$reservation_id}{image}{OS}{type}; + my $is_cluster_parent = $request_data-{PARENTIMAGE}; + my $is_cluster_child= $request_data-{SUBIMAGE}; my $cluster_info = /tmp/$computer_short_name.cluster_info; my @cluster_string = ; + + + + my @reservation_ids = sort keys %{$request_data-{reservation}}; + + # parent reservation id lowest + my $parent_reservation_id = min @reservation_ids; + notify($ERRORS{'DEBUG'}, 0, $computer_short_name is_cluster_parent = $is_cluster_parent ); + notify($ERRORS{'DEBUG'}, 0, $computer_short_name is_cluster_child = $is_cluster_child ); + notify($ERRORS{'DEBUG'}, 0, parent_reservation_id = $parent_reservation_id ); + foreach my $rid (keys %{$request_data-{reservation}}) { - if ($rid == $reservation_id) { + if ($rid == $parent_reservation_id) { push(@cluster_string, parent= $request_data-{reservation}{$rid}{computer}{IPaddress} . \n); + notify($ERRORS{'DEBUG'}, 0, writing parent= $request_data-{reservation}{$rid}{computer}{IPaddress}); } else { push(@cluster_string, child= $request_data-{reservation}{$rid}{computer}{IPaddress} . \n); + notify($ERRORS{'DEBUG'}, 0, writing child= $request_data-{reservation}{$rid}{computer}{IPaddress}); } } + if (open(CLUSTERFILE, $cluster_info)) { print CLUSTERFILE @cluster_string; close(CLUSTERFILE);
svn commit: r881795 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Wed Nov 18 15:04:31 2009 New Revision: 881795 URL: http://svn.apache.org/viewvc?rev=881795view=rev Log: VCL-268 added 3 OS ids Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=881795r1=881794r2=881795view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Wed Nov 18 15:04:31 2009 @@ -1253,7 +1253,10 @@ (30, 'ubuntuimage', 'Ubuntu image', 'linux', 'partimage', 'image', 14), (31, 'vmwarewin2008', 'VMware Windows Server 2008', 'windows', 'vmware', 'vmware_images', 16), (32, 'win2008', 'Windows Server 2008', 'windows', 'partimage', 'image', 16), -(33, 'vmwarewinvista', 'VMware Windows Vista', 'windows', 'vmware', 'vmware_images', 7); +(33, 'vmwarewinvista', 'VMware Windows Vista', 'windows', 'vmware', 'vmware_images', 7), +(34, 'win7', 'Windows 7', 'windows', 'partimage', 'image', 7), +(35, 'vmwarewincw7vista', 'VMware Windows 7', 'windows', 'vmware', 'vmware_images', 7), +(36, 'vmwarelinux', 'VMware Generic Linux', 'linux', 'vmware', 'vmware_images', 5); -- -- Dumping data for table `OSinstalltype`
svn commit: r882594 - in /incubator/vcl/trunk/managementnode/lib/VCL: Module/OS/Linux.pm reserved.pm utils.pm
Author: fapeeler Date: Fri Nov 20 15:05:45 2009 New Revision: 882594 URL: http://svn.apache.org/viewvc?rev=882594view=rev Log: VCL-265 utils.pm: if uid is NULL, set to 0 Linux.pm: if uid is 0, let OS set uid VCL-271: utils.pm: cleaned out unused routines disable_sshd,enable_sshd,add_user,del_user reserved.pm: removed legacy code from reserved Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm incubator/vcl/trunk/managementnode/lib/VCL/reserved.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=882594r1=882593r2=882594view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Fri Nov 20 15:05:45 2009 @@ -613,7 +613,14 @@ } - my $useradd_string = /usr/sbin/useradd -u $user_uid -d /home/$user_name -m $user_name -g vcl; + my $useradd_string; + if(defined($user_uid) $user_uid != 0){ + $useradd_string = /usr/sbin/useradd -u $user_uid -d /home/$user_name -m $user_name -g vcl; + } + else{ + $useradd_string = /usr/sbin/useradd -d /home/$user_name -m $user_name -g vcl; + } + my @sshcmd = run_ssh_command($computer_node_name, $image_identity, $useradd_string, root); foreach my $l (@{$sshcmd[1]}) { @@ -705,6 +712,7 @@ notify($ERRORS{'CRITICAL'}, 0, failed to add AllowUsers $user to external_sshd_config); return 0; } + undef @sshcmd; @sshcmd = run_ssh_command($computer_node_name, $identity, /etc/init.d/ext_sshd restart, root); Modified: incubator/vcl/trunk/managementnode/lib/VCL/reserved.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/reserved.pm?rev=882594r1=882593r2=882594view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/reserved.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/reserved.pm Fri Nov 20 15:05:45 2009 @@ -110,7 +110,6 @@ my $image_os_type= $self-data-get_image_os_type(); my $request_forimaging = $self-data-get_request_forimaging; my $image_name = $self-data-get_image_name(); - my $user_uid = $self-data-get_user_uid(); my $user_unityid = $self-data-get_user_login_id(); my $user_standalone = $self-data-get_user_standalone(); my $imagemeta_checkuser = $self-data-get_imagemeta_checkuser(); @@ -156,7 +155,7 @@ } notify($ERRORS{'OK'}, 0, computer info: id=$computer_id, type=$computer_type, hostname=$nodename); - notify($ERRORS{'OK'}, 0, user info: uid=$user_uid, unity id=$user_unityid, standalone=$user_standalone); + notify($ERRORS{'OK'}, 0, user info: login_id id=$user_unityid, standalone=$user_standalone); notify($ERRORS{'OK'}, 0, imagemeta checkuser set to: $imagemeta_checkuser); notify($ERRORS{'OK'}, 0, formimaging set to: $request_forimaging); @@ -209,107 +208,12 @@ notify($ERRORS{'WARNING'}, 0, failed to grant OS access on $nodename); } } + else{ + notify($ERRORS{'CRITICAL'}, 0,failed to grant access . ref($self-os) . ::grant_access() subroutine not implemented); + insertloadlog($reservation_id, $computer_id, failed, failed to grant access, grant_access ); + return; + } - # Older style code, remove below once all OS's have been modularized - # Check if computer type is blade - elsif ($computer_type =~ /blade|virtualmachine/) { - notify($ERRORS{'OK'}, 0, blade or virtual machine detected: $computer_type); - # different senerios - # standard -- 1-1-1 with connection checks - # group access M-N-K -- multiple users need access - # standard with no connection checks - - # Check if linux image - if ($image_os_type =~ /linux/){ - notify($ERRORS{'OK'}, 0, Linux image detected: $image_os_name); - - # adduser ; this adds user and restarts sshd - # check for group access - - my $grpflag = 0; - my @group; - - if ($imagemeta_usergroupid ne '') { - notify($ERRORS{'OK'}, 0, group
svn commit: r888079 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
Author: fapeeler Date: Mon Dec 7 18:54:57 2009 New Revision: 888079 URL: http://svn.apache.org/viewvc?rev=888079view=rev Log: VCL-275 corrected usage math. Added additional usage conditions for setting timeframe Added more debug statments for vcld.log VCL-92 Previously done in another commit. HAVING count 1 Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=888079r1=888078r2=888079view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Mon Dec 7 18:54:57 2009 @@ -13,7 +13,7 @@ # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ### @@ -211,15 +211,31 @@ } my $avail = $data[0]{cnt}; - # check if 75% usage, look at past 2 days, otherwise, look at past 6 months + # check if X% usage, look at past X days, otherwise, look at past 2 months my $timeframe; - if (($avail / $online) 0.75) { + my $notavail = ($online - $avail); + if (($notavail / $online) 0.75) { $timeframe = '2 DAY'; } + elsif(($notavail / $online) 0.55) { + $timeframe = '5 DAY'; + } + elsif(($notavail / $online) 0.45) { + $timeframe = '10 DAY'; + } + elsif(($notavail / $online) 0.35) { + $timeframe = '20 DAY'; + } + elsif(($notavail / $online) 0.25) { + $timeframe = '30 DAY'; + } else { - $timeframe = '6 MONTH'; + $timeframe = '2 MONTH'; } + notify($ERRORS{'OK'}, 0, $notify_prefix computer_short_name= $computer_short_name type= $type); + notify($ERRORS{'OK'}, 0, $notify_prefix avail= $avail notavail= $notavail online= $online timeframe= $timeframe); + # what images map to this computer my $select_mapped_images = SELECT @@ -318,6 +334,8 @@ my %row = %{$_}; push(@imgids, $row{subid}); } + my $numselected_imagids = @imgids; + notify($ERRORS{'OK'}, 0, $notify_prefix $numselected_imagids of available images that can go on $computer_short_name); # which of those are loaded $inlist = join(',', @imgids); @@ -338,6 +356,8 @@ my %row = %{$_}; push(@loaded, $row{currentimageid}); } + my $already_loaded_once = @loaded; + notify($ERRORS{'OK'}, 0, $notify_prefix $already_loaded_once of available images $numselected_imagids already loaded at least once); # which of those are not loaded (find difference of @imagids and @loaded) my (@intersection, @notloaded, $element); @@ -348,6 +368,9 @@ push @{$count{$element} 1 ? \...@intersection : \...@notloaded}, $element; } + my $not_loaded = @notloaded; + notify($ERRORS{'OK'}, 0, $notify_prefix $not_loaded of available images $numselected_imagids that are not loaded at least once); + # get the most popular in $timeframe $inlist = join(',', @notloaded); my $select_imageid = @@ -370,6 +393,8 @@ } my $imageid = $data[0]{imageid}; + notify($ERRORS{'OK'}, 0, $notify_prefix imageid= $imageid is most popular image duing last $timeframe); + # get extra data about the image my $select_extra = SELECT
svn commit: r888106 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
Author: fapeeler Date: Mon Dec 7 19:42:50 2009 New Revision: 888106 URL: http://svn.apache.org/viewvc?rev=888106view=rev Log: VCL-275 cleaned up debug statements Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=888106r1=888105r2=888106view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Mon Dec 7 19:42:50 2009 @@ -335,7 +335,7 @@ push(@imgids, $row{subid}); } my $numselected_imagids = @imgids; - notify($ERRORS{'OK'}, 0, $notify_prefix $numselected_imagids of available images that can go on $computer_short_name); + notify($ERRORS{'OK'}, 0, $notify_prefix $numselected_imagids available images can go on $computer_short_name); # which of those are loaded $inlist = join(',', @imgids); @@ -357,7 +357,7 @@ push(@loaded, $row{currentimageid}); } my $already_loaded_once = @loaded; - notify($ERRORS{'OK'}, 0, $notify_prefix $already_loaded_once of available images $numselected_imagids already loaded at least once); + notify($ERRORS{'OK'}, 0, $notify_prefix $already_loaded_once of $numselected_imagids available images already loaded at least once); # which of those are not loaded (find difference of @imagids and @loaded) my (@intersection, @notloaded, $element); @@ -369,7 +369,7 @@ } my $not_loaded = @notloaded; - notify($ERRORS{'OK'}, 0, $notify_prefix $not_loaded of available images $numselected_imagids that are not loaded at least once); + notify($ERRORS{'OK'}, 0, $notify_prefix $not_loaded images not loaded of $numselected_imagids total images that are available for selection); # get the most popular in $timeframe $inlist = join(',', @notloaded);
svn commit: r888108 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
Author: fapeeler Date: Mon Dec 7 19:49:36 2009 New Revision: 888108 URL: http://svn.apache.org/viewvc?rev=888108view=rev Log: vcl-275 typo Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=888108r1=888107r2=888108view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Mon Dec 7 19:49:36 2009 @@ -369,7 +369,7 @@ } my $not_loaded = @notloaded; - notify($ERRORS{'OK'}, 0, $notify_prefix $not_loaded images not loaded of $numselected_imagids total images that are available for selection); + notify($ERRORS{'OK'}, 0, $notify_prefix $not_loaded of $numselected_imagids total images that are available for selection); # get the most popular in $timeframe $inlist = join(',', @notloaded);
svn commit: r888139 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
Author: fapeeler Date: Mon Dec 7 21:18:46 2009 New Revision: 888139 URL: http://svn.apache.org/viewvc?rev=888139view=rev Log: typo Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=888139r1=888138r2=888139view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Mon Dec 7 21:18:46 2009 @@ -357,7 +357,7 @@ push(@loaded, $row{currentimageid}); } my $already_loaded_once = @loaded; - notify($ERRORS{'OK'}, 0, $notify_prefix $already_loaded_once of $numselected_imagids available images already loaded at least once); + notify($ERRORS{'OK'}, 0, $notify_prefix $already_loaded_once of $numselected_imagids available images loaded at least once); # which of those are not loaded (find difference of @imagids and @loaded) my (@intersection, @notloaded, $element); @@ -369,7 +369,7 @@ } my $not_loaded = @notloaded; - notify($ERRORS{'OK'}, 0, $notify_prefix $not_loaded of $numselected_imagids total images that are available for selection); + notify($ERRORS{'OK'}, 0, $notify_prefix $not_loaded of $numselected_imagids total images available for selection); # get the most popular in $timeframe $inlist = join(',', @notloaded); @@ -393,7 +393,7 @@ } my $imageid = $data[0]{imageid}; - notify($ERRORS{'OK'}, 0, $notify_prefix imageid= $imageid is most popular image duing last $timeframe); + notify($ERRORS{'OK'}, 0, $notify_prefix imageid= $imageid is most popular image during last $timeframe); # get extra data about the image my $select_extra =
svn commit: r897279 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Author: fapeeler Date: Fri Jan 8 18:03:00 2010 New Revision: 897279 URL: http://svn.apache.org/viewvc?rev=897279view=rev Log: VCL-286 added update_public_hostname routine - collects the hostname of the public IP address and sets the hostname of the node Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=897279r1=897278r2=897279view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Fri Jan 8 18:03:00 2010 @@ -240,6 +240,11 @@ if ($self-clear_private_keys()) { notify($ERRORS{'OK'}, 0, cleared known identity keys); } + + #Update Hostname to match Public assigned name + if($self-update_public_hostname()){ + notify($ERRORS{'OK'}, 0, Updated hostname); + } # Run the vcl_post_load script if it exists in the image my $script_path = '/etc/init.d/vcl_post_load'; @@ -298,6 +303,61 @@ #/ +=head2 update_public_hostname + + Parameters : + Returns : 1,0 success or failure + Description : To be used for nodes that have both private and public addresses. +Set hostname to that of the public address. + +=cut + +sub update_public_hostname { + my $self = shift; + unless (ref($self) $self-isa('VCL::Module')) { +notify($ERRORS{'CRITICAL'}, 0, subroutine can only be called as a VCL::Module module object method); +return; + } + + my $management_node_keys = $self-data-get_management_node_keys(); + my $computer_node_name = $self-data-get_computer_node_name(); + my $image_os_type= $self-data-get_image_os_type(); + my $image_os_name= $self-data-get_image_os_name(); + my $computer_short_name = $self-data-get_computer_short_name(); + my $public_hostname; + +#Get the IP address of the public adapter + + my $public_IP_address = getdynamicaddress($computer_short_name, $image_os_name, $image_os_type); +if (!($public_IP_address)) { +notify($ERRORS{'WARNING'}, 0, Unable to get public IP address); +return 0; +} + +#Get the hostname for the public IP address +my $get_public_hostname = /bin/ipcalc --hostname $public_IP_address; +my ($ipcalc_status, $ipcalc_output) = run_ssh_command($computer_short_name, $management_node_keys,$get_public_hostname); +if (!defined($ipcalc_status)) { +notify($ERRORS{'WARNING'}, 0, unable to run ssh cmd $get_public_hostname on $computer_short_name); +return 0; +} +elsif (@$ipcalc_output =~ /HOSTNAME=(.*)/i) { +$public_hostname = $1; +notify($ERRORS{'DEBUG'}, 0, collected public hostname= $public_hostname); +} + +#Set the node's hostname to public hostname +my ($set_hostname_status, $set_hostname_output) = run_ssh_command($computer_short_name, $management_node_keys,hostname -v $public_hostname); +unless (defined($set_hostname_status) $set_hostname_status == 0) { + notify($ERRORS{'OK'}, 0, failed to set public_hostname on $computer_short_name output: @${set_hostname_output}); +} + +notify($ERRORS{'OK'}, 0, successfully set public_hostname on $computer_short_name output: @${set_hostname_output}); +return 1; + +} +#/ + =head2 clear_private_keys Parameters :
svn commit: r921566 - /incubator/vcl/trunk/INSTALLATION
Author: fapeeler Date: Wed Mar 10 20:57:25 2010 New Revision: 921566 URL: http://svn.apache.org/viewvc?rev=921566view=rev Log: added text to installing perl modules Modified: incubator/vcl/trunk/INSTALLATION Modified: incubator/vcl/trunk/INSTALLATION URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/INSTALLATION?rev=921566r1=921565r2=921566view=diff == --- incubator/vcl/trunk/INSTALLATION (original) +++ incubator/vcl/trunk/INSTALLATION Wed Mar 10 20:57:25 2010 @@ -138,7 +138,7 @@ MySQL 5 client Nmap - security scanner OpenSSH client - All distros usually have this installed by default Perl 5.8.0 or later -Perl modules SEE STEP 2 below in Installation (some of these may be built in for your distro): +Perl modules SEE STEP 2 below in Installation (some of these may be built in for your distro or not even required if your not using jabber) - MailTools 2.04 - Class-Data-Inheritable 0.08 - Devel-StackTrace 1.20
svn commit: r926747 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm
Author: fapeeler Date: Tue Mar 23 19:37:22 2010 New Revision: 926747 URL: http://svn.apache.org/viewvc?rev=926747view=rev Log: VCL-239 - path change for nodeset to XCATROOT/sbin - getting private_ip_address from database instead of /etc/hosts file Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm 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=926747r1=926746r2=926747view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT21.pm Tue Mar 23 19:37:22 2010 @@ -160,6 +160,7 @@ sub load { my $computer_id = $self-data-get_computer_id(); my $computer_node_name= $self-data-get_computer_node_name(); my $computer_ip_address = $self-data-get_computer_ip_address(); + my $computer_private_ip_address = $self-data-get_computer_private_ip_address(); my $image_os_install_type = $self-data-get_image_os_install_type(); notify($ERRORS{'OK'}, 0, nodename not set) @@ -261,7 +262,7 @@ sub load { my $maxload = 1; while ($maxload) { notify($ERRORS{'DEBUG'}, 0, running 'nodeset all stat' to determine number of nodes currently being loaded); - if (open(NODESET, $XCAT_ROOT/bin/nodeset all stat \| egrep \'install\|image\' 21 | )) { + if (open(NODESET, $XCAT_ROOT/sbin/nodeset all stat \| egrep \'install\|image\' 21 | )) { my @nodesetout = NODESET; close(NODESET); my $ld = @nodesetout; @@ -274,7 +275,7 @@ sub load { notify($ERRORS{'OK'}, 0, current nodes loading=$ld, throttle=$THROTTLE, must wait, sleeping for 10 seconds); sleep 10; } - } ## end if (open(NODESET, $XCAT_ROOT/bin/nodeset all stat \| grep install 21 | ... + } ## end if (open(NODESET, $XCAT_ROOT/sbin/nodeset all stat \| grep install 21 | ... else { notify($ERRORS{'WARNING'}, 0, failed to run 'nodeset all stat' to determine number of nodes currently being loaded); } @@ -426,7 +427,7 @@ sub load { # Check progress, locate MAC and IP address for this node, monitor /var/log/messages for communication from node # dhcp req/ack, xcat calls, etc - my ($eth0MACaddress, $privateIP); + my ($eth0MACaddress); # get MAC address if (open(NODELS, $XCAT_ROOT/bin/nodels $computer_node_name mac.mac 21 |)) { @@ -448,21 +449,6 @@ sub load { notify($ERRORS{'WARNING'}, 0, MAC address not found for $computer_node_name , possible issue with regex); } - #should also store/pull private address from the database - if (open(HOSTS, /etc/hosts)) { - my @hosts = HOSTS; - close(HOSTS); - foreach my $line (@hosts) { - if ($line =~ /([0-9]*.[0-9]*.[0-9]*.[0-9]*)\s+($computer_node_name)/) { - $privateIP = $1; - notify($ERRORS{'OK'}, 0, PrivateIP address for $computer_node_name collected $privateIP); - last; - } - } - } ## end if (open(HOSTS, /etc/hosts)) - if (!defined($privateIP)) { - notify($ERRORS{'WARNING'}, 0, private IP address not found for $computer_node_name, possible issue with regex); - } my ($s1, $s2, $s3, $s4, $s5) = 0; my $sloop = 0; #insertloadlog($reservation_id,$computer_id,info,SUCCESS initiated install process); @@ -473,7 +459,7 @@ sub load { my $t; my $maxloops = 45; - if ($eth0MACaddress $privateIP) { + if ($eth0MACaddress $computer_private_ip_address) { @TAILLOG = 0; $t = 0; if (open(TAIL, /var/log/messages)) { @@ -489,14 +475,14 @@ sub load { } } if (!$s2) { - if ($_ =~ /dhcpd: DHCPACK on $privateIP to $eth0MACaddress
svn commit: r958683 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Mon Jun 28 18:58:54 2010 New Revision: 958683 URL: http://svn.apache.org/viewvc?rev=958683view=rev Log: VCL-351 extended schema to allow for at least two more virtual adatpers Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=958683r1=958682r2=958683view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Mon Jun 28 18:58:54 2010 @@ -1009,6 +1009,8 @@ CREATE TABLE IF NOT EXISTS `vmprofile` ( `vmpath` varchar(128) default NULL, `virtualswitch0` varchar(80) NOT NULL default 'VMnet0', `virtualswitch1` varchar(80) NOT NULL default 'VMnet2', + `virtualswitch2` varchar(80) NULL default NULL, + `virtualswitch3` varchar(80) NULL default NULL, `vmdisk` enum('localdisk','networkdisk') NOT NULL default 'localdisk', `username` varchar(80) NULL default NULL, `password` varchar(256) NULL default NULL,
svn commit: r961834 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Thu Jul 8 16:39:45 2010 New Revision: 961834 URL: http://svn.apache.org/viewvc?rev=961834view=rev Log: VCL-346 cleaned up regex Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=961834r1=961833r2=961834view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Thu Jul 8 16:39:45 2010 @@ -1596,7 +1596,7 @@ sub getdynamicaddress { my @hosts = HOSTS; close(HOSTS); foreach my $line (@hosts) { - if ($line =~ /([0-9]*.[0-9]*.[0-9]*.[0-9]*)\s+($node)(\s\.)/) { + if ($line =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+($node)/) { $privateIP = $1; notify($ERRORS{'OK'}, 0, PrivateIP address for $node collected $privateIP); last;
svn commit: r963750 - in /incubator/vcl/trunk/managementnode/lib/VCL: image.pm inuse.pm makeproduction.pm new.pm reserved.pm
Author: fapeeler Date: Tue Jul 13 15:01:48 2010 New Revision: 963750 URL: http://svn.apache.org/viewvc?rev=963750view=rev Log: VCL-139 Removed preferred name from all notifications. Not really needed. Modified: incubator/vcl/trunk/managementnode/lib/VCL/image.pm incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm incubator/vcl/trunk/managementnode/lib/VCL/makeproduction.pm incubator/vcl/trunk/managementnode/lib/VCL/new.pm incubator/vcl/trunk/managementnode/lib/VCL/reserved.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/image.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/image.pm?rev=963750r1=963749r2=963750view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/image.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/image.pm Tue Jul 13 15:01:48 2010 @@ -91,7 +91,6 @@ sub process { my $reservation_id = $self-data-get_reservation_id(); my $user_id= $self-data-get_user_id(); my $user_unityid = $self-data-get_user_login_id(); - my $user_preferredname = $self-data-get_user_preferred_name(); my $user_email = $self-data-get_user_email(); my $affiliation_sitewwwaddress = $self-data-get_user_affiliation_sitewwwaddress(); my $affiliation_helpaddress= $self-data-get_user_affiliation_helpaddress(); @@ -288,7 +287,6 @@ sub reservation_successful { my $reservation_id = $self-data-get_reservation_id(); my $user_id= $self-data-get_user_id(); my $user_unityid = $self-data-get_user_login_id(); - my $user_preferredname = $self-data-get_user_preferred_name(); my $user_email = $self-data-get_user_email(); my $affiliation_sitewwwaddress = $self-data-get_user_affiliation_sitewwwaddress(); my $affiliation_helpaddress= $self-data-get_user_affiliation_helpaddress(); @@ -305,7 +303,7 @@ sub reservation_successful { # Send image creation successful email to user my $body_user = END; -$user_preferredname, + Your VCL image creation request for $image_prettyname has succeeded. Please visit $affiliation_sitewwwaddress and you should see an image called $image_prettyname. @@ -371,7 +369,6 @@ sub reservation_failed { my $reservation_id = $self-data-get_reservation_id(); my $user_id= $self-data-get_user_id(); my $user_unityid = $self-data-get_user_login_id(); - my $user_preferredname = $self-data-get_user_preferred_name(); my $user_email = $self-data-get_user_email(); my $affiliation_sitewwwaddress = $self-data-get_user_affiliation_sitewwwaddress(); my $affiliation_helpaddress= $self-data-get_user_affiliation_helpaddress(); @@ -391,7 +388,7 @@ sub reservation_failed { # Send mail to user my $body_user = END; -$user_preferredname, + We apologize for the inconvenience. Your image creation of $image_prettyname has been delayed due to a system issue that prevented the automatic completion. Modified: incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm?rev=963750r1=963749r2=963750view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm Tue Jul 13 15:01:48 2010 @@ -569,7 +569,6 @@ sub _notify_user_endtime { # Store hash variables into local variables my $request_id = $request_data-{id}; my $reservation_id = $request_data-{RESERVATIONID}; - my $user_preferredname = $request_data-{user}{preferredname}; my $user_email = $request_data-{user}{email}; my $user_emailnotices = $request_data-{user}{emailnotices}; my $user_im_name = $request_data-{user}{IMtype}{name}; @@ -584,7 +583,7 @@ sub _notify_user_endtime { my $computer_shortname = $request_data-{reservation}{$reservation_id}{computer}{SHORTNAME}; my $message = EOF; -$user_preferredname, + You have $notice_interval until the end of your reservation for image $image_prettyname. Reservation extensions are available if the machine you are on does not have a reservation immediately following. @@ -655,7 +654,6 @@ sub _notify_user_disconnect { # Store hash variables into local variables my $request_id = $request_data-{id}; my $reservation_id = $request_data-{RESERVATIONID}; - my $user_preferredname = $request_data-{user}{preferredname}; my $user_email
svn commit: r963843 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Tue Jul 13 19:51:33 2010 New Revision: 963843 URL: http://svn.apache.org/viewvc?rev=963843view=rev Log: VCL-178 extended request table Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=963843r1=963842r2=963843view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Tue Jul 13 19:51:33 2010 @@ -643,6 +643,7 @@ CREATE TABLE IF NOT EXISTS `request` ( `end` datetime NOT NULL default '-00-00 00:00:00', `daterequested` datetime NOT NULL default '-00-00 00:00:00', `datemodified` datetime default NULL, + `checkuser` tinyint(1) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `userid` (`userid`), KEY `stateid` (`stateid`),
svn commit: r963846 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Tue Jul 13 20:00:43 2010 New Revision: 963846 URL: http://svn.apache.org/viewvc?rev=963846view=rev Log: VCL-178 default value should be 1 Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=963846r1=963845r2=963846view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Tue Jul 13 20:00:43 2010 @@ -643,7 +643,7 @@ CREATE TABLE IF NOT EXISTS `request` ( `end` datetime NOT NULL default '-00-00 00:00:00', `daterequested` datetime NOT NULL default '-00-00 00:00:00', `datemodified` datetime default NULL, - `checkuser` tinyint(1) unsigned NOT NULL default '0', + `checkuser` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`id`), KEY `userid` (`userid`), KEY `stateid` (`stateid`),
svn commit: r963852 - in /incubator/vcl/trunk/managementnode/lib/VCL: DataStructure.pm utils.pm
Author: fapeeler Date: Tue Jul 13 20:28:14 2010 New Revision: 963852 URL: http://svn.apache.org/viewvc?rev=963852view=rev Log: VCL-178 performing a check in get_request_info, if request_checkuser is disable then set imagemeta checkuser to disabled. Done to reduce the extra code added to new,reserved and inuse modules, etc. Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=963852r1=963851r2=963852view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Tue Jul 13 20:28:14 2010 @@ -135,13 +135,14 @@ $SUBROUTINE_MAPPINGS{request_preload} $SUBROUTINE_MAPPINGS{request_preload_only} = '$self-request_data-{PRELOADONLY}'; $SUBROUTINE_MAPPINGS{request_reservation_count} = '$self-request_data-{RESERVATIONCOUNT}'; $SUBROUTINE_MAPPINGS{request_start_time}= '$self-request_data-{start}'; -#$SUBROUTINE_MAPPINGS{request_stateid} = '$self-request_data-{stateid}'; -$SUBROUTINE_MAPPINGS{request_is_cluster_child} = '$self-request_data-{SUBIMAGE}'; -$SUBROUTINE_MAPPINGS{request_test} = '$self-request_data-{test}'; -$SUBROUTINE_MAPPINGS{request_updated} = '$self-request_data-{UPDATED}'; -#$SUBROUTINE_MAPPINGS{request_userid} = '$self-request_data-{userid}'; -$SUBROUTINE_MAPPINGS{request_state_name} = '$self-request_data-{state}{name}'; -$SUBROUTINE_MAPPINGS{request_laststate_name} = '$self-request_data-{laststate}{name}'; +$SUBROUTINE_MAPPINGS{request_checkuser}= '$self-request_data-{checkuser}'; +#$SUBROUTINE_MAPPINGS{request_stateid} = '$self-request_data-{stateid}'; +$SUBROUTINE_MAPPINGS{request_is_cluster_child} = '$self-request_data-{SUBIMAGE}'; +$SUBROUTINE_MAPPINGS{request_test} = '$self-request_data-{test}'; +$SUBROUTINE_MAPPINGS{request_updated} = '$self-request_data-{UPDATED}'; +#$SUBROUTINE_MAPPINGS{request_userid} = '$self-request_data-{userid}'; +$SUBROUTINE_MAPPINGS{request_state_name} = '$self-request_data-{state}{name}'; +$SUBROUTINE_MAPPINGS{request_laststate_name} = '$self-request_data-{laststate}{name}'; $SUBROUTINE_MAPPINGS{log_userid} = '$self-request_data-{log}{userid}'; $SUBROUTINE_MAPPINGS{log_nowfuture} = '$self-request_data-{log}{nowfuture}'; Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=963852r1=963851r2=963852view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Tue Jul 13 20:28:14 2010 @@ -4393,6 +4393,7 @@ sub get_request_info { request.end AS request_end, request.daterequested AS request_daterequested, request.datemodified AS request_datemodified, + request.checkuser AS request_checkuser, requeststate.name AS requeststate_name, @@ -4613,6 +4614,12 @@ sub get_request_info { else { # Image meta data found, add it to the hash $request_info{reservation}{$reservation_id}{image}{imagemeta} = \%imagemeta_info; + + # If request_checkuser flag is set to 0 then disable user checks here by setting imagemetacheckuser to 0 + unless ($reservation_row{request_checkuser}){ + notify($ERRORS{'DEBUG'}, 0, request checkuser flag is set to $reservation_row{request_checkuser}); + $request_info{reservation}{$reservation_id}{image}{imagemeta}{checkuser} = $reservation_row{request_checkuser}; + } } # Check if the computer associated with this reservation has a vmhostid set
svn commit: r964188 - /incubator/vcl/trunk/managementnode/bin/vcld
Author: fapeeler Date: Wed Jul 14 20:38:58 2010 New Revision: 964188 URL: http://svn.apache.org/viewvc?rev=964188view=rev Log: VCL-149 typo Modified: incubator/vcl/trunk/managementnode/bin/vcld Modified: incubator/vcl/trunk/managementnode/bin/vcld URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/bin/vcld?rev=964188r1=964187r2=964188view=diff == --- incubator/vcl/trunk/managementnode/bin/vcld (original) +++ incubator/vcl/trunk/managementnode/bin/vcld Wed Jul 14 20:38:58 2010 @@ -50,12 +50,13 @@ use 5.008000; use strict; use warnings; -use diagnostics; +#use diagnostics; use Symbol; use POSIX; use Getopt::Long; use English qw( -no_match_vars ); +use Fcntl qw(:DEFAULT :flock); use VCL::utils; use VCL::DataStructure; @@ -136,7 +137,10 @@ sub main () { # Set environment variables for global management node information $ENV{management_node_id} = $management_node_id; + #$ENV{management_node_hostname} = $management_node_hostname; + #$ENV{management_node_info} = $info{managementnode}; notify($ERRORS{'DEBUG'}, $LOGFILE, management_node_id environment variable set: $management_node_id); + #notify($ERRORS{'DEBUG'}, $LOGFILE, management_node_hostname environment variable set: $management_node_hostname); # Get the management node checkin interval from the database if defined # Otherwise, the default is 12 seconds @@ -771,37 +775,37 @@ sub REAPER { =cut sub daemonize { + #Create EX lock on lockfile + my $subsys_lock = /var/lock/subsys/$PROCESSNAME; + sysopen(LOCKFILE, $subsys_lock, O_RDONLY | O_CREAT ) or die unable to open lock file: $PIDFILE \n; + unless(flock(LOCKFILE, LOCK_EX|LOCK_NB)){ + notify($ERRORS{'WARNING'}, $LOGFILE, An process instance of $PROCESSNAME is already running ); + print STDOUT \nFailed to start.\n\nAn instance of $PROCESSNAME is already running\n\n; + print STDERR \nFailed to start.\n\nAn instance of $PROCESSNAME is already running\n\n; + exit; + } + + chdir '/' or die Can't chdir to /: $!; defined(my $pid = fork) or die Can't fork $!; exit if $pid; - - #Create EX lock on lockfile -my $subsys_lock = /var/lock/subsys/$PROCESSNAME; -sysopen(LOCKFILE, $subsys_lock, O_RDONLY | O_CREAT ) or die unable to open lock file: $PIDFILE \n; -unless(flock(LOCKFILE, LOCK_EX|LOCK_NB)){ - #write to log file -notify($ERRORS{'WARNING'}, $LOGFILE, An process instance of $PROCESSNAME is already running ); - # print to STDERR -print STDERR \nFailed to start.\n\nAn instance of $PROCESSNAME is already running\n\n; -exit; -} - -umask 0; -setsid or die Can't start a new session: $!; - -# write pid to pidfile -open(PIDFILE, . $PIDFILE) or notify($ERRORS{'WARNING'}, $LOGFILE, unable to open PID file: $PIDFILE, $!); -print PIDFILE $$ ; -close(PIDFILE); - -#Redirect STDIN,STDOUT,STDERR -open STDIN, '/dev/null' or die Can't read /dev/null $!; -open STDOUT, $LOGFILE or die Can't write $LOGFILE $!; -open STDERR, $LOGFILE or die Can't write $LOGFILE $!; -print Created VCL daemon process: $$\n; + umask 0; + setsid or die Can't start a new session: $!; + # write pid to pidfile + open(PIDFILE, . $PIDFILE) or notify($ERRORS{'WARNING'}, $LOGFILE, unable to open PID file: $PIDFILE, $!); + print PIDFILE $$ ; + close(PIDFILE); + + #Redirect STDIN,STDOUT,STDERR + open STDIN, '/dev/null' or die Can't read /dev/null $!; + open STDOUT, $LOGFILE or die Can't write $LOGFILE $!; + open STDERR, $LOGFILE or die Can't write $LOGFILE $!; + + print Created VCL daemon process: $$\n; + } ## end sub daemonize #/
svn commit: r964458 - /incubator/vcl/trunk/managementnode/bin/vcld
Author: fapeeler Date: Thu Jul 15 15:10:35 2010 New Revision: 964458 URL: http://svn.apache.org/viewvc?rev=964458view=rev Log: VCL-149 Moved preplog_file into daemonize routine if another process is running return non-zero exit code Modified: incubator/vcl/trunk/managementnode/bin/vcld Modified: incubator/vcl/trunk/managementnode/bin/vcld URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/bin/vcld?rev=964458r1=964457r2=964458view=diff == --- incubator/vcl/trunk/managementnode/bin/vcld (original) +++ incubator/vcl/trunk/managementnode/bin/vcld Thu Jul 15 15:10:35 2010 @@ -65,7 +65,6 @@ use VCL::DataStructure; # Turn on autoflush $| = 1; -preplogfile(); # Check if -setup argument was specified if ($SETUP_MODE) { @@ -782,7 +781,7 @@ sub daemonize { notify($ERRORS{'WARNING'}, $LOGFILE, An process instance of $PROCESSNAME is already running ); print STDOUT \nFailed to start.\n\nAn instance of $PROCESSNAME is already running\n\n; print STDERR \nFailed to start.\n\nAn instance of $PROCESSNAME is already running\n\n; - exit; + exit(1); } @@ -799,12 +798,14 @@ sub daemonize { print PIDFILE $$ ; close(PIDFILE); + preplogfile(); + print Created VCL daemon process: $$\n; + #Redirect STDIN,STDOUT,STDERR open STDIN, '/dev/null' or die Can't read /dev/null $!; open STDOUT, $LOGFILE or die Can't write $LOGFILE $!; open STDERR, $LOGFILE or die Can't write $LOGFILE $!; - print Created VCL daemon process: $$\n; } ## end sub daemonize
svn commit: r964495 - in /incubator/vcl/trunk/managementnode: etc/vcl/vcld.conf lib/VCL/utils.pm
Author: fapeeler Date: Thu Jul 15 17:10:07 2010 New Revision: 964495 URL: http://svn.apache.org/viewvc?rev=964495view=rev Log: VCL-163,VCL-224 Removed THROTTLE from conf and utils.pm Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=964495r1=964494r2=964495view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Thu Jul 15 17:10:07 2010 @@ -188,11 +188,6 @@ XCAT=yes LINUXIMAGEid=image -#throttle - to limit the number concurrent bare metal loads -# 0 or commeted out - disabled - no limit -# any number 1 or more - number of simultanous loads -THROTTLE=0 - # XCATROOT - root files for xcat, default is /opt/xcat XCATROOT=/opt/xcat Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=964495r1=964494r2=964495view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Thu Jul 15 17:10:07 2010 @@ -230,7 +230,6 @@ our @EXPORT = qw( $SERVER $SETUP_MODE $SYSADMIN - $THROTTLE $TOOLS $VERBOSE $VMWAREREPOSITORY @@ -258,7 +257,7 @@ INIT { our ($FQDN) = 0; our ($MYSQL_SSL, $MYSQL_SSL_CERT); our ($IPCONFIGURATION, $DNSserver, $GATEWAY, $NETMASK, $ETHDEVICE) = 0; - our ($LINUX_IMAGE, $THROTTLE); + our ($LINUX_IMAGE); our ($VMWARETYPE, $VMWARE_DISK,$VMWARE_MAC_ETH0_GENERATED, $VMWARE_MAC_ETH1_GENERATED); our ($WINDOWS_ROOT_PASSWORD); our ($XMLRPC_USER, $XMLRPC_PASS, $XMLRPC_URL); @@ -466,11 +465,6 @@ INIT { $LINUX_IMAGE = $1; } - #throttle - if ($l =~ /^THROTTLE=([0-9]*)/) { - $THROTTLE = $1; - } - #vmware settings # localdisk if ($l =~ /^VMWARE_DISK=(localdisk|networkdisk)/) { @@ -515,10 +509,6 @@ INIT { $LOGFILE = /var/log/$PROCESSNAME.log; } - if (!$THROTTLE) { - $THROTTLE = 0; - } - if (!$WINDOWS_ROOT_PASSWORD) { $WINDOWS_ROOT_PASSWORD = clOudy; } @@ -588,7 +578,7 @@ our ($LOGFILE, $PIDFILE, $VCLDRPCQUERYKE our ($SERVER, $DATABASE, $WRTUSER, $WRTPASS); our ($MYSQL_SSL, $MYSQL_SSL_CERT); our ($IPCONFIGURATION, $DNSserver, $GATEWAY, $NETMASK, $ETHDEVICE); -our ($LINUX_IMAGE, $THROTTLE); +our ($LINUX_IMAGE); our ($FQDN); our ($VMWARE_DISK); our $XCATROOT = /opt/xcat;
svn commit: r964506 - in /incubator/vcl/trunk/managementnode: etc/vcl/vcld.conf lib/VCL/Module/Provisioning/VMware/VMware.pm lib/VCL/Module/Provisioning/vmware.pm lib/VCL/utils.pm
Author: fapeeler Date: Thu Jul 15 17:53:30 2010 New Revision: 964506 URL: http://svn.apache.org/viewvc?rev=964506view=rev Log: VCL-224 Removed linuximageid Removed getimagesize from utils: all prov modules are using local routines Removed global VMWAREREPOSITORY, each vmware module has local routine for figuring this out Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=964506r1=964505r2=964506view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Thu Jul 15 17:53:30 2010 @@ -186,8 +186,6 @@ ipconfiguration=dynamicDHCP XCAT=yes -LINUXIMAGEid=image - # XCATROOT - root files for xcat, default is /opt/xcat XCATROOT=/opt/xcat Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm?rev=964506r1=964505r2=964506view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm Thu Jul 15 17:53:30 2010 @@ -1874,12 +1874,7 @@ sub get_repository_vmdk_base_directory_p return $self-{repository_base_directory} if (defined $self-{repository_base_directory}); my $repository_vmdk_base_directory; - # Return $VMWAREREPOSITORY if it's set (comes from VMWARE_IMAGEREPOSITORY value in vcld.conf) - if ($VMWAREREPOSITORY) { - $repository_vmdk_base_directory = $VMWAREREPOSITORY; - notify($ERRORS{'DEBUG'}, 0, using VMWARE_IMAGEREPOSITORY value from vcld.conf: $repository_vmdk_base_directory); - } - elsif (my $management_node_install_path = $self-data-get_management_node_install_path()) { + if (my $management_node_install_path = $self-data-get_management_node_install_path()) { $repository_vmdk_base_directory = $management_node_install_path/vmware_images; notify($ERRORS{'DEBUG'}, 0, using managementnode installpath database value: $repository_vmdk_base_directory); } 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=964506r1=964505r2=964506view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Thu Jul 15 17:53:30 2010 @@ -149,6 +149,8 @@ sub load { my $vmclient_privateIPaddress = $self-data-get_computer_ip_address; my $vmclient_publicIPaddress = $self-data-get_computer_private_ip_address; my $vmclient_OSname = $self-data-get_image_os_name; + + my $image_repository_path = $self-_get_image_repository_path(); # Assemble a consistent prefix for notify messages my $notify_prefix = req=$request_id, res=$reservation_id:; @@ -333,13 +335,13 @@ sub load { insertloadlog($reservation_id, $vmclient_computerid, info, image files do not exist on host server, preparing to copy); my $myvmdkfilesize = 0; - if (open(SIZE, du -k $VMWAREREPOSITORY/$requestedimagename 21 |)) { + if (open(SIZE, du -k $image_repository_path/$requestedimagename 21 |)) { my @du = SIZE; close(SIZE); foreach my $d (@du) { if ($d =~ /No such file or directory/) { insertloadlog($reservation_id, $vmclient_computerid, failed, could not collect size of local image files); - notify($ERRORS{'CRITICAL'}, 0, problem checking local vm file size on $VMWAREREPOSITORY/$requestedimagename); + notify($ERRORS{'CRITICAL'}, 0, problem checking local vm file size on $image_repository_path/$requestedimagename); close(TMPLOCK
svn commit: r964511 - /incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf
Author: fapeeler Date: Thu Jul 15 17:58:41 2010 New Revision: 964511 URL: http://svn.apache.org/viewvc?rev=964511view=rev Log: VCL-224 XCAT=yes is not being used XCAT_ROOT is set in utils VMWARE_REPOSITORY is not being used Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=964511r1=964510r2=964511view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Thu Jul 15 17:58:41 2010 @@ -180,19 +180,6 @@ ipconfiguration=dynamicDHCP #NETMASK= #ETHDEVICE=eth1 -# Provisioning systems - -# xCAT - xcat.org - -XCAT=yes - -# XCATROOT - root files for xcat, default is /opt/xcat -XCATROOT=/opt/xcat - -# - VMWARE vmdk image files -# - this can be storage on the management node -VMWARE_IMAGEREPOSITORY=/install/vmware_images - # VMWARE_MAC_ETH0_GENERATED: # VMWARE_MAC_ETH1_GENERATED: # Used when building the vmware vmx file
svn commit: r964513 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Thu Jul 15 18:05:33 2010 New Revision: 964513 URL: http://svn.apache.org/viewvc?rev=964513view=rev Log: VCL-224 VMWARETYPE no used Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=964513r1=964512r2=964513view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Thu Jul 15 18:05:33 2010 @@ -255,7 +255,7 @@ INIT { our ($FQDN) = 0; our ($MYSQL_SSL, $MYSQL_SSL_CERT); our ($IPCONFIGURATION, $DNSserver, $GATEWAY, $NETMASK, $ETHDEVICE) = 0; - our ($VMWARETYPE, $VMWARE_MAC_ETH0_GENERATED, $VMWARE_MAC_ETH1_GENERATED); + our ($VMWARE_MAC_ETH0_GENERATED, $VMWARE_MAC_ETH1_GENERATED); our ($WINDOWS_ROOT_PASSWORD); our ($XMLRPC_USER, $XMLRPC_PASS, $XMLRPC_URL);
svn commit: r964522 - /incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf
Author: fapeeler Date: Thu Jul 15 18:23:37 2010 New Revision: 964522 URL: http://svn.apache.org/viewvc?rev=964522view=rev Log: VCL-224 removed LockerRdUser not used Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=964522r1=964521r2=964522view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Thu Jul 15 18:23:37 2010 @@ -68,14 +68,6 @@ LockerWrtUser=vcl-wrt # Must be a string of characters: A-Z a-z 0-9 wrtPass= -# LockerRdUser: MySQL user account name with write privileges (optional) -LockerRdUser=vcl-rd - -# rdPass: MySQL password of the above LockerRdUser (optional) -# Any length is supported by MySQL -# Must be a string of characters: A-Z a-z 0-9 -rdPass= - # xml-rpc username password and url information # Required for block reservation processing # xmlrpc_username must be the unityid field for a user in the user table
svn commit: r964533 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Thu Jul 15 18:45:39 2010 New Revision: 964533 URL: http://svn.apache.org/viewvc?rev=964533view=rev Log: VCL-224 moving VMWARE_MAC_ethx_generated to database Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=964533r1=964532r2=964533view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Thu Jul 15 18:45:39 2010 @@ -1014,6 +1014,8 @@ CREATE TABLE IF NOT EXISTS `vmprofile` ( `vmdisk` enum('localdisk','networkdisk') NOT NULL default 'localdisk', `username` varchar(80) NULL default NULL, `password` varchar(256) NULL default NULL, + `vmware_mac_eth0_generated` varchar(3) NOT NULL default 'no', + `vmware_mac_eth1_generated` varchar(3) NOT NULL default 'no', PRIMARY KEY (`id`), KEY `vmtypeid` (`vmtypeid`,`imageid`), KEY `imageid` (`imageid`)
svn commit: r964546 - /incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf
Author: fapeeler Date: Thu Jul 15 19:15:28 2010 New Revision: 964546 URL: http://svn.apache.org/viewvc?rev=964546view=rev Log: VCL-224 Removed VMWARE_MAC_ETHX_GENERATED Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=964546r1=964545r2=964546view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Thu Jul 15 19:15:28 2010 @@ -172,16 +172,6 @@ ipconfiguration=dynamicDHCP #NETMASK= #ETHDEVICE=eth1 -# VMWARE_MAC_ETH0_GENERATED: -# VMWARE_MAC_ETH1_GENERATED: -# Used when building the vmware vmx file -# In case you need either vmware to generate the MAC or for you have -# registered MAC addresses. -# yes - allow vmware host server to generate MAC addresses -# no - allow vcl to assign known registered MAC address -VMWARE_MAC_ETH0_GENERATED=no -VMWARE_MAC_ETH1_GENERATED=no - # NOT_STANDALONE: # Used to specify affiliations whose users should NOT have the STANDALONE flag set # This causes users accounts to NOT be added to Linux reservations for the affiliations specified
svn commit: r964807 - in /incubator/vcl/trunk/managementnode: etc/vcl/ lib/VCL/ lib/VCL/Module/OS/ lib/VCL/Module/OS/Linux/ lib/VCL/Module/Provisioning/
Author: fapeeler Date: Fri Jul 16 14:25:33 2010 New Revision: 964807 URL: http://svn.apache.org/viewvc?rev=964807view=rev Log: VCL-224 Moved ipconfiguration to database Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.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 incubator/vcl/trunk/managementnode/lib/VCL/new.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=964807r1=964806r2=964807view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Fri Jul 16 14:25:33 2010 @@ -155,21 +155,6 @@ jabResource=vcl # Windows node root password WINDOWS_ROOT_PASSWORD=cl0udy -#ip address configuration -# for sites that use Dynamic DHCP or static address assignment. -# default is Manual DHCP -# options are: -# manualDHCP -- address is statically assigned in dhcp server -# dynamicDHCP -- address is dynamically assigned from dhcp server -# static -- when public dhcp server is not available, assigments are made - -ipconfiguration=dynamicDHCP - -#dependiences for static assignments - required if set to static -# DNSserver can be comma delimited up to three entries -#DNSserver= -#GATEWAY= -#NETMASK= #ETHDEVICE=eth1 # NOT_STANDALONE: Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=964807r1=964806r2=964807view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Fri Jul 16 14:25:33 2010 @@ -125,6 +125,7 @@ sub pre_capture { my $user_unityid = $self-data-get_user_login_id(); my $managementnode_shortname = $self-data-get_management_node_short_name(); my $computer_private_ip = $self-data-get_computer_private_ip_address(); + my $ip_configuration = $self-data-get_management_node_public_ip_configuration(); notify($ERRORS{'OK'}, 0, beginning Linux-specific image capture preparation tasks: $image_name on $computer_short_name); @@ -150,7 +151,7 @@ sub pre_capture { notify($ERRORS{'WARNING'}, 0, unable to clear known identity keys); } - if ($IPCONFIGURATION eq static) { + if ($ip_configuration eq static) { #so we don't have conflicts we should set the public adapter back to dhcp # reset ifcfg-eth1 back to dhcp # when boot strap it will be set to dhcp @@ -174,7 +175,7 @@ sub pre_capture { } if (unlink($tmpfile)) { } - } ## end if ($IPCONFIGURATION eq static) + } ## end if ($ip_configuration eq static) #Write /etc/rc.local script if(!$self-generate_rc_local()){ Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm?rev=964807r1=964806r2=964807view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Fri Jul 16 14:25:33 2010 @@ -92,6 +92,7 @@ sub capture_prepare { my $user_unityid = $self-data-get_user_login_id(); my $managementnode_shortname = $self-data-get_management_node_short_name(); my $computer_private_ip = $self-data-get_computer_private_ip_address(); + my $ip_configuration = $self-data-get_management_node_public_ip_configuration(); notify($ERRORS{'OK'}, 0, beginning Ubuntu-specific image capture preparation tasks: $image_name on $computer_short_name); @@ -101,7 +102,7 @@ sub capture_prepare { if ($self-delete_user()) { notify($ERRORS{'OK'}, 0, $user_unityid deleted from $computer_node_name); } - if ($IPCONFIGURATION eq static) { + if ($ip_configuration eq static) { #so we don't have
svn commit: r964808 - /incubator/vcl/trunk/mysql/vcl.sql
Author: fapeeler Date: Fri Jul 16 14:31:17 2010 New Revision: 964808 URL: http://svn.apache.org/viewvc?rev=964808view=rev Log: VCL-224 added ipconfiguration data to management node table Modified: incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/mysql/vcl.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/vcl.sql?rev=964808r1=964807r2=964808view=diff == --- incubator/vcl/trunk/mysql/vcl.sql (original) +++ incubator/vcl/trunk/mysql/vcl.sql Fri Jul 16 14:31:17 2010 @@ -496,6 +496,10 @@ CREATE TABLE IF NOT EXISTS `managementno `keys` varchar(1024) default NULL, `predictivemoduleid` smallint(5) unsigned NOT NULL default '1', `sshport` smallint(5) unsigned NOT NULL default '22', + `publicIPconfiguration` enum('dynamicDHCP','manualDHCP','static') NOT NULL default 'dynamicDHCP', + `publicSubnetMask` varchar(56) default NULL, + `publicDefaultGateway` varchar(56) default NULL, + `publicDNSserver` varchar(56) default NULL, PRIMARY KEY (`id`), KEY `stateid` (`stateid`), KEY `ownerid` (`ownerid`),
svn commit: r965893 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Tue Jul 20 16:21:02 2010 New Revision: 965893 URL: http://svn.apache.org/viewvc?rev=965893view=rev Log: removed needless debug statements Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=965893r1=965892r2=965893view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Tue Jul 20 16:21:02 2010 @@ -6177,8 +6177,6 @@ AND managementnode.id != $management_nod $management_node_info-{PUBLIC_DEFAULT_GATEWAY} = $management_node_info-{publicDefaultGateway}; $management_node_info-{PUBLIC_DNS_SERVER} = $management_node_info-{publicDNSserver}; - notify($ERRORS{'DEBUG'}, 0, management node info $management_node_info-{PUBLIC_IP_CONFIGURATION}); - notify($ERRORS{'DEBUG'}, 0, management node info retrieved from database for $shortname); return $management_node_info; } ## end sub get_management_node_info
svn commit: r982350 - in /incubator/vcl/trunk/managementnode: etc/vcl/vcld.conf lib/VCL/Module/OS/Linux.pm lib/VCL/Module/OS/Linux/Ubuntu.pm lib/VCL/utils.pm
Author: fapeeler Date: Wed Aug 4 18:25:34 2010 New Revision: 982350 URL: http://svn.apache.org/viewvc?rev=982350view=rev Log: VCL-224 removed ETHDEVICE from vcld.conf utils.pm: set failover routine setstaticaddress to use eth1 OS modules use the network_configuration data to determine the public interface name VCL-352 Ubuntu.pm - added pre-capture calls to set rc.local,sshd config and ext_sshd startup script Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=982350r1=982349r2=982350view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Wed Aug 4 18:25:34 2010 @@ -151,8 +151,6 @@ jabResource=vcl # Windows node root password WINDOWS_ROOT_PASSWORD=cl0udy -#ETHDEVICE=eth1 - # NOT_STANDALONE: # Used to specify affiliations whose users should NOT have the STANDALONE flag set # This causes users accounts to NOT be added to Linux reservations for the affiliations specified Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=982350r1=982349r2=982350view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Wed Aug 4 18:25:34 2010 @@ -152,29 +152,9 @@ sub pre_capture { } if ($ip_configuration eq static) { - #so we don't have conflicts we should set the public adapter back to dhcp - # reset ifcfg-eth1 back to dhcp - # when boot strap it will be set to dhcp - my @ifcfg; - my $tmpfile = /tmp/createifcfg$computer_node_name; - push(@ifcfg, DEVICE=eth1\n); - push(@ifcfg, BOOTPROTO=dhcp\n); - push(@ifcfg, STARTMODE=onboot\n); - push(@ifcfg, ONBOOT=yes\n); - #write to tmpfile - if (open(TMP, $tmpfile)) { - print TMP @ifcfg; - close(TMP); - } - else { - #print could not write $tmpfile $!\n; - notify($ERRORS{'OK'}, 0, could not write $tmpfile $!); - } - #copy to node - if (run_scp_command($tmpfile, $computer_node_name:/etc/sysconfig/network-scripts/ifcfg-$ETHDEVICE, $management_node_keys)) { - } - if (unlink($tmpfile)) { - } + if ($self-can(set_static_public_address) $self-set_static_public_address()) { +notify($ERRORS{'DEBUG'}, 0, set static public IP address on $computer_node_name using set_static_public_address() method); +} } ## end if ($ip_configuration eq static) #Write /etc/rc.local script @@ -468,7 +448,7 @@ sub set_static_public_address { notify($ERRORS{'OK'}, 0, initiating Linux set_static_public_address on $computer_short_name); my @eth1file; my $tmpfile = /tmp/ifcfg-eth_device-$computer_short_name; - push(@eth1file, DEVICE=eth1\n); + push(@eth1file, DEVICE=$public_interface_name\n); push(@eth1file, BOOTPROTO=static\n); push(@eth1file, IPADDR=$public_ip_address\n); push(@eth1file, NETMASK=$subnet_mask\n); @@ -496,7 +476,7 @@ sub set_static_public_address { #confirm it got there undef @sshcmd; - @sshcmd = run_ssh_command($computer_short_name, $management_node_keys, cat /etc/sysconfig/network-scripts/ifcfg-$ETHDEVICE, root); + @sshcmd = run_ssh_command($computer_short_name, $management_node_keys, cat /etc/sysconfig/network-scripts/ifcfg-$public_interface_name, root); my $success = 0; foreach my $i (@{$sshcmd[1]}) { if ($i =~ /$public_ip_address/) { Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm?rev=982350r1=982349r2=982350view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Wed Aug 4 18:25:34 2010 @@ -103,30 +103,36 @@ sub capture_prepare
svn commit: r982363 - /incubator/vcl/trunk/web/.ht-inc/computers.php
Author: fapeeler Date: Wed Aug 4 18:58:02 2010 New Revision: 982363 URL: http://svn.apache.org/viewvc?rev=982363view=rev Log: VCL-335 set maxlength to 6 and limit to 512000MB Modified: incubator/vcl/trunk/web/.ht-inc/computers.php Modified: incubator/vcl/trunk/web/.ht-inc/computers.php URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/computers.php?rev=982363r1=982362r2=982363view=diff == --- incubator/vcl/trunk/web/.ht-inc/computers.php (original) +++ incubator/vcl/trunk/web/.ht-inc/computers.php Wed Aug 4 18:58:02 2010 @@ -696,7 +696,7 @@ function editOrAddComputer($state) { } print TR\n; print TH align=rightRAM (MB):/TH\n; - print TDINPUT type=text name=ram maxlength=5 value=; + print TDINPUT type=text name=ram maxlength=6 value=; print $data[ram] . /TD\n; print TD; printSubmitErr(RAMERR); @@ -1215,7 +1215,7 @@ function bulkAddComputer() { print /TR\n; print TR\n; print TH align=right nowrapRAM (MB)*:/TH\n; - print TDINPUT type=text name=ram maxlength=5 value=; + print TDINPUT type=text name=ram maxlength=6 value=; print $data[ram] . /TD\n; print TD; printSubmitErr(RAMERR); @@ -2928,9 +2928,9 @@ function processComputerInput($checks=1) $submitErr |= IPADDRERR; $submitErrMsg[IPADDRERR] = There is already a computer with this IP address.; }*/ - if($return[ram] 32 || $return[ram] 20480) { + if($return[ram] 32 || $return[ram] 512000) { $submitErr |= RAMERR; - $submitErrMsg[RAMERR] = RAM must be between 32 and 20480; + $submitErrMsg[RAMERR] = RAM must be between 32 and 512000; } if($return[procspeed] 500 || $return[procspeed] 2) { $submitErr |= PROCSPEEDERR; @@ -3156,9 +3156,9 @@ function processBulkComputerInput($check } } } - if($return[ram] 32 || $return[ram] 20480) { + if($return[ram] 32 || $return[ram] 512000) { $submitErr |= RAMERR; - $submitErrMsg[RAMERR] = RAM must be between 32 and 20480; + $submitErrMsg[RAMERR] = RAM must be between 32 and 512000; } if($return[procspeed] 500 || $return[procspeed] 2) { $submitErr |= PROCSPEEDERR;
svn commit: r983008 - in /incubator/vcl/trunk: managementnode/etc/vcl/vcld.conf managementnode/lib/VCL/DataStructure.pm managementnode/lib/VCL/healthcheck.pm managementnode/lib/VCL/image.pm management
Author: fapeeler Date: Fri Aug 6 15:00:14 2010 New Revision: 983008 URL: http://svn.apache.org/viewvc?rev=983008view=rev Log: VCL-224 moved sysadmin and sharedMailBox email addresses to the management node table Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm incubator/vcl/trunk/managementnode/lib/VCL/image.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=983008r1=983007r2=983008view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Fri Aug 6 15:00:14 2010 @@ -94,30 +94,12 @@ enable_mysql_ssl=no #mysql_ssl_cert: Path to MySQL certificate file mysql_ssl_cert=/etc/vcl/cert/my_ca.crt - -# sysadmin: system administrator email list -# list of email addresses to be used for critical notices regarding failures or problems -# optional, but not recommended to leave blank -# Format: comma delimited list -# Example: john_...@someschool.edu,sysadm...@vcl.someschool.edu -sysadmin= - #Sendmail envelope sender -- Return-path #The return-path should be set if you want email delivery failures to go #to a common place #set this to a known working address that would recieve mail like b...@yourdomain.com RETURNPATH= -# shared mailbox - -# address of a shared mailbox for copies of all notices sent to users -# optional -# leave empty or comment out to disable -# depending on user base this mailbox can grow quite large -# -# users are sent email notices regarding their reservations for new -# reservations, upcoming timeouts and image creations -sharedmailbox= - # default from email address for end-user notifications if not listed in # affilation # database table - normally this would be a list or a help system - but Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=983008r1=983007r2=983008view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Fri Aug 6 15:00:14 2010 @@ -466,6 +466,9 @@ $SUBROUTINE_MAPPINGS{management_node_pub #$SUBROUTINE_MAPPINGS{management_node_public_default_gateway} = '$ENV{management_node_info}{PUBLIC_DEFAULT_GATEWAY}'; $SUBROUTINE_MAPPINGS{management_node_public_dns_server} = '$ENV{management_node_info}{PUBLIC_DNS_SERVER}'; +$SUBROUTINE_MAPPINGS{management_node_sysadmin_email} = '$ENV{management_node_info}{SYSADMIN_EMAIL}'; +$SUBROUTINE_MAPPINGS{management_node_shared_email_box}= '$ENV{management_node_info}{SHARED_EMAIL_BOX}'; + $SUBROUTINE_MAPPINGS{management_node_predictive_module_name} = '$ENV{management_node_info}{predictive_name}'; $SUBROUTINE_MAPPINGS{management_node_predictive_module_pretty_name} = '$ENV{management_node_info}{predictive_prettyname}'; $SUBROUTINE_MAPPINGS{management_node_predictive_module_description} = '$ENV{management_node_info}{predictive_description}'; Modified: incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm?rev=983008r1=983007r2=983008view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm Fri Aug 6 15:00:14 2010 @@ -543,6 +543,8 @@ sub _image_revision_check { sub send_report { my ($hck) = @_; + + my $sysadmin_email = $ENV{management_node_info}{SYSADMIN_EMAIL}; #notify($ERRORS{'OK'},$LOG,$hck-{globalmsg}-{body}\n\n $hck-{globalmsg}-{failedbody}\n); if (defined($hck-{computercount})) { @@ -572,7 +574,7 @@ sub send_report { $hck-{globalmsg}-{body} .= \nAll nodes report ok; } - mail($SYSADMIN, VCL node monitoring report, $hck-{globalmsg}-{body}); + mail($sysadmin_email, VCL node monitoring report, $hck-{globalmsg}-{body}); } ## end sub send_report #/ Modified: incubator/vcl/trunk/managementnode/lib/VCL/image.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/image.pm?rev=983008r1=983007r2=983008view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/image.pm (original) +++ incubator
svn commit: r983047 - in /incubator/vcl/trunk: managementnode/etc/vcl/vcld.conf managementnode/lib/VCL/DataStructure.pm managementnode/lib/VCL/utils.pm mysql/vcl.sql
Author: fapeeler Date: Fri Aug 6 16:46:14 2010 New Revision: 983047 URL: http://svn.apache.org/viewvc?rev=983047view=rev Log: VCL-224 Moved NOT_STANDALONE to db Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm incubator/vcl/trunk/mysql/vcl.sql Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=983047r1=983046r2=983047view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Fri Aug 6 16:46:14 2010 @@ -132,10 +132,3 @@ jabResource=vcl # Windows node root password WINDOWS_ROOT_PASSWORD=cl0udy - -# NOT_STANDALONE: -# Used to specify affiliations whose users should NOT have the STANDALONE flag set -# This causes users accounts to NOT be added to Linux reservations for the affiliations specified -# The format is a comma-separated list of affiliation names -# Notice: this property should NOT be configured for most deployments -NOT_STANDALONE= Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=983047r1=983046r2=983047view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Fri Aug 6 16:46:14 2010 @@ -468,6 +468,7 @@ $SUBROUTINE_MAPPINGS{management_node_pub $SUBROUTINE_MAPPINGS{management_node_sysadmin_email} = '$ENV{management_node_info}{SYSADMIN_EMAIL}'; $SUBROUTINE_MAPPINGS{management_node_shared_email_box}= '$ENV{management_node_info}{SHARED_EMAIL_BOX}'; +$SUBROUTINE_MAPPINGS{management_node_not_standalone}= '$ENV{management_node_info}{NOT_STANDALONE}'; $SUBROUTINE_MAPPINGS{management_node_predictive_module_name} = '$ENV{management_node_info}{predictive_name}'; $SUBROUTINE_MAPPINGS{management_node_predictive_module_pretty_name} = '$ENV{management_node_info}{predictive_prettyname}'; Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=983047r1=983046r2=983047view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Fri Aug 6 16:46:14 2010 @@ -219,7 +219,6 @@ our @EXPORT = qw( $LOGFILE $MYSQL_SSL $MYSQL_SSL_CERT - $NOT_STANDALONE $PIDFILE $PROCESSNAME $WINDOWS_ROOT_PASSWORD @@ -257,9 +256,6 @@ INIT { # Set the VERBOSE flag to 0 by default our $VERBOSE = 0; - # Set the NOT_STANDALONE flag to an empty string by default - our $NOT_STANDALONE = ; - # Set the SETUP_MODE flag to 0 by default our $SETUP_MODE = 0; @@ -426,9 +422,6 @@ INIT { $VERBOSE = $1; } - if ($l =~ /^NOT_STANDALONE=(.*)/i) { - $NOT_STANDALONE = $1; - } }# Close foreach line in conf file }# Close open conf file @@ -491,7 +484,6 @@ our $VERBOSE; our $CONF_FILE_PATH; our $WINDOWS_ROOT_PASSWORD; our ($XMLRPC_USER, $XMLRPC_PASS, $XMLRPC_URL); -our $NOT_STANDALONE; our $DAEMON_MODE; our $SETUP_MODE; our $BIN_PATH; @@ -4582,7 +4574,11 @@ sub get_request_info { # Affiliation specific changes # Check if the user's affiliation is listed in the $NOT_STANDALONE variable - if (grep(/$request_info{user}{affiliation}{name}/, split(/,/, $NOT_STANDALONE))) { + my $not_standalone_list = ; + if(defined($ENV{management_node_info}{NOT_STANDALONE}) $ENV{management_node_info}{NOT_STANDALONE}){ + $not_standalone_list = $ENV{management_node_info}{NOT_STANDALONE}; + } + if (grep(/$request_info{user}{affiliation}{name}/, split(/,/, $not_standalone_list))) { notify($ERRORS{'DEBUG'}, 0, non-standalone affiliation found: $request_info{user}{affiliation}{name}); } else { @@ -6087,6 +6083,9 @@ AND managementnode.id != $management_nod $management_node_info-{SYSADMIN_EMAIL} = $management_node_info-{sysadminEmailAddress}; $management_node_info-{SHARED_EMAIL_BOX} = $management_node_info-{sharedMailBox}; + # Add affiliations that are not to use the standalone passwords + $management_node_info-{NOT_STANDALONE} = $management_node_info-{NOT_STANDALONE}; + # Set
svn commit: r983102 - in /incubator/vcl/trunk/managementnode/lib/VCL: blockrequest.pm utils.pm
Author: fapeeler Date: Fri Aug 6 19:31:20 2010 New Revision: 983102 URL: http://svn.apache.org/viewvc?rev=983102view=rev Log: VCL-254 utils.pm: only collecting blockallocations that are in accepted state blockrequest.pm: when expired - set the status to completed Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm?rev=983102r1=983101r2=983102view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Fri Aug 6 19:31:20 2010 @@ -241,8 +241,8 @@ sub process { if ($status eq expire) { #fork start processing notify($ERRORS{'OK'}, 0, Block Request $blockrequest_id has expired); - if (delete_block_request($blockrequest_id)) { - notify($ERRORS{'OK'}, 0, Removed blockRequest id $blockrequest_id); + if(udpate_block_request_status($blockrequest_id,completed){ + notify($ERRORS{'OK'}, 0, Updated status of blockRequest id $blockrequest_id to completed); } return 1; } @@ -403,6 +403,49 @@ sub delete_block_request { #/ +=head2 udpate_block_request_status + + Parameters : $blockrequest_id + Returns : 0 or 1 + Description : update the status of a blockrequest from the blockrequest table + +=cut + +sub udpate_block_request_status { +my ($blockrequest_id,$status) = @_; + +# Check the arguments +if (!defined($blockrequest_id)) { +notify($ERRORS{'WARNING'}, 0, blockrequest ID was not specified); +return 0; +} +if (!defined($status)) { +notify($ERRORS{'WARNING'}, 0, status was not specified for blockrequest_id $blockrequest_id ); +return 0; +} + +# Construct the update statement +my $update_statement = + UPDATE + blockRequest + SET blockRequest.status = $status + WHERE + blockRequest.id = $blockrequest_id + ; + +# Call the database execute subroutine +if (database_execute($update_statement)) { +return 1; +} +else { +notify($ERRORS{'WARNING'}, 0, unable to updated blockrequest $blockrequest_id blockRequest table ); +return 0; +} + +} + +#/ + =head2 clear_blockTimes Parameters : $blockTimes_id Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=983102r1=983101r2=983102view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Fri Aug 6 19:31:20 2010 @@ -7573,6 +7573,7 @@ sub get_management_node_blockrequests { blockRequest.managementnodeid AS blockRequest_managementnodeid, blockRequest.expireTime AS blockRequest_expireTime, blockRequest.processing AS blockRequest_processing, + blockRequest.status AS blockRequest_status, blockTimes.id AS blockTimes_id, blockTimes.blockRequestid AS blockTimes_blockRequestid, @@ -7585,7 +7586,8 @@ sub get_management_node_blockrequests { LEFT JOIN blockTimes ON ( - blockRequest.id = blockTimes.blockRequestid + blockRequest.id = blockTimes.blockRequestid AND + blockRequest.status = 'accepted' ) WHERE
svn commit: r983774 - /incubator/vcl/trunk/mysql/update-2.2.sql
Author: fapeeler Date: Mon Aug 9 18:58:14 2010 New Revision: 983774 URL: http://svn.apache.org/viewvc?rev=983774view=rev Log: VCL-357 Initial pass at creating a update sql file for 2.2 version Added: incubator/vcl/trunk/mysql/update-2.2.sql Added: incubator/vcl/trunk/mysql/update-2.2.sql URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/mysql/update-2.2.sql?rev=983774view=auto == --- incubator/vcl/trunk/mysql/update-2.2.sql (added) +++ incubator/vcl/trunk/mysql/update-2.2.sql Mon Aug 9 18:58:14 2010 @@ -0,0 +1,135 @@ + -- 2.1 to 2.2 schema changes + -- Computer table +ALTER TABLE `computer` DROP `preferredimageid` ; + + -- Table structure for table `loginlog` + -- + + CREATE TABLE IF NOT EXISTS `loginlog` ( + `user` varchar(50) NOT NULL, + `authmech` varchar(30) NOT NULL, + `affiliationid` mediumint(8) unsigned NOT NULL, + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, + `passfail` tinyint(1) unsigned NOT NULL default '0', + `remoteIP` varchar(15) NOT NULL, + KEY `user` (`user`), + KEY `affiliationid` (`affiliationid`) + ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + -- + + -- + -- Table structure for table `winKMS` + -- + + CREATE TABLE IF NOT EXISTS `winKMS` ( + `affiliationid` mediumint(8) unsigned NOT NULL, + `address` varchar(50) NOT NULL, + `port` smallint(5) unsigned NOT NULL default '1688', + UNIQUE KEY `affiliationid_address` (`affiliationid`,`address`) + ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + -- + + -- + -- Table structure for table `winProductKey` + -- + + CREATE TABLE IF NOT EXISTS `winProductKey` ( + `affiliationid` mediumint(8) unsigned NOT NULL, + `productname` varchar(100) NOT NULL, + `productkey` varchar(100) NOT NULL, + UNIQUE KEY `affiliationid_productname` (`affiliationid`,`productname`) + ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + -- + +-- +-- Table structure change for table `managementnode` +-- + +ALTER TABLE `managementnode` ADD `publicIPconfiguration` enum('dynamicDHCP','manualDHCP','static') NOT NULL default 'dynamicDHCP'; +ALTER TABLE `managementnode` ADD `publicSubnetMask` varchar(56) default NULL; +ALTER TABLE `managementnode` ADD `publicDefaultGateway` varchar(56) default NULL; +ALTER TABLE `managementnode` ADD `publicDNSserver` varchar(56) default NULL; +ALTER TABLE `managementnode` ADD `sysadminEmailAddress` varchar(128) default NULL; +ALTER TABLE `managementnode` ADD `sharedMailBox` varchar(128) default NULL; +ALTER TABLE `managementnode` ADD `NOT_STANDALONE` varchar(128) default NULL; + + -- + +-- +-- Table structure change for table `request` +-- + +ALTER TABLE `request` ADD `checkuser` tinyint(1) unsigned NOT NULL default '1'; + + -- + +-- +-- Table structure change for table `vmprofile` +-- + +ALTER TABLE `vmprofile` ADD `virtualswitch2` varchar(80) NULL default NULL; +ALTER TABLE `vmprofile` ADD `virtualswitch3` varchar(80) NULL default NULL; +ALTER TABLE `vmprofile` ADD `vmware_mac_eth0_generated` tinyint(1) NOT NULL default '0'; +ALTER TABLE `vmprofile` ADD `vmware_mac_eth1_generated` tinyint(1) NOT NULL default '0'; + + -- + +-- +-- Inserts for table `module` +-- + +INSERT INTO `module` (`id`, `name`, `prettyname`, `description`, `perlpackage`) VALUES +(17, 'os_win7', 'Windows 7 OS Module', '', 'VCL::Module::OS::Windows::Version_7::7'), +(20, 'provisioning_xCAT_2x', 'xCAT 2x provisioning module', '', 'VCL::Module::Provisioning::xCAT2'); + + -- + +-- +-- Inserts for table `affiliation` +-- + +INSERT INTO `affiliation` (`id`, `name`, `dataUpdateText`) VALUES (2, 'Global', ''); + + -- + +-- +-- Update change for table `image` +-- + +UPDATE `image` SET `name` = 'vmwarewinxp-base7-v0' WHERE `image`.`id` =7 LIMIT 1 ; + + -- + +-- +-- Inserts for table `provisioning` +-- + +INSERT INTO `provisioning` (`id`, `name`, `prettyname`, `moduleid`) VALUES +(7, 'xCAT_2x', 'xCAT 2.x', 20); + + -- + +-- +-- Inserts for table `OS` +-- + +INSERT INTO `OS` (`id`, `name`, `prettyname`, `type`, `installtype`, `sourcepath`, `moduleid`) VALUES +(34, 'win7', 'Windows 7', 'windows', 'partimage', 'image', 17), +(35, 'vmwarewin7', 'VMware Windows 7', 'windows', 'vmware', 'vmware_images', 17), +(36, 'vmwarelinux', 'VMware Generic Linux', 'linux', 'vmware', 'vmware_images', 5); + + -- + +-- +-- Constraints
svn commit: r984076 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Tue Aug 10 15:14:44 2010 New Revision: 984076 URL: http://svn.apache.org/viewvc?rev=984076view=rev Log: the extra 21 was generating a Ambigous output error message on linux lab machine clients. Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=984076r1=984075r2=984076view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Tue Aug 10 15:14:44 2010 @@ -5404,7 +5404,7 @@ sub run_ssh_command { # -p port, Port to connect to on the remote host. # -x, Disables X11 forwarding. # Dont use: -q, Quiet mode. Causes all warning and diagnostic messages to be suppressed. - my $ssh_command = $ssh_path $identity_paths -l $user -p $port -x $node '$command 21' 21; + my $ssh_command = $ssh_path $identity_paths -l $user -p $port -x $node '$command' 21; # Execute the command my $ssh_output;
svn commit: r984871 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Thu Aug 12 17:36:29 2010 New Revision: 984871 URL: http://svn.apache.org/viewvc?rev=984871view=rev Log: VCL-254 moved parens around to capture any time slot that has expired. previous statement would have skipped all entries with skip=1 Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=984871r1=984870r2=984871view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Thu Aug 12 17:36:29 2010 @@ -7589,9 +7589,8 @@ sub get_management_node_blockrequests { WHERE blockRequest.managementnodeid = $managementnode_id AND blockRequest.status = 'accepted' AND - blockTimes.skip = '0' AND -(blockTimes.start (NOW() + INTERVAL 360 MINUTE ) OR -blockTimes.end NOW() ) + (blockTimes.skip = '0' AND blockTimes.start (NOW() + INTERVAL 360 MINUTE )) OR +blockTimes.end NOW() ; # Call the database select subroutine
svn commit: r986123 - in /incubator/vcl/trunk/managementnode/lib/VCL: DataStructure.pm blockrequest.pm utils.pm
Author: fapeeler Date: Mon Aug 16 20:18:17 2010 New Revision: 986123 URL: http://svn.apache.org/viewvc?rev=986123view=rev Log: VCL-254 removed 4hr and 2hr window checks, now if a block allocation is within 6hrs it gets processed. added get_group_name and get_user_info, to get information on sending a confirmation message to the owner Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=986123r1=986122r2=986123view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Mon Aug 16 20:18:17 2010 @@ -105,6 +105,7 @@ $SUBROUTINE_MAPPINGS{blockrequest_name} $SUBROUTINE_MAPPINGS{blockrequest_image_id} = '$self-blockrequest_data-{BLOCKREQUEST_ID}{imageid}'; $SUBROUTINE_MAPPINGS{blockrequest_number_machines}= '$self-blockrequest_data-{BLOCKREQUEST_ID}{numMachines}'; $SUBROUTINE_MAPPINGS{blockrequest_group_id} = '$self-blockrequest_data-{BLOCKREQUEST_ID}{groupid}'; +$SUBROUTINE_MAPPINGS{blockrequest_group_name} = '$self-blockrequest_data-{BLOCKREQUEST_ID}{groupname}'; $SUBROUTINE_MAPPINGS{blockrequest_repeating} = '$self-blockrequest_data-{BLOCKREQUEST_ID}{repeating}'; $SUBROUTINE_MAPPINGS{blockrequest_owner_id} = '$self-blockrequest_data-{BLOCKREQUEST_ID}{ownerid}'; $SUBROUTINE_MAPPINGS{blockrequest_admin_group_id} = '$self-blockrequest_data-{BLOCKREQUEST_ID}{admingroupid}'; Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm?rev=986123r1=986122r2=986123view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Mon Aug 16 20:18:17 2010 @@ -133,8 +133,21 @@ sub process { my $blocktime_end= $self-data-get_blocktime_end(); my $blockrequest_name= $self-data-get_blockrequest_name(); my $blockrequest_owner_id= $self-data-get_blockrequest_owner_id(); + my $block_group_id = $self-data-get_blockrequest_group_id(); + my $block_group_name = $self-data-get_blockrequest_group_name(); - + # Get user info + my %info; + my $owner_affiliation_sitewwwaddress; + my $owner_affiliation_helpaddress; + my $owner_email; + + if( %info = get_user_info($blockrequest_owner_id)){ + $owner_email = $info{email}; + $owner_affiliation_helpaddress = $info{helpaddress}; + $owner_affiliation_sitewwwaddress = $info{sitewwwaddress}; + } + #Set local timer my $localtimer = convert_to_epoch_seconds(); @@ -146,7 +159,9 @@ sub process { notify($ERRORS{'DEBUG'}, 0, blocktime id: $blocktime_id); notify($ERRORS{'DEBUG'}, 0, blocktime processed: $blocktime_processed); notify($ERRORS{'DEBUG'}, 0, blocktime start: $blocktime_start); - notify($ERRORS{'DEBUG'}, 0, blocktime end: $blocktime_end); + notify($ERRORS{'DEBUG'}, 0, owner email: $owner_email); + notify($ERRORS{'DEBUG'}, 0, help address: $owner_email); + notify($ERRORS{'DEBUG'}, 0, owner www addr: $owner_affiliation_sitewwwaddress); if ($blockrequest_mode eq start) { @@ -217,14 +232,41 @@ sub process { } - #pause - if (pauseprocessing($localtimer)) { - notify($ERRORS{'OK'}, 0, past check window for this request, -- ok to proceed); + # Notify block request owner for given time slot has been processed. + + if($completed){ + + my $subject = VCL Block allocation results for $blockrequest_name; + my $mailstring .= EOF; +The block allocation for $blockrequest_name was processed with the following results: + +Block allocation name = $blockrequest_name +Machines allocated = $allocated +Machines requested = $blockrequest_number_machines +Block Start time = $blocktime_start +Block End time = $blocktime_end +User Group = $block_group_name + +The machines for this block allocation will be loaded up to an hour before the actual start time. +Once loaded the users listed in the user group $block_group_name will be able to login up to 15 minutes +before the start time. + +To make changes or to view
svn commit: r986367 - /incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
Author: fapeeler Date: Tue Aug 17 15:58:06 2010 New Revision: 986367 URL: http://svn.apache.org/viewvc?rev=986367view=rev Log: VCL-254 extended query to handle expire times that don't match the blockTimes.end time Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=986367r1=986366r2=986367view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Tue Aug 17 15:58:06 2010 @@ -7602,7 +7602,46 @@ sub get_management_node_blockrequests { # Check to make sure 1 or more rows were returned if (scalar @selected_rows == 0) { - return 0; + #Lets check to see if we have blockRequests that have expired and don't have any time ids + $select_statement = + SELECT + blockRequest.id AS blockRequest_id, + blockRequest.name AS blockRequest_name, + blockRequest.imageid AS blockRequest_imageid, + blockRequest.numMachines AS blockRequest_numMachines, + blockRequest.groupid AS blockRequest_groupid, + blockRequest.repeating AS blockRequest_repeating, + blockRequest.ownerid AS blockRequest_ownerid, + blockRequest.admingroupid AS blockRequest_admingroupid, + blockRequest.managementnodeid AS blockRequest_managementnodeid, + blockRequest.expireTime AS blockRequest_expireTime, + blockRequest.processing AS blockRequest_processing, + blockRequest.status AS blockRequest_status, + + blockTimes.id AS blockTimes_id, + blockTimes.blockRequestid AS blockTimes_blockRequestid, + blockTimes.start AS blockTimes_start, + blockTimes.end AS blockTimes_end, + blockTimes.processed AS blockTimes_processed + + FROM + blockRequest + LEFT JOIN + blockTimes ON ( +blockRequest.id = blockTimes.blockRequestid + ) + + WHERE + blockRequest.managementnodeid = $managementnode_id AND + blockRequest.status = 'accepted' AND + blockRequest.expireTime NOW() + ; + + @selected_rows = database_select($select_statement); + + if (scalar @selected_rows == 0) { + return 0; + } } # Build the hash
svn commit: r986371 - /incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm
Author: fapeeler Date: Tue Aug 17 16:18:25 2010 New Revision: 986371 URL: http://svn.apache.org/viewvc?rev=986371view=rev Log: VCL-254 Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm?rev=986371r1=986370r2=986371view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Tue Aug 17 16:18:25 2010 @@ -263,10 +263,6 @@ EOF sleep 10; - if (update_blockrequest_processing($blockrequest_id, 0)) { - notify($ERRORS{'OK'}, 0, Removed processing flag on blockrequest_id $blockrequest_id); - } - } ## end if ($blockrequest_mode eq start) elsif ($blockrequest_mode eq end) { @@ -286,26 +282,26 @@ EOF if(udpate_block_request_status($blockrequest_id,completed)){ notify($ERRORS{'OK'}, 0, Updated status of blockRequest id $blockrequest_id to completed); } - return 1; } - ##remove processing flag - if (update_blockrequest_processing($blockrequest_id, 0)) { - notify($ERRORS{'OK'}, 0, Removed processing flag on blockrequest_id $blockrequest_id); - } } ## end elsif ($blockrequest_mode eq end) [ if ($blockrequest_mode eq start) elsif ($blockrequest_mode eq expire) { notify($ERRORS{'OK'}, 0, Block Request $blockrequest_id has expired); - if (delete_block_request($blockrequest_id)) { - notify($ERRORS{'OK'}, 0, Removed blockRequest id $blockrequest_id); + if(udpate_block_request_status($blockrequest_id,completed)){ + notify($ERRORS{'OK'}, 0, Updated status of blockRequest id $blockrequest_id to completed); } - return 1; } else { #should not of hit this notify($ERRORS{'CRITICAL'}, 0, mode not determined mode= $blockrequest_mode); } + + ##remove processing flag + if (update_blockrequest_processing($blockrequest_id, 0)) { + notify($ERRORS{'OK'}, 0, Removed processing flag on blockrequest_id $blockrequest_id); + } + return 1; } ## end sub process @@ -470,7 +466,7 @@ sub udpate_block_request_status { my $update_statement = UPDATE blockRequest - SET blockRequest.status = $status + SET blockRequest.status = '$status' WHERE blockRequest.id = $blockrequest_id ;
svn commit: r989138 - in /incubator/vcl/trunk/managementnode: etc/vcl/vcld.conf lib/VCL/utils.pm
Author: fapeeler Date: Wed Aug 25 14:41:01 2010 New Revision: 989138 URL: http://svn.apache.org/viewvc?rev=989138view=rev Log: VCL-224 Removed DEFAULTHELPADDRESS from vcld.conf set this value to vcl_h...@example.org in utils, it would only be used if the affiliation help address is not found. Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf?rev=989138r1=989137r2=989138view=diff == --- incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf (original) +++ incubator/vcl/trunk/managementnode/etc/vcl/vcld.conf Wed Aug 25 14:41:01 2010 @@ -100,13 +100,6 @@ mysql_ssl_cert=/etc/vcl/cert/my_ca.crt #set this to a known working address that would recieve mail like b...@yourdomain.com RETURNPATH= -# default from email address for end-user notifications if not listed in -# affilation -# database table - normally this would be a list or a help system - but -# could be your email address(your address not recommeded for large -# setups) -defaulthelpemail=h...@your.domain.com - #IM support - jabber only at this time #jabber - dependiences on Net::Jabber.pm perl modules # for information on how to install Net::Jabber.pm modules see documentation Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=989138r1=989137r2=989138view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Wed Aug 25 14:41:01 2010 @@ -324,10 +324,6 @@ INIT { $PIDFILE = $1; } - if ($l =~ /^DEFAULTHELPEMAIL=(.*)/) { - $DEFAULTHELPEMAIL = $1; - } - #FQDN - to many issues trying to figure out my FQDN so just tell me if ($l =~ /^FQDN=([-.a-zA-Z0-9]*)/) { $FQDN = $1; @@ -479,7 +475,6 @@ INIT { } ## end INIT -#use Net::Jabber qw(Client); our ($JABBER, $PROCESSNAME); our %ERRORS = ('DEPENDENT' = 4, 'UNKNOWN' = 3, 'OK' = 0, 'WARNING' = 1, 'CRITICAL' = 2, 'MAILMASTERS' = 5, 'DEBUG' = 6); our ($LockerWrtUser, $wrtPass, $database, $server); @@ -500,6 +495,8 @@ our $DAEMON_MODE; our $SETUP_MODE; our $BIN_PATH; +our $DEFAULTHELPEMAIL = vcl_h...@example.org; # default value if affiliation helpaddress is not set + sub makedatestring; #/
svn commit: r993391 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Tue Sep 7 15:15:25 2010 New Revision: 993391 URL: http://svn.apache.org/viewvc?rev=993391view=rev Log: removed check for ls -1 of datastore contents - if datastore is empty it returns 0 and undefined value causing reservations to fail Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=993391r1=993390r2=993391view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Tue Sep 7 15:15:25 2010 @@ -257,13 +257,6 @@ sub load { notify($ERRORS{'OK'}, 0, listing datestore $datastorepath ); undef @sshcmd; @sshcmd = run_ssh_command($hostnode, $management_node_keys, ls -1 $datastorepath, root); - if (!defined(@{$sshcmd[1]})) { - notify($ERRORS{'CRITICAL'}, 0, failed to list data store contents $datastorepath on vm host); - insertloadlog($reservation_id, $vmclient_computerid, failed, failed to list data store contents $datastorepath on vm host); - close(TMPLOCK); - unlink($tmplockfile); - return 0; - } notify($ERRORS{'OK'}, 0, data store contents $datastorepath on vm host:\...@{ $sshcmd[1] }); foreach my $l (@{$sshcmd[1]}) { if ($l =~ /denied|No such/) {
svn commit: r997760 - /incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm
Author: fapeeler Date: Thu Sep 16 14:22:16 2010 New Revision: 997760 URL: http://svn.apache.org/viewvc?rev=997760view=rev Log: Changed wording for block allocatoin notice. Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm?rev=997760r1=997759r2=997760view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/blockrequest.pm Thu Sep 16 14:22:16 2010 @@ -289,11 +289,14 @@ User Group = $block_group_ Environment name = $image_prettyname The machines for this block allocation will be loaded up to an hour before the actual start time. -Once loaded the users listed in the user group $block_group_name will be able to login up to 15 minutes -before the start time. +Once loaded the users listed in the user group $block_group_name will be able to login 5 minutes before the start time. -If you wish to cancel this session or need to make changes to future sessions. Please visit -the VCL site: $blockAlloc_URL +PLEASE NOTE: +The VCL resources are valuable and if you choose not to utilize them during this session, you should make them available for others to use. To skip this session please visit the VCL block allocations page: $blockAlloc_URL +Select View times and skip the desired session. + +Thank You, +VCL Team EOF if(defined($owner_email)){
svn commit: r997780 - /incubator/vcl/trunk/README
Author: fapeeler Date: Thu Sep 16 15:13:26 2010 New Revision: 997780 URL: http://svn.apache.org/viewvc?rev=997780view=rev Log: changes for 2.2 release Modified: incubator/vcl/trunk/README Modified: incubator/vcl/trunk/README URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/README?rev=997780r1=997779r2=997780view=diff == --- incubator/vcl/trunk/README (original) +++ incubator/vcl/trunk/README Thu Sep 16 15:13:26 2010 @@ -7,6 +7,10 @@ incubation status is not necessarily a r stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. + +Please see the INSTALLATION file or the Install guide at the apache vcl site. +This file is only a list of requirements, which are also stated in the Install guide. + System Requirements: Web Frontend: @@ -29,10 +33,21 @@ Database: MySQL 5.0 or later Management Node Backend: -- OS - tested on CentOS 5, RedHat Advanced Server 4 and 5, RedHat Fedora Core 7 - and 9 -- MySQL 5 client +OS - tested on CentOS 5, RedHat Advanced Server 4 and 5 +Packages: +- expat +- expat-devel +- gcc +- krb5-libs +- krb5-devel +- libxml2 +- libxml2-devel +- nmap +- openssl +- openssl-devel - perl-DBD-MySQL +- xmlsec1-openssl +- MySQL 5 client - Nmap security scanner - OpenSSH client - Perl 5.8.x @@ -90,11 +105,12 @@ Management Node Backend Conditional Syst - Bare-metal provisioning If you want to provision bare-metal or physical computers such as blades. You will need xCAT setup and working. This release supports either xCAT 1.3 or - xCAT 2.1. This is useful for very large setups, very custom environments, HPC + xCAT 2.x. This is useful for very large setups, very custom environments, HPC integration, automating VM host servers either ESX standard or VMware Free - Server. + Server. Imaging support using xCAT 2.x is an add on feature. To enable imaging + for xCAT2.X See adding support for partimage and partimage-ng to xCAT 2.x in the vcl apache wiki. - VMware virtual machine provisioning - If you want to provision virtual machines on ESX or ESXi, you will need the + If you want to provision virtual machines on ESX,ESXi, or VMWare Free server 2.x you will need the VMware vSphere toolkit. This toolkit can be obtained from: http://www.vmware.com/support/developer/viperltoolkit/ This toolkit is a set of Perl modules. The toolkit is not required if using @@ -106,7 +122,7 @@ Management Node Backend Conditional Syst - NewSID - used for preparing Windows environments before an image is captured - SPDrvScn - used for scanning device drivers for Windows environments before an image is captured -- Jabber Instant Message Notifications +- Jabber Instant Message Notification(optional)s VCL has the ability to send instant message notifications using Jabber. This feature is optional and can be enabled or disabled by configuring the jabber=[yes|no] property in the vcld.conf file. If Jabber notification @@ -130,5 +146,3 @@ Management Node Backend Conditional Syst http://search.cpan.org/dist/Digest-SHA1/ License: Perl Artistic and GPL - -
svn commit: r998206 - /incubator/vcl/trunk/README
Author: fapeeler Date: Fri Sep 17 17:06:54 2010 New Revision: 998206 URL: http://svn.apache.org/viewvc?rev=998206view=rev Log: added Digest-SHA1 to requirement perl module list Modified: incubator/vcl/trunk/README Modified: incubator/vcl/trunk/README URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/README?rev=998206r1=998205r2=998206view=diff == --- incubator/vcl/trunk/README (original) +++ incubator/vcl/trunk/README Fri Sep 17 17:06:54 2010 @@ -97,6 +97,9 @@ Required Perl modules section of the IN - YAML http://search.cpan.org/dist/YAML/ License: Perl Artistic GPL +- Digest-SHA1 + http://search.cpan.org/dist/Digest-SHA1/ + License: Perl Artistic GPL Management Node Backend Conditional System Requirements: - Bare-metal and virtual machine provisioning
svn commit: r998217 - /incubator/vcl/trunk/managementnode/tools/Windows/Scripts/
Author: fapeeler Date: Fri Sep 17 17:36:37 2010 New Revision: 998217 URL: http://svn.apache.org/viewvc?rev=998217view=rev Log: set executable bit on Windows cmd vbs files Modified: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/add_post_load_run_key.cmd (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/configure_networking.vbs (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/debug_info.cmd (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/delete_post_load_run_key.cmd (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/post_load.cmd (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/run_newsid.cmd (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/set_computer_name.vbs (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/sysprep_cmdlines.cmd (props changed) incubator/vcl/trunk/managementnode/tools/Windows/Scripts/system_startup.cmd (props changed) Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/add_post_load_run_key.cmd -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/configure_networking.vbs -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/debug_info.cmd -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/delete_post_load_run_key.cmd -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/post_load.cmd -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/run_newsid.cmd -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/set_computer_name.vbs -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/sysprep_cmdlines.cmd -- svn:executable = * Propchange: incubator/vcl/trunk/managementnode/tools/Windows/Scripts/system_startup.cmd -- svn:executable = *
svn commit: r998229 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Fri Sep 17 17:55:55 2010 New Revision: 998229 URL: http://svn.apache.org/viewvc?rev=998229view=rev Log: typo Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=998229r1=998228r2=998229view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Fri Sep 17 17:55:55 2010 @@ -508,22 +508,19 @@ sub load { my $cpcmd = /bin/cp -r $srcdir $dstDir; if(defined(run_ssh_command($hostnode, $identity, $cpcmd, root))) { notify($ERRORS{'OK'}, 0, copied $srcdir to $dstDir); - my $renamecmd = vmware-vdiskmanager -n $dstDir/$requestedimagename . .vmdk . -$dstDisk; + my $renamecmd = vmware-vdiskmanager -n $dstDir/$requestedimagename . .vmdk . $dstDisk; if(defined(run_ssh_command($hostnode, $identity, $renamecmd, root))) { - notify($ERRORS{'OK'}, 0, renamed $dstDir/$requestedimagename to $dstDisk + notify($ERRORS{'OK'}, 0, renamed $dstDir/$requestedimagename to $dstDisk); $baseexists = 1; -} -else{ - insertloadlog($reservation_id, $vmclient_computerid, failed, cloning ba -se image failed); - notify($ERRORS{'CRITICAL'}, 0, problem running renamecmd $renamecmd); -close(TMPLOCK); - unlink($tmplockfile); -return 0; - -} -} + } + else{ + insertloadlog($reservation_id, $vmclient_computerid, failed, cloning base image failed); + notify($ERRORS{'CRITICAL'}, 0, problem running renamecmd $renamecmd); + close(TMPLOCK); + unlink($tmplockfile); + return 0; + } + } }
svn commit: r998231 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Fri Sep 17 18:09:37 2010 New Revision: 998231 URL: http://svn.apache.org/viewvc?rev=998231view=rev Log: changed legacy value identity to managenode_keys Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=998231r1=998230r2=998231view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Fri Sep 17 18:09:37 2010 @@ -506,10 +506,10 @@ sub load { elsif($vmtype =~ /freeserver|gsx|vmwareGSX/) { #copy srcdir to dstDir my $cpcmd = /bin/cp -r $srcdir $dstDir; - if(defined(run_ssh_command($hostnode, $identity, $cpcmd, root))) { + if(defined(run_ssh_command($hostnode, $management_node_keys, $cpcmd, root))) { notify($ERRORS{'OK'}, 0, copied $srcdir to $dstDir); my $renamecmd = vmware-vdiskmanager -n $dstDir/$requestedimagename . .vmdk . $dstDisk; - if(defined(run_ssh_command($hostnode, $identity, $renamecmd, root))) { + if(defined(run_ssh_command($hostnode, $management_node_keys, $renamecmd, root))) { notify($ERRORS{'OK'}, 0, renamed $dstDir/$requestedimagename to $dstDisk); $baseexists = 1; }
svn commit: r1000047 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Author: fapeeler Date: Wed Sep 22 15:41:55 2010 New Revision: 147 URL: http://svn.apache.org/viewvc?rev=147view=rev Log: VCL-386 typo Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm 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=147r1=146r2=147view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Wed Sep 22 15:41:55 2010 @@ -2074,7 +2074,7 @@ sub post_maintenance_action { # remove vm machine directory from vmx path # set vmhostid to null in computer table - handled in new.pm - my $computer_name = $self-data-get_computer_short_name; + my $computer_short_name = $self-data-get_computer_short_name; my $computer_id = $self-data-get_computer_id(); my $vmhost_hostname = $self-data-get_vmhost_hostname;
svn commit: r1081425 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm
Author: fapeeler Date: Mon Mar 14 15:33:00 2011 New Revision: 1081425 URL: http://svn.apache.org/viewvc?rev=1081425view=rev Log: VCL-436 Extended a query to restrict which images can be loaded on the node based on the mappings of OSinstalltype and installtype Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm?rev=1081425r1=1081424r2=1081425view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Predictive/Level_1.pm Mon Mar 14 15:33:00 2011 @@ -164,7 +164,7 @@ sub get_next_image { # get machine type my $select_type = SELECT -type +type,provisioningid FROM computer WHERE @@ -176,6 +176,7 @@ sub get_next_image { return 0; } my $type = $data[0]{type}; + my $provisioningid = $data[0]{provisioningid}; # online machines my $select_online = @@ -319,20 +320,28 @@ sub get_next_image { return 0; } + $inlist = join(',', @imggroups); my $select_imageids = SELECT DISTINCT(r.subid) FROM image i, + OS o, resource r, -resourcegroupmembers rgm +resourcegroupmembers rgm, + OSinstalltype osit, + provisioningOSinstalltype posit WHERE rgm.resourceid = r.id AND r.resourcetypeid = 13 AND rgm.resourcegroupid IN ($inlist) AND r.subid = i.id AND i.deleted = 0 + AND i.OSid = o.id + AND o.installtype = osit.name + AND osit.id = posit.OSinstalltypeid + AND posit.provisioningid = $provisioningid ; my @imgids; @data = database_select($select_imageids);
svn commit: r1091419 - in /incubator/vcl/trunk/managementnode/lib/VCL: DataStructure.pm inuse.pm utils.pm
Author: fapeeler Date: Tue Apr 12 14:09:50 2011 New Revision: 1091419 URL: http://svn.apache.org/viewvc?rev=1091419view=rev Log: VCL-432 Added support to automatically capture an imaging reservation when time has expired. This only applies to reservations that have the imaging flag set on the request. It calls the xmlrpc api to start the imaging request. VCL-446 inuse.pm, for reservations greater than 24hr. At certain time intervals notify user their reservation will end Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=1091419r1=1091418r2=1091419view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Tue Apr 12 14:09:50 2011 @@ -136,6 +136,7 @@ $SUBROUTINE_MAPPINGS{request_preload} $SUBROUTINE_MAPPINGS{request_preload_only} = '$self-request_data-{PRELOADONLY}'; $SUBROUTINE_MAPPINGS{request_reservation_count} = '$self-request_data-{RESERVATIONCOUNT}'; $SUBROUTINE_MAPPINGS{request_start_time}= '$self-request_data-{start}'; +$SUBROUTINE_MAPPINGS{request_duration_epoch}= '$self-request_data-{DURATION}'; $SUBROUTINE_MAPPINGS{request_checkuser}= '$self-request_data-{checkuser}'; #$SUBROUTINE_MAPPINGS{request_stateid} = '$self-request_data-{stateid}'; $SUBROUTINE_MAPPINGS{request_is_cluster_child} = '$self-request_data-{SUBIMAGE}'; Modified: incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm?rev=1091419r1=1091418r2=1091419view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm Tue Apr 12 14:09:50 2011 @@ -104,6 +104,7 @@ sub process { my $request_id= $self-data-get_request_id(); my $reservation_id= $self-data-get_reservation_id(); my $request_end = $self-data-get_request_end_time(); + my $request_duration = $self-data-get_request_duration_epoch(); my $request_logid = $self-data-get_request_log_id(); my $request_checktime = $self-data-get_request_check_time(); my $reservation_remoteip = $self-data-get_reservation_remote_ip(); @@ -172,28 +173,29 @@ sub process { # Get a date string for the current time my $date_string; - - # Check end time for a notice interval - # This returns 0 if no notice is to be given - my $notice_interval = check_endtimenotice_interval($request_end); - - if ($notice_interval) { - notify($ERRORS{'OK'}, 0, notice interval is set to $notice_interval); - - # Notify the user of the end time - $self-_notify_user_endtime($notice_interval); - - # Set lastcheck time ahead by 16 minutes for all notices except the last (30 minute) notice - if ($notice_interval ne 30 minutes) { - my $epoch_now = convert_to_epoch_seconds(); - $date_string = convert_to_datetime(($epoch_now + (16 * 60))); - } - else { - my $epoch_now = convert_to_epoch_seconds(); - $date_string = convert_to_datetime($epoch_now); - } - } ## end if ($notice_interval) - + # If duration is greater than 24hrs 5minutes then perform end time notice checks + if($request_duration = 86640 ){ + # Check end time for a notice interval + # This returns 0 if no notice is to be given + my $notice_interval = check_endtimenotice_interval($request_end); + + if ($notice_interval $is_parent_reservation) { + notify($ERRORS{'OK'}, 0, notice interval is set to $notice_interval); + + # Notify the user of the end time + $self-_notify_user_endtime($notice_interval); + + # Set lastcheck time ahead by 16 minutes
svn commit: r1099573 - in /incubator/vcl/trunk/managementnode/lib/VCL: DataStructure.pm utils.pm
Author: fapeeler Date: Wed May 4 19:50:59 2011 New Revision: 1099573 URL: http://svn.apache.org/viewvc?rev=1099573view=rev Log: VCL-463 adding serverrequest data to data structure - if data does not exist, zero out the values. This is to prevent get_data_ calls to not complain about uninitilized data. Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=1099573r1=1099572r2=1099573view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Wed May 4 19:50:59 2011 @@ -384,6 +384,13 @@ $SUBROUTINE_MAPPINGS{image_os_module_per $SUBROUTINE_MAPPINGS{image_platform_name} = '$self-request_data-{reservation}{RESERVATION_ID}{image}{platform}{name}'; +$SUBROUTINE_MAPPINGS{server_request_id} = '$self-request_data-{reservation}{RESERVATION_ID}{serverrequest}{id}'; +$SUBROUTINE_MAPPINGS{server_request_fixedIP} = '$self-request_data-{reservation}{RESERVATION_ID}{serverrequest}{fixedIP}'; +$SUBROUTINE_MAPPINGS{server_request_fixedMAC} = '$self-request_data-{reservation}{RESERVATION_ID}{serverrequest}{fixedMAC}'; +$SUBROUTINE_MAPPINGS{server_request_admingroupid} = '$self-request_data-{reservation}{RESERVATION_ID}{serverrequest}{admingroupid}'; +$SUBROUTINE_MAPPINGS{server_request_logingroupid} = '$self-request_data-{reservation}{RESERVATION_ID}{serverrequest}{logingroupid}'; +$SUBROUTINE_MAPPINGS{server_request_monitored} = '$self-request_data-{reservation}{RESERVATION_ID}{serverrequest}{monitored}'; + $SUBROUTINE_MAPPINGS{imagerevision_comments} = '$self-request_data-{reservation}{RESERVATION_ID}{imagerevision}{comments}'; $SUBROUTINE_MAPPINGS{imagerevision_date_created} = '$self-request_data-{reservation}{RESERVATION_ID}{imagerevision}{datecreated}'; $SUBROUTINE_MAPPINGS{imagerevision_deleted} = '$self-request_data-{reservation}{RESERVATION_ID}{imagerevision}{deleted}'; Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=1099573r1=1099572r2=1099573view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Wed May 4 19:50:59 2011 @@ -4206,10 +4206,19 @@ sub get_request_info { computerprovisioningmodule.name AS computerprovisioningmodule_name, computerprovisioningmodule.prettyname AS computerprovisioningmodule_prettyname, computerprovisioningmodule.description AS computerprovisioningmodule_description, - computerprovisioningmodule.perlpackage AS computerprovisioningmodule_perlpackage + computerprovisioningmodule.perlpackage AS computerprovisioningmodule_perlpackage, + + serverrequest.id AS serverrequest_id, + serverrequest.requestid AS serverrequest_requestid, + serverrequest.fixedIP AS serverrequest_fixedIP, + serverrequest.fixedMAC AS serverrequest_fixedMAC, + serverrequest.admingroupid AS serverrequest_admingroupid, + serverrequest.logingroupid AS serverrequest_logingroupid, + serverrequest.monitored AS serverrequest_monitored FROM - request, + request + LEFT JOIN (serverrequest) ON (serverrequest.requestid = request.id), user, adminlevel, affiliation, @@ -4350,7 +4359,8 @@ sub get_request_info { else { notify($ERRORS{'DEBUG'}, 0, imagerevisionid is not set for computer); } - + + # Loop through all the columns returned for the reservation foreach my $key (keys %reservation_row) { my $value = $reservation_row{$key}; @@ -4417,6 +4427,9 @@ sub get_request_info { elsif ($key =~ /computerprovisioningmodule_/) { $request_info{reservation}{$reservation_id}{computer}{provisioning}{module}{$original_key} = $value; } + elsif ($key =~ /serverrequest_/) { + $request_info{reservation}{$reservation_id}{$original_key} = $value; + } else { notify($ERRORS{'WARNING'}, 0, unknown key found in SQL data: $key); } @@ -4448,7 +4461,7 @@ sub get_request_info { # Each selected row represents a reservation associated with this request # Fix some of the data - + # Set the user's preferred name to the first name if it isn't defined
svn commit: r1127593 - in /incubator/vcl/trunk/managementnode: bin/vcld lib/VCL/Module/OS.pm lib/VCL/Module/OS/Linux.pm lib/VCL/inuse.pm
Author: fapeeler Date: Wed May 25 17:31:48 2011 New Revision: 1127593 URL: http://svn.apache.org/viewvc?rev=1127593view=rev Log: VCL-463 Server loads ability to process a reboot inuse module is calling os-reboot routine each OS module will be responsible for handling it If os module cannot reboot the machine then inuse module will return to inuse state without any action. Modified: incubator/vcl/trunk/managementnode/bin/vcld incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm incubator/vcl/trunk/managementnode/lib/VCL/inuse.pm Modified: incubator/vcl/trunk/managementnode/bin/vcld URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/bin/vcld?rev=1127593r1=1127592r2=1127593view=diff == --- incubator/vcl/trunk/managementnode/bin/vcld (original) +++ incubator/vcl/trunk/managementnode/bin/vcld Wed May 25 17:31:48 2011 @@ -202,7 +202,7 @@ sub main () { $ENV{state} = $request_state_name; # Make sure the request state is valid - if ($request_state_name !~ /inuse|reserved|deleted|timeout|reclaim|reload|new|tomaintenance|image|imageprep|makeproduction|imageinuse|complete|failed|pending|maintenance|tovmhostinuse/) { + if ($request_state_name !~ /inuse|reserved|deleted|timeout|reclaim|reload|new|tomaintenance|image|imageprep|makeproduction|imageinuse|complete|failed|pending|maintenance|tovmhostinuse|rebootsoft|reboothard|reinstall/) { notify($ERRORS{'WARNING'}, $LOGFILE, assigned request in unsupported state: $request_state_name); next REQUEST; } @@ -497,7 +497,7 @@ sub make_new_child { } # The imageinuse state is now handled by inuse.pm - if ($state =~ /^(imageinuse)$/) { + if ($state =~ /^(imageinuse|rebootsoft|reboothard|reinstall)$/) { notify($ERRORS{'DEBUG'}, $LOGFILE, request will be processed by inuse.pm); $state_module = VCL::inuse; } Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm?rev=1127593r1=1127592r2=1127593view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm Wed May 25 17:31:48 2011 @@ -220,6 +220,86 @@ sub get_current_image_name { #/ +=head2 wait_for_reboot + + Parameters : Maximum number of seconds to wait (optional), delay between attempts (optional) + Returns : If computer is pingable before the maximum amount of time has elapsed: 1 + Description : + +=cut + +sub wait_for_reboot { +my $self = shift; +if (ref($self) !~ /VCL::Module/i) { +notify($ERRORS{'CRITICAL'}, 0, subroutine was called as a function, it must be called as a class method); +return; +} + +my $computer_node_name = $self-data-get_computer_node_name(); + + # Make multiple attempts to wait for the reboot to complete +my $wait_attempt_limit = shift; + + if (!defined($wait_attempt_limit)) { +$wait_attempt_limit = 2; +} + +WAIT_ATTEMPT: +for (my $wait_attempt = 1; $wait_attempt = $wait_attempt_limit; $wait_attempt++) { +if ($wait_attempt 1) { +# Computer did not become fully responsive on previous wait attempt +notify($ERRORS{'OK'}, 0, $computer_node_name reboot failed to complete on previous attempt, attempting hard power reset); +# Call provisioning module's power_reset() subroutine +if ($self-provisioner-power_reset()) { +notify($ERRORS{'OK'}, 0, reboot attempt $wait_attempt/$wait_attempt_limit: initiated power reset on $computer_node_name); +} +else { +notify($ERRORS{'WARNING'}, 0, reboot failed, failed to initiate power reset on $computer_node_name); +return 0; +} +} ## end if ($wait_attempt 1) + +# Wait maximum of 3 minutes for the computer to become unresponsive +if (!$self-wait_for_no_ping(180, 3)) { +# Computer never stopped responding to ping +notify($ERRORS{'WARNING'}, 0, $computer_node_name never became unresponsive to ping); +next WAIT_ATTEMPT
svn commit: r1127641 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
Author: fapeeler Date: Wed May 25 19:22:52 2011 New Revision: 1127641 URL: http://svn.apache.org/viewvc?rev=1127641view=rev Log: VCL-463 shorten reboot routine. removed waiting for reboot portion. using general routine now provided by OS.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm?rev=1127641r1=1127640r2=1127641view=diff == --- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Wed May 25 19:22:52 2011 @@ -3428,73 +3428,24 @@ sub reboot { # Make multiple attempts to wait for the reboot to complete my $wait_attempt_limit = 2; - WAIT_ATTEMPT: - for (my $wait_attempt = 1; $wait_attempt = $wait_attempt_limit; $wait_attempt++) { - if ($wait_attempt 1) { - # Computer did not become fully responsive on previous wait attempt - notify($ERRORS{'OK'}, 0, $computer_node_name reboot failed to complete on previous attempt, attempting hard power reset); - - # Call provisioning module's power_reset() subroutine - if ($self-provisioner-power_reset()) { - notify($ERRORS{'OK'}, 0, reboot attempt $wait_attempt/$wait_attempt_limit: initiated power reset on $computer_node_name); - } - else { - notify($ERRORS{'WARNING'}, 0, reboot failed, failed to initiate power reset on $computer_node_name); - return 0; - } - } ## end if ($wait_attempt 1) + # Check if wait for reboot is set +if (!$wait_for_reboot) { +return 1; +} +else { +if($self-wait_for_reboot($wait_attempt_limit)){ +# Reboot was successful, calculate how long reboot took +my $reboot_end_time = time(); +my $reboot_duration = ($reboot_end_time - $reboot_start_time); +notify($ERRORS{'OK'}, 0, reboot complete on $computer_node_name, took $reboot_duration seconds); +return 1; +} +else { +notify($ERRORS{'WARNING'}, 0, reboot failed on $computer_node_name, made $wait_attempt_limit attempts); +return 0; +} +} - # Wait maximum of 3 minutes for the computer to become unresponsive - if (!$self-wait_for_no_ping(180, 3)) { - # Computer never stopped responding to ping - notify($ERRORS{'WARNING'}, 0, $computer_node_name never became unresponsive to ping); - next WAIT_ATTEMPT; - } - - # Computer is unresponsive, reboot has begun - # Wait for 5 seconds before beginning to check if computer is back online - notify($ERRORS{'DEBUG'}, 0, $computer_node_name reboot has begun, sleeping for 5 seconds); - sleep 5; - - # Wait maximum of 6 minutes for the computer to come back up - if (!$self-wait_for_ping(360, 5)) { - # Check if the computer was ever offline, it should have been or else reboot never happened - notify($ERRORS{'WARNING'}, 0, $computer_node_name never responded to ping); - next WAIT_ATTEMPT; - } - - notify($ERRORS{'DEBUG'}, 0, $computer_node_name is pingable, waiting for ssh to respond); - - # Wait maximum of 3 minutes for ssh to respond - if (!$self-wait_for_ssh(180, 5)) { - notify($ERRORS{'WARNING'}, 0, ssh never responded on $computer_node_name); - next WAIT_ATTEMPT; - } - - notify($ERRORS{'DEBUG'}, 0, $computer_node_name responded to ssh); - - ## Wait then check ssh again in case initialization scripts are running - ## ssh may be available when the computer first boots, then network configuration scripts may automatically run - ## Make sure ssh is available a short time after it's first available - #notify($ERRORS{'DEBUG'}, 0, sleeping for 20 seconds then checking ssh again); - #sleep 20; - # - ## Wait maximum of 2 minutes for ssh to respond - #if (!$self-wait_for_ssh(120)) { - # notify($ERRORS{'WARNING'}, 0, ssh responded then stopped responding on $computer_node_name