《Cobbler部署指南》系列
1、《Cobbler部署指南之安装篇》http://dreamway.blog.51cto.com/blog/1281816/1166589
2、《Cobbler部署指南之配置管理篇[上文]》http://dreamway.blog.51cto.com/blog/1281816/1166921
3、《Cobbler部署指南之配置管理篇[下文]》http://dreamway.blog.51cto.com/blog/1281816/1166932
4、《Cobbler部署指南之yum仓库配置管理篇》http://dreamway.blog.51cto.com/blog/1281816/1166936
5、《Cobbler部署指南之Cobbler安装操作系统篇》http://dreamway.blog.51cto.com/blog/1281816/1166947
6、《Cobbler部署指南之安装虚拟化Xen系统篇》http://dreamway.blog.51cto.com/blog/1281816/1166950
7、《Cobbler部署指南之电源管理篇》http://dreamway.blog.51cto.com/blog/1281816/1166957
8、《Cobbler部署指南之FAQ处理篇》http://dreamway.blog.51cto.com/blog/1281816/1167078
DELL PE1950
系统CentOS5.8 64bit
安装ipmitool
yum install ipmitool -y
yum install cman -y
Cobbler代码维护者jimi告知:某些系统版本将执行程序安装在/sbin/目录下,通过rpm -ql cman查看,CentOS5.8下如此解决即可
ln -s /sbin/fence_* /usr/sbin/
备份
cp /usr/lib/python2.4/site-packages/cobbler/action_power.py /usr/lib/python2.4/site-packages/cobbler/action_power.py.$(date +%F)
编辑
vim /usr/lib/python2.4/site-packages/cobbler/action_power.py
删除或注释此文件如下代码
utils.die(self.logger,"command succeeded (rc=%s), but output ('%s') was not understood" % (rc, output))
删除文件action_power.pyo 、 action_power.pyc
这两个文件在目录/usr/lib/python2.4/site-packages/cobbler/下
重启cobbler,注意一定是重启cobbler
cobbler reboot
步骤8.2、8.3是我在使用电源管理中发现的问题,后通过github与Cobbler代码维护者jimi沟通解决的,非常感谢他的帮助,详见
https://github.com/cobbler/cobbler/issues/426
为指定的系统配置host-188116增加电源管理参数
cobbler system edit --name=host-188116 --power-address=172.17.11.20 --power-type='ipmilan' --power-user=root --power-pass=djxxxx
cobbler check
cobbler sync
cobbler system report | egrep -i "system|profile|power"
Power Management Address : 172.17.11.20
Power Management ID :
Power Management Password : djxxxx
Power Management Type : ipmilan
Power Management Username : root
Profile : centos5.8-x86_64
/etc/cobbler/settings
# settings for power management features. optional.
# see https://github.com/cobbler/cobbler/wiki/Power-management to learn more
# choices (refer to codes.py):
# apc_snmp bladecenter bullpap drac ether_wake ilo integrity
# ipmilan ipmitool lpar rsa virsh wti
power_management_default_type: 'ipmitool'
# the commands used by the power management module are sourced
# from what directory?
power_template_dir: "/etc/cobbler/power"
cobbler system poweroff
cobbler system poweron
cobbler system powerstatus
cobbler system reboot
cobbler system powerstatus --name=host-188116
task started: 2013-03-29_095803_power
task started (id=Power management (status), time=Fri Mar 29 09:58:03 2013)
cobbler power configuration is:
type : ipmilan
address: 172.17.11.20
user : root
id :
running: /usr/sbin/fence_ipmilan
received on stdout: Getting status of IPMI:172.17.11.20...Chassis power = On
Done
received on stderr:
*** TASK COMPLETE ***
cobbler system poweroff --name=host-188116
task started: 2013-03-29_100218_power
task started (id=Power management (off), time=Fri Mar 29 10:02:18 2013)
cobbler power configuration is:
type : ipmilan
address: 172.17.11.20
user : root
id :
running: /usr/sbin/fence_ipmilan
received on stdout: Powering off machine @ IPMI:172.17.11.20...Done
received on stderr:
*** TASK COMPLETE ***
cobbler system poweron --name=host-188116
task started: 2013-03-29_100314_power
task started (id=Power management (on), time=Fri Mar 29 10:03:14 2013)
cobbler power configuration is:
type : ipmilan
address: 172.17.11.20
user : root
id :
running: /usr/sbin/fence_ipmilan
received on stdout: Powering on machine @ IPMI:172.17.11.20...Done
received on stderr:
*** TASK COMPLETE ***
启动服务器后再通过查看服务器电源状态为On
cobbler system reboot --name=host-188116
task started: 2013-03-29_100508_power
task started (id=Power management (reboot), time=Fri Mar 29 10:05:08 2013)
cobbler power configuration is:
type : ipmilan
address: 172.17.11.20
user : root
id :
running: /usr/sbin/fence_ipmilan
received on stdout: Powering off machine @ IPMI:172.17.11.20...Done
received on stderr:
cobbler power configuration is:
type : ipmilan
address: 172.17.11.20
user : root
id :
running: /usr/sbin/fence_ipmilan
received on stdout: Powering on machine @ IPMI:172.17.11.20...Done
received on stderr:
*** TASK COMPLETE ***
重启从PXE引导启动,并指定安装的操作系统配置,如下命令,
cobbler system edit --name=host-188116 --netboot-enabled=1 --profile=centos5.8-x86_64
检查、同步配置
cobbler check
cobbler sync
测试上面的命令默认还是直接从硬盘启动,功能还不够完善,我们借助ipmitool工具设置下次启动从PXE引导,原理都是一样的。
ipmitool -I lan -H 172.17.11.20 -U root -P djxxxx chassis bootdev pxe
Set Boot Device to pxe
更多参数详见
cobbler system edit --help
重启服务器,重装系统
cobbler system reboot --name=host-188116
PXE引导已经生效,如图
从指定的系统配置引导正常
可以看到引导文件及客户机MAC配置文件名
检查依赖关系及格式化过程图略
安装系统软件包如下图
到这里自动部署系统已经基本完成,系统重装启动后会关闭默认从PXE引导启动。
参考资料https://github.com/cobbler/cobbler/wiki/Power-management
请看《Cobbler部署指南》系列续文
《Cobbler部署指南》系列文档下载:http://down.51cto.com/data/745895