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
This commit is contained in:
ligc 2009-12-30 03:14:47 +00:00
parent b572a611c3
commit d808e18849
2 changed files with 18 additions and 0 deletions

View File

@ -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
################################

View File

@ -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".