LENOVO服務器批量升級BMC固件


需求:通過服務器遠程管理IP批量升級IMM、UEFI固件

工具:asu64、ipmitool、iflash64、cdc_interface.sh

下載:http://pan.baidu.com/s/1pL1uOaB

 

第一步,將要更新BMC IP寫入 ip.conf

10.17.2.34
10.17.6.54
10.17.22.80
10.17.5.74
10.17.5.3

 

第二步,驗證當前BMC帳號 userlist.sh

#!/bin/bash
true > userlist.txt
while read line;
do
ip=`echo $line|awk '{print $1}'`
ipmitool -H $ip -I lanplus -U userid -P password user list >/dev/null
ret=$?
if [ $ret -eq 0 ]
then printf "$ip OK\n">>userlist.txt
else printf "$ip ERR\n">>userlist.txt
fi
done < ./ip.conf

 

第三步,編輯批量ping腳本 server_ping.sh

#!/bin/bash
true > out.txt
while read line;
do
ip=`echo $line|awk '{print $1}'`
ping -w 1 -c 1 $ip>/dev/null
ret=$?
if [ $ret -eq 0 ]
then printf "$ip OK\n">>out.txt
else printf "$ip ERR\n">>out.txt
fi
done < ./ip.conf

 

第四步,編輯批量關機腳步 power_off.sh

#!/bin/bash
user=userid
password=password
while read ip; do
ipmitool -H $ip -I lanplus -U $user -P $password power off
done < ./ip.conf

 

第五步,編寫批量升級uefi腳本 iflash.sh

#!/bin/bash
user=userid
password=password
while read ip; do
./iflash64 --package ibm_fw_uefi_d7e154b-2.21_anyos_32-64.uxz --host $ip --user $user --password $password --force
done < ./ip.conf

 

第六步,執行批量ping 查看結果全部ok

[root@asu64]# sh server_ping.sh 
[root@asu64]# cat out.txt 
10.17.2.34 OK
10.17.6.54 OK
10.17.22.80 OK
10.17.5.74 OK
10.17.5.33 OK

 

第七步,執行power_off.sh 批量關機

[root@asu64]# sh power_off.sh 
Chassis Power Control: Down/Off
Chassis Power Control: Down/Off
Chassis Power Control: Down/Off
Chassis Power Control: Down/Off
Chassis Power Control: Down/Off

 

第八步,執行批量升級腳本

[root@asu64]# sh iflash.sh

 

第九步,升級完成提示需要重啟服務器

IBM Command Line IMM Flash Update Utility v1.12.24
Licensed Materials - Property of IBM
(C) Copyright IBM Corp. 2009 - 2013  All Rights Reserved.

Pinging IMM IP address 10.17.5.33 .....OK
Connected to IMM at IP address 10.17.5.33.
Update package firmware type: uEFI
Update package build level:   D7E154B
Target's current build level: D7E136A

The IMM is preparing to receive the update.

Transferring image: 98%
Transfer complete.
Validating image.
Updating firmware:  100%
Update complete.

Firmware flashed successfully
Following the UEFI flash update, allow the system to reboot to the F1 prompt to complete the update process.
Fail to take down the LAN-over-USB interface.

 

第十步,批量重啟服務器,升級完成。

[root@asu64]# sh power_on.sh 
Chassis Power Control: Down/On
Chassis Power Control: Down/On
Chassis Power Control: Down/On
Chassis Power Control: Down/On
Chassis Power Control: Down/On

 

登陸BMC界面驗證升級是否成功

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM