From d808e1884961f1305ab69c7cfd0f18e1a5692b43 Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 30 Dec 2009 03:14:47 +0000 Subject: [PATCH] add sleep in rpower for scaling through site attribute powerinterval git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4860 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCpower.pm | 16 ++++++++++++++++ perl-xCAT/xCAT/Schema.pm | 2 ++ 2 files changed, 18 insertions(+) diff --git a/perl-xCAT/xCAT/PPCpower.pm b/perl-xCAT/xCAT/PPCpower.pm index 71dcd7233..c54127e48 100644 --- a/perl-xCAT/xCAT/PPCpower.pm +++ b/perl-xCAT/xCAT/PPCpower.pm @@ -192,6 +192,14 @@ sub powercmd_boot { my $state = power_status($data->{$id}); my $op = ($state =~ /^off$/) ? "on" : "reset"; + # Attribute powerinterval in site table, + # to control the rpower forking speed + if ((defined($request->{op})) && ($request->{op} ne 'stat') && ($request->{op} ne 'status') + && ($request->{op} ne 'state') && ($request->{op} ne 'off') && ($request->{op} ne 'softoff')) { + if(defined($request->{'powerinterval'}) && ($request->{'powerinterval'} ne '')) { + Time::HiRes::sleep($request->{'powerinterval'}); + } + } ############################## # Send power command ############################## @@ -279,6 +287,14 @@ sub powercmd { #################################### while (my ($name,$d) = each(%$hash) ) { + # Attribute powerinterval in site table, + # to control the rpower forking speed + if ((defined($request->{op})) && ($request->{op} ne 'stat') && ($request->{op} ne 'status') + && ($request->{op} ne 'state') && ($request->{op} ne 'off') && ($request->{op} ne 'softoff')) { + if(defined($request->{'powerinterval'}) && ($request->{'powerinterval'} ne '')) { + Time::HiRes::sleep($request->{'powerinterval'}); + } + } ################################ # Send command to each LPAR ################################ diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 5154d6965..69596ebb9 100644 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -656,6 +656,8 @@ site => { " the node deployment, node discovery and power operations.\n\n". " ntpservers: A comma delimited list of NTP servers for the cluster - often the\n". " xCAT management node.\n\n". + " powerinterval: The time of seconds that rpower command will wait between performing action on each target object,\n". + " it is useful especially for controlling the cluster boot up speed in large clusters.\n\n". " ppcmaxp: The max # of processes for PPC hw ctrl.\n\n". " ppcretry: The max # of PPC hw connection attempts before failing.\n\n". " ppctimeout: The timeout, in milliseconds, to use when communicating with PPC hw.\n\n".