之前是用irac的脚本来使服务器进入单次pxe安装进程的,但是脚本已经过时需要升级了。

老脚本如下:

sshpass -p "password" ssh -oStrictHostKeyChecking=no root@172.16.17.1 racadm config -g cfgServerInfo -o cfgServerBootOnce 1  
sshpass -p "password" ssh -oStrictHostKeyChecking=no root@10.16.17.1 racadm config -g cfgServerInfo -o cfgServerFirstBootDevice PXE  
sshpass -p "password" ssh -oStrictHostKeyChecking=no root@172.16.17.1 racadm serveraction powercycle  

运行会报警告,说是config命令已经过时,实在是太难看了:

RAC1169: The RACADM "config" command will be deprecated in a  
future version of iDRAC firmware. Run the RACADM  
"racadm set" command to configure the iDRAC configuration parameters.
For more information on the set command, run the RACADM command  
"racadm help set".

改改吧,改成下面的就可以了:

sshpass -p "password" ssh -oStrictHostKeyChecking=no root@172.16.17.1 racadm set iDRAC.ServerBoot.BootOnce 1  
sshpass -p "password" ssh -oStrictHostKeyChecking=no root@172.16.17.1 racadm set iDRAC.ServerBoot.FirstBootDevice PXE  
sshpass -p "password" ssh -oStrictHostKeyChecking=no root@172.16.17.1 racadm serveraction powercycle  

大家可以看到,config命令被set替代。

cfgServerBootOnce变成了iDRAC.ServerBoot.BootOnce

cfgServerFirstBootDevice变成了iDRAC.ServerBoot.FirstBootDevice

comments powered by Disqus