《Cobbler部署指南》系列
一、《Cobbler部署指南之安裝篇》http://dreamway.blog.51cto.com/blog/1281816/1166589
二、《Cobbler部署指南之配置管理篇[上文]》http://dreamway.blog.51cto.com/blog/1281816/1166921
三、《Cobbler部署指南之配置管理篇[下文]》http://dreamway.blog.51cto.com/blog/1281816/1166932
四、《Cobbler部署指南之yum倉庫配置管理篇》http://dreamway.blog.51cto.com/blog/1281816/1166936
五、《Cobbler部署指南之Cobbler安裝操做系統篇》http://dreamway.blog.51cto.com/blog/1281816/1166947
六、《Cobbler部署指南之安裝虛擬化Xen系統篇》http://dreamway.blog.51cto.com/blog/1281816/1166950
七、《Cobbler部署指南之電源管理篇》http://dreamway.blog.51cto.com/blog/1281816/1166957
八、《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