From ed4469b3b0ccbd1daf949b969948d3e640080594 Mon Sep 17 00:00:00 2001 From: Patrick Lundgren Date: Fri, 18 Mar 2016 14:07:27 -0400 Subject: [PATCH] rflash will now check for " 00" BMC response to raw command suggested by Uma Yadlapati. Removed sleep workaround --- xCAT-server/lib/xcat/plugins/ipmi.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 626b24095..8f14fdbbe 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1603,14 +1603,15 @@ sub check_bmc_status_with_ipmitool { my $interval = shift; my $retry = shift; my $count = 0; - my $cmd = $pre_cmd." power status"; + my $bmc_response = 0; + my $cmd = $pre_cmd." raw 0x3a 0x0a"; while ($count < $retry) { - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { - sleep($interval); + $bmc_response = xCAT::Utils->runcmd($cmd, -1); + if ($bmc_response =~ /00/) { + return 1; } else { - return 1; + sleep($interval); } $count++; } @@ -1674,7 +1675,6 @@ sub do_firmware_update { return -1; } #check reset status - sleep(10); unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 12)) { xCAT::SvrUtils::sendmsg ([1,"Timeout to check the bmc status"], $callback,$sessdata->{node},%allerrornodes); @@ -1692,10 +1692,6 @@ sub do_firmware_update { # NOTE(chenglch) some firmware may not stable enough, it can handle the ipmi session # request, but failed to upgrade, add sleep function as a work around here to avoid of # error. - my $rflash_delay = 120; - my $delay_config = xCAT::TableUtils->get_site_attribute("rflash_delay"); - $rflash_delay = $delay_config if defined($delay_config) and $delay_config =~ /^\d+$/; - sleep($rflash_delay) if $rflash_delay != 0; $cmd = $pre_cmd." -z 30000 hpm upgrade $hpm_file force"; $output = xCAT::Utils->runcmd($cmd, -1);