Cobbler是一個快速網絡安裝linux和windows的服務,使用簡單的命令便可完成PXE網絡安裝環境的配置,同時還能夠管理DHCP、DNS、以及yum倉庫、構造系統ISO鏡像。html
Cobbler支持命令行管理,web界面管理,還提供了API接口,能夠方便二次開發使用。前端
Cobbler客戶端Koan支持虛擬機安裝和操做系統從新安裝,使重裝系統更便捷。python
Cobbler提供如下服務集成:linux
* PXE服務支持git
* DHCP服務管理github
* DNS服務管理web
* 電源管理shell
* Kickstart服務支持json
* yum倉庫管理vim
Cobbler最初是支持系統版本Fedora, Red Hat和衍生版本,如CentOS 和Scientific Linux.如今對Debian 和Ubuntu SuSE支持也至關強。還支持FreeBSD、ESXI等。
koan 在Fedora, Red Hat Enterprise Linux, or CentOS工做正常,其餘Linux版本應該也不錯。
Cobbler工做流程:
默認的光盤中沒有cobbler軟件,必須在yum倉庫中設置第三方的軟件源,才能安裝cobbler等軟件。這裏用的epel軟件源
什麼是epel
EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社區打造,爲 RHEL 及衍生髮行版如 CentOS、Scientific Linux 等提供高質量軟件包的項目。
CentOS 5 i386:
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
CentOS 5 x86_64
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
CentOS 6 i386:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
CentOS 6 x86_64:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
yum -y install cobbler httpd rsync tftp-server xinetd dhcp python-ctypes
sed -i 's/next_server: 127.0.0.1/next_server: 192.168.5.101/g' /etc/cobbler/settings
sed -i 's/server: 127.0.0.1/server: 192.168.5.101/g' /etc/cobbler/settings sed -i 's/manage_dhcp: 0/manage_dhcp: 1/g' /etc/cobbler/settings
sed -i 's/manage_rsync: 0/manage_rsync: 1/g' /etc/cobbler/settings
/etc/cobbler/settings #Cobbler主配置文件
配置先後內容對比
diff /etc/cobbler/settings /etc/cobbler/settings_2013-10-17
218c218
< manage_dhcp: 1 #啓用cobbler管理DHCP功能
---
> manage_dhcp: 0
237c237
< manage_rsync: 1 #啓用cobbler管理rsync功能
---
> manage_rsync: 0
248c248
< next_server: 192.168.5.101 # DHCP服務地址
---
> next_server: 127.0.0.1
360c360
< server: 192.168.5.101 # cobbler服務地址
---
> server: 127.0.0.1
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
chkconfig ip6tables off
chkconfig iptables off
/etc/init.d/ip6tables stop
/etc/init.d/iptables stop
設置 'disable' 爲 'no'
sed -i '/disable/c\\tdisable\t\t\t= no' /etc/xinetd.d/tftp
sed -i 's/\=\ yes/\=\ no/g' /etc/xinetd.d/rsync
sed -i 's@#LoadModule@LoadModule@g' /etc/httpd/conf.d/wsgi.conf
這裏生成密鑰和配置默認密鑰,ks文件引用
openssl passwd -1 -salt 'random-phrase-here' '123456'
$1$random-p$mzxQ/Sx848sXgvfwJCoZM0
加入cobbler配置
vim /etc/cobbler/settings
grep default_password_crypted /etc/cobbler/settings
default_password_crypted: "$1$random-p$mzxQ/Sx848sXgvfwJCoZM0"
cp /etc/cobbler/dhcp.template /etc/cobbler/dhcp.template.$(date +%F) #備份
vim /etc/cobbler/dhcp.template
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
subnet 192.168.5.0 netmask 255.255.255.0 {
option routers 192.168.5.1;
option domain-name-servers 202.106.0.20;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.5.180 192.168.5.200;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
/sbin/service httpd start
/sbin/service dhcpd start
/sbin/service xinetd start
/sbin/service cobblerd start
/sbin/chkconfig httpd on
/sbin/chkconfig dhcpd on
/sbin/chkconfig xinetd on
/sbin/chkconfig tftp on
/sbin/chkconfig cobblerd on
cobbler get-loaders
yum -y install debmirror
修改 /etc/debmirror.conf 配置文件,註釋掉 @dists 和 @arches 兩行
sed -i 's|@dists=.*|#@dists=|' /etc/debmirror.conf
sed -i 's|@arches=.*|#@arches=|' /etc/debmirror.conf
cobbler check
configuration problems found. All systems go. #出現此提示即正常
cobblerd does not appear to be running/accessible #此提示是由於cobbler服務沒啓動
cobbler check出現的相關報錯處理看下面步驟
cobbler sync
命令名稱 |
命令用途 |
cobbler check |
檢查cobbler配置 |
cobbler list |
列出全部的cobbler元素 |
cobbler report |
列出元素的詳細信息 |
cobbler distro |
查看導入的發行版系統信息 |
cobbler system |
查看添加的系統信息 |
cobbler profile |
查看配置信息 |
cobbler sync |
同步Cobbler配置,更改配置最好都要執行下 |
cobbler reposync |
同步yum倉庫 |
命令參考
cobbler --help
cobbler distro --help
cobbler distro add --help
Cobbler配置文件存放在/etc/cobbler下
配置文件名稱 |
做 用 |
/etc/cobbler/settings |
Cobbler主配置文件 |
/etc/cobbler/users.digest |
用於web訪問的用戶名密碼配置文件 |
/etc/cobbler/modules.conf |
模塊配置文件 |
/etc/cobbler/users.conf |
Cobbler WebUI/Web 服務受權配置文件 |
/etc/cobbler/iso/ |
Buildiso 模板配置文件 |
/etc/cobbler/power |
電源配置文件 |
/etc/cobbler/pxe |
Pxeprofile配置模板 |
/etc/cobbler |
此目錄也包含rsync、dhcp、dns、pxe、dnsmasq等服務的模板配置文件 |
導入的系統發行版,repos鏡像和kickstart文件都放置在/var/www/cobbler目錄下。確保/var目錄有足夠的空間來存儲這些文件。
目錄名稱 |
做 用 |
/var/www/cobbler/p_w_picpaths/ |
存儲全部導入發行版的Kernel和initrd鏡像用於遠程網絡啓動 |
/var/www/cobbler/ks_mirror/ |
存儲導入的發行版系統數據 |
/var/www/cobbler/repo_mirror/ |
倉庫存儲目錄 |
/var/log/cobbler |
Cobbler日誌文件 cobbler.log install.log |
此目錄存儲和Cobbler profiles、systems、distros相關的配置。
目錄名稱 |
做 用 |
/var/lib/cobbler/config/ |
存放distros、repos、systems和profiles等信息配置文件,通常都是json文件 |
/var/lib/cobbler/snippets/ |
存放ks文件能夠導入的腳本小片斷,值得研究 |
/var/lib/cobbler/triggers |
存放用戶定義的cobbler 命令 |
/var/lib/cobbler/kickstarts/ |
存放kickstart配置文件 |
web日誌存放點
/var/log/httpd/access_log
/var/log/httpd/error_log
/var/log/httpd/ssl_access_log
/var/log/httpd/ssl_error_log
Cobbler日誌
/var/log/cobbler/cobbler.log
/var/log/cobbler/install.log
經過Cobbler日誌能夠獲取系統的安裝狀態
注意下載的ISO文件要覈對文件的md5值,確保數據完整性
md5sum CentOS-5.8-x86_64-bin-DVD-1of2.iso
8a3bf0030f192022943f83fe6b2cf373 CentOS-5.8-x86_64-bin-DVD-1of2.iso
mkdir -p /var/iso/Linux/Centos/x86_64/
mkdir -p /var/os/Linux/Centos/x86_64/Centos5.8/dvd
mkdir -p /var/os/Linux/Centos/x86_64/Centos6.3/dvd
mkdir -p /var/os/Linux/Centos/x86_64/Centos6.4/dvd
mount -o loop /var/iso/Linux/Centos/x86_64/CentOS-5.8-x86_64-bin-DVD-1of2.iso /var/os/Linux/Centos/x86_64/Centos5.8/dvd
系統版本命名爲centos5.8 架構x86_64,這時間長,耐性等待。可查看ls /var/www/cobbler/ks_mirror/centos5.8-x86_64/目錄文件生成狀況。
cobbler import --path=/var/os/Linux/Centos/x86_64/Centos5.8/dvd --name=centos5.8 --arch=x86_64
cobbler list
distros:
centos5.8-x86_64
centos5.8-xen-x86_64
centos6.3-x86_64
centos6.4-x86_64
profiles:
centos5.8-x86_64
centos5.8-xen-x86_64
centos6.3-x86_64
centos6.4-x86_64
systems:
repos:
p_w_picpaths:
mgmtclasses:
packages:
files:
列出詳細信息可使用cobbler report
du -sh /var/www/cobbler/ks_mirror/centos5.8-x86_64/
4.1G /var/www/cobbler/ks_mirror/centos5.8-x86_64/
du -sh /var/os/Linux/Centos/x86_64/Centos5.8/dvd/
4.3G /var/os/Linux/Centos/x86_64/Centos5.8/dvd/
CentOS6.3
mount -o loop /var/iso/Linux/Centos/x86_64/CentOS-6.3-x86_64-bin-DVD1.iso /var/os/Linux/Centos/x86_64/Centos6.3/dvd/
cobbler import --path=/var/os/Linux/Centos/x86_64/Centos6.3/dvd/ --name=centos6.3 --arch=x86_64
CentOS6.4
cobbler import --path=/var/os/Linux/Centos/x86_64/Centos6.4/dvd/ --name=centos6.4 --arch=x86_64
cobbler profile find --distro=centos6.3-x64-x86_64 #查看配置是否存在
centos6.3-x64-x86_64
cobbler profile remove --name=centos6.3-x64-x86_64 #刪除配置文件
cobbler distro remove --name=centos6.3-x64-x86_64 #刪除distro
cobbler profile find --distro=centos6.3-x64-x86_64 #再查看配置已無
更改kickstart文件,可爲http等,具體cobbler --help查看,這裏採用自定製ks文件
ks目錄位置
/var/lib/cobbler/kickstarts/
默認的ks位置
/var/lib/cobbler/kickstarts/sample.ks
更改指定系統版本對應的ks配置文件
cobbler profile edit --name=centos5.8-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos5u8-x64.cfg
cobbler profile edit --name=centos6.3-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos6u3-x64.cfg
cobbler profile edit --name=centos6.4-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos6u4-x64.cfg
cobbler report
cobbler distro list
建議先執行cobbler check進行配置檢查再執行cobbler sync,修改cobbler配置後都須要執行此步驟
cobbler check
No configuration problems found. All systems go.
cobbler sync
task started: 2013-03-12_171702_sync
task started (id=Sync, time=Tue Mar 12 17:17:02 2013)
running pre-sync triggers
cleaning trees
……略……
rendering Rsync files
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout: Shutting down dhcpd: [ OK ]
Starting dhcpd: [ OK ]
received on stderr:
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
增長裝機安全設置菜單密碼
生成hash密碼
支持兩種不一樣類型的密碼:
sha1pass mypassword
或
openssl passwd -1 -salt sXiKzkus mypassword
這裏選擇後者
# openssl passwd -1 -salt sXiKzkus 密碼
編輯配置文件pxedefault,添加以下紅色部分
vim /etc/cobbler/pxe/pxedefault.template
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://fedorahosted.org/cobbler
MENU MASTER PASSWD $1$sXiKzkus$2DoZ6pfTe8rrc0Si60ecB/
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT $pxe_timeout_profile
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
$pxe_menu_items
MENU end
配置pxeprofile,增長紅色部分
vim /etc/cobbler/pxe/pxeprofile.template
LABEL $profile_name
MENU PASSWD
kernel $kernel_path
$menu_label
$append_line
ipappend 2
修改完畢注意檢查、同步配置使其生效
cobbler check
cobbler sync
PXE裝機時選擇裝機系統版本,輸入裝機密碼,效果圖
編輯pxedefault文件,
vim /etc/cobbler/pxe/pxedefault.template
MENU TITLE Cobbler | http://fedorahosted.org/cobbler
將原文上面的內容根據自定義進行修改
MENU TITLE Centos Automation Install System
修改後的文件
DEFAULT menu
PROMPT 0
MENU TITLE Centos Automation Install System
MENU MASTER PASSWD $1$sXiKzkus$2DoZ6pfTe8rrc0Si60ecB/
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT $pxe_timeout_profile
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
$pxe_menu_items
MENU end
修改完畢執行以下兩條命令
cobbler check
cobbler sync
cobbler system add --name=network --ip=172.17.188.0/16 --profile=centos5.8-x86_64
指定服務器就是綁定它的mac地址,並設置好ip、dns、hostname
定義系統
cobbler system add --name=host-188116 --hostname=host-188116 --mac=00:19:B9:E5:34:FE --interface=eth0 --ip-address=172.17.188.116 --subnet=255.255.0.0 --gateway=172.17.188.1 --static=1 --profile=centos5.8-x86_64
查看定義的系統列表
cobbler system list
host-188116
更多參數見cobbler system add --help
導入完畢後,進行下面的步驟
base、updates庫使用163的repo源並增長EPEL庫
base
cobbler repo add --name=centos5.8-x86_64-Base --mirror=http://mirrors.163.com/centos/5/os/x86_64/
將定義的倉庫大寫名字Base修改成小寫base
cobbler repo edit --name=centos5.8-x86_64-base --mirror=http://mirrors.163.com/centos/5/os/x86_64/ --arch=x86_64 --breed=yum
updates
cobbler repo add --name=centos5.8-x86_64-updates --mirror=http://mirrors.163.com/centos/5/updates/x86_64/ --arch=x86_64 --breed=yum
添加EPEL倉庫
cobbler repo add --name=centos5.8-x86_64-epel --mirror=http://mirrors.ustc.edu.cn/epel/5/x86_64/ --arch=x86_64 --breed=yum
時間較長,注意磁盤容量是否知足。
cobbler reposync
task started: 2013-03-26_111553_reposync
task started (id=Reposync, time=Tue Mar 26 11:15:53 2013)
hello, reposync
run, reposync, run!
creating: /var/www/cobbler/repo_mirror/centos5.8-x86_64-updates/.origin/centos5.8-x86_64-updates.repo
running: /usr/bin/reposync -l -m -d --config=/var/www/cobbler/repo_mirror/centos5.8-x86_64-updates/.origin/centos5.8-x86_64-updates.repo --repoid=centos5.8-x86_64-updates --download_path=/var/www/cobbler/repo_mirror -a x86_64
………………略…………………………
received on stdout:
received on stderr:
*** TASK COMPLETE ***
安裝系統時會自動添加倉庫配置
cobbler profile edit --name=centos5.8-x86_64 --repos="centos5.8-x86_64-base centos5.8-x86_64-epel centos5.8-x86_64-updates" --distro=centos5.8-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos5u8-x64.cfg
刪除倉庫配置
cobbler repo remove --name=centos5.8-x86_64- updates
cobbler reposync --tries=3 --no-fail
加入crontab 每週日更新一次便可
echo "0 2 * * 0 cobbler reposync --tries=3 --no-fail" >> /var/spool/cron/root
注意檢查crond是否啓動
/etc/init.d/crond status
crond is stopped
/etc/init.d/crond start
chkconfig crond on
若是想安裝系統時自動配置yum,請進行如下配置。
vim /etc/cobbler/settings
yum_post_install_mirror: 1
在裝機腳本ks文件加入如下內容
%post
# Start yum configuration
$yum_config_stanza
# End yum configuration
下面的參數PXE安裝系統是會引用添加的cobbler repo配置
注意可能將系統、應用部署到較新版本,根據狀況而配置
$yum_repo_stanza
這兩個參數都來自Kickstart snippets,很值得研究https://github.com/cobbler/cobbler/wiki/Kickstart-snippets
系統安裝自動配置的yum
cat /etc/yum.repos.d/cobbler-config.repo
[core-0]
name=core-0
baseurl=http://192.168.5.101/cobbler/ks_mirror/centos5.8-x86_64
enabled=1
gpgcheck=0
priority=1
[centos5.8-x86_64-base]
name=centos5.8-x86_64-base
baseurl=http://192.168.5.101/cobbler/repo_mirror/centos5.8-x86_64-base
enabled=1
priority=99
gpgcheck=0
[centos5.8-x86_64-epel]
name=centos5.8-x86_64-epel
baseurl=http://192.168.5.101/cobbler/repo_mirror/centos5.8-x86_64-epel
enabled=1
priority=99
gpgcheck=0
[centos5.8-x86_64-updates]
name=centos5.8-x86_64-updates
baseurl=http://192.168.5.101/cobbler/repo_mirror/centos5.8-x86_64-updates
enabled=1
priority=99
gpgcheck=0
這個密碼 $default_password_crypted 就是步驟3.6使用openssl passwd -1 生成的密碼
grep rootpw /var/lib/cobbler/kickstarts/sample.ks
rootpw --iscrypted $default_password_crypted
默認菜單文件內容
cat /tftpboot/pxelinux.cfg/default
DEFAULT menu
PROMPT 0
MENU TITLE Centos Automation Install System
TIMEOUT 150
TOTALTIMEOUT 6000
ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
LABEL centos5.8-x86_64
kernel /p_w_picpaths/centos5.8-x86_64/vmlinuz
MENU LABEL centos5.8-x86_64
append initrd=/p_w_picpaths/centos5.8-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://192.168.5.101/cblr/svc/op/
ks/profile/centos5.8-x86_64
ipappend 2
指定系統的菜單文件內容
cat /tftpboot/pxelinux.cfg/01-00-19-b9-e5-34-fe
default linux
prompt 0
timeout 1
label linux
kernel /p_w_picpaths/centos5.8-x86_64/vmlinuz
ipappend 2
append initrd=/p_w_picpaths/centos5.8-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://192.168.5.101/cblr/svc/op/ks/system/host-188116
將須要安裝系統的服務器網卡啓用PXE,啓動服務器從PXE引導
選擇安裝系統centos5.8 便可自動安裝系統
Tab鍵,能夠對啓動項參數進行編輯
安裝源數聽說明:
系統centos5.8-x86_64的安裝系統數據源,其餘系統同理
連接
https://url/cblr/links/centos5.8-x86_64/
目錄
/var/www/cobbler/links/centos5.8-x86_64/
是一個連接目錄,實際位置以下
ll links/
total 0
lrwxrwxrwx 1 root root 43 Mar 12 13:41 centos5.8-x86_64 -> /var/www/cobbler/ks_mirror/centos5.8-x86_64
koan是cobbler的一個輔助工具,koan是kickstart-over-a-network的縮寫安裝在客戶端的使用,koan配合cobbler實現快速重裝linux。
koan 在Fedora, Red Hat Enterprise Linux, 和 CentOS工做正常,其餘Linux版本應該也不錯
koan的相關腳本在此目錄內/usr/lib/python2.4/site-packages/koan/
經過EPEL安裝的koan版本爲koan-2.2.3-2.el5,使用中報錯較多,此版本比較穩定koan-1.6.6-1.el5,下載連接ftp://rpmfind.net/linux/epel/5/i386/koan-1.6.6-1.el5.noarch.rpm
關於Koan更多內容見https://github.com/cobbler/cobbler/wiki/Koan
在重裝的機器上安裝koan
Rpm -ivh koan-1.6.6-1.el5.noarch.rpm
koan --server=192.168.5.101 --list=profiles
- looking for Cobbler at http://192.168.5.101:80/cobbler_api
centos5.8-xen-x86_64
centos6.4-x86_64
centos5.8-x86_64
centos6.3-x86_64
koan --server=192.168.5.101 --list=systems
- looking for Cobbler at http://192.168.5.101/cobbler_api
host-188116
koan --server=192.168.5.101 --list=p_w_picpaths
koan --server=192.168.5.101 --display --profile=centos5.8-x86_64
- looking for Cobbler at http://192.168.5.101:80/cobbler_api
- reading URL: http://192.168.5.101/cblr/svc/op/ks/profile/centos5.8-x86_64
install_tree: http://192.168.5.101/cblr/links/centos5.8-x86_64
name : centos5.8-x86_64
distro : centos5.8-x86_64
kickstart : http://192.168.5.101/cblr/svc/op/ks/profile/centos5.8-x86_64
ks_meta : tree=http://@@http_server@@/cblr/links/centos5.8-x86_64
install_tree : http://192.168.5.101/cblr/links/centos5.8-x86_64
kernel : /var/www/cobbler/ks_mirror/centos5.8-x86_64/p_w_picpaths/pxeboot/vmlinuz
initrd : /var/www/cobbler/ks_mirror/centos5.8-x86_64/p_w_picpaths/pxeboot/initrd.img
kernel_options : ks=http://192.168.5.101/cblr/svc/op/ks/profile/centos5.8-x86_64 ksdevice=link kssendmac
repos : centos5.8-x86_64-base centos5.8-x86_64-epel centos5.8-x86_64-updates
virt_ram : 512
virt_disk_driver : raw
virt_type : qemu
virt_path :
virt_auto_boot : 1
koan --server=192.168.5.101 --display --system=host-188116
- looking for Cobbler at http://192.168.5.101/cobbler_api
- reading URL: http://192.168.5.101/cblr/svc/op/ks/system/host-188116
install_tree: http://192.168.5.101/cblr/links/centos5.8-x86_64
name : host-188116
distro : centos5.8-x86_64
profile : centos5.8-x86_64
kickstart : http://192.168.5.101/cblr/svc/op/ks/system/host-188116
ks_meta : tree=http://@@http_server@@/cblr/links/centos5.8-x86_64
install_tree : http://192.168.5.101/cblr/links/centos5.8-x86_64
kernel : /var/www/cobbler/ks_mirror/centos5.8-x86_64/p_w_picpaths/pxeboot/vmlinuz
initrd : /var/www/cobbler/ks_mirror/centos5.8-x86_64/p_w_picpaths/pxeboot/initrd.img
kernel_options : ks=http://192.168.5.101/cblr/svc/op/ks/system/host-188116 ksdevice=link kssendmac
repos : centos5.8-x86_64-base centos5.8-x86_64-epel centos5.8-x86_64-updates
virt_ram : 512
virt_type : qemu
virt_path :
koan --server=192.168.5.101 --display --system=host-188116
- looking for Cobbler at http://192.168.5.101/cobbler_api
- reading URL: http://192.168.5.101/cblr/svc/op/ks/system/host-188116
install_tree: http://192.168.5.101/cblr/links/centos5.8-x86_64
name : host-188116
distro : centos5.8-x86_64
profile : centos5.8-x86_64
kickstart : http://192.168.5.101/cblr/svc/op/ks/system/host-188116
ks_meta : tree=http://@@http_server@@/cblr/links/centos5.8-x86_64
install_tree : http://192.168.5.101/cblr/links/centos5.8-x86_64
kernel : /var/www/cobbler/ks_mirror/centos5.8-x86_64/p_w_picpaths/pxeboot/vmlinuz
initrd : /var/www/cobbler/ks_mirror/centos5.8-x86_64/p_w_picpaths/pxeboot/initrd.img
kernel_options : ks=http://192.168.5.101/cblr/svc/op/ks/system/host-188116 ksdevice=link kssendmac
repos : centos5.8-x86_64-base centos5.8-x86_64-epel centos5.8-x86_64-updates
virt_ram : 512
virt_type : qemu
virt_path :
koan --server=192.168.5.101 --display --p_w_picpath=name
koan -r --server=192.168.5.101 --profile=centos5.8-x86_64
- looking for Cobbler at http://192.168.5.101:80/cobbler_api
- reading URL: http://192.168.5.101/cblr/svc/op/ks/profile/centos5.8-x86_64
install_tree: http://192.168.5.101/cblr/links/centos5.8-x86_64
downloading initrd initrd.img to /boot/initrd.img_koan
url=http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/initrd.img
- reading URL: http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/initrd.img
downloading kernel vmlinuz to /boot/vmlinuz_koan
url=http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/vmlinuz
- reading URL: http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/vmlinuz
- ['/sbin/grubby', '--add-kernel', '/boot/vmlinuz_koan', '--initrd', '/boot/initrd.img_koan', '--args', '"ks=http://192.168.5.101/cblr/svc/op/ks/profile/centos5.8-x86_64 ksdevice=link kssendmac "', '--copy-default', '--make-default', '--title=kick1364289618']
- reboot to apply changes
注意:輸入此命令重啓後,不能再停止重裝,重啓後自動進入pxe裝機。
reboot
執行reboot命令重啓服務器後,客戶端服務器會自動從新安裝操做系統,無需人工干預
步驟3.11已經添加指定客戶機配置,在這裏使用配置爲指定的服務器安裝操做系統
koan -r --server=192.168.5.101 --system=host-188116
- looking for Cobbler at http://192.168.5.101/cobbler_api
- reading URL: http://192.168.5.101/cblr/svc/op/ks/system/host-188116
install_tree: http://192.168.5.101/cblr/links/centos5.8-x86_64
downloading initrd initrd.img to /boot/initrd.img
url=http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/initrd.img
- reading URL: http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/initrd.img
downloading kernel vmlinuz to /boot/vmlinuz
url=http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/vmlinuz
- reading URL: http://192.168.5.101/cobbler/p_w_picpaths/centos5.8-x86_64/vmlinuz
- ['/sbin/grubby', '--add-kernel', '/boot/vmlinuz', '--initrd', '/boot/initrd.img', '--args', '"ks=http://192.168.5.101/cblr/svc/op/ks/system/host-188116 ksdevice=link kssendmac "', '--copy-default', '--make-default', '--title= kick1364390697']
- reboot to apply changes
[root@host-d-116 ~]# reboot
系統重啓看到kick1364390697與上面命令生成的相同,重裝過程同上
Cobbler web界面是一個很好的前端,很是容易管理Cobbler
能夠添加和刪除 system distro profile
能夠查看、編輯distros, profiles, subprofiles, systems, repos 、 kickstart文件
yum -y install cobbler-web
爲已存在的用戶cobbler重置密碼
htdigest /etc/cobbler/users.digest "Cobbler" cobbler
添加新用戶
htdigest /etc/cobbler/users.digest "Cobbler" your_newname
sed -i 's/authn_denyall/authn_configfile/g' /etc/cobbler/modules.conf
/etc/init.d/cobblerd restart
/etc/init.d/httpd restart
瀏覽器訪問登陸頁面https://192.168.5.101/cobbler_web
輸入用戶名密碼