
技術(shù)原理解析:
Client向PXE Server上的DHCP發(fā)送IP地址請求消息,DHCP檢測Client是否合法(主要是檢測Client的網(wǎng)卡MAC地址),如果合法則返回Client的IP地址,同時將啟動文件pxelinux.0的位置信息一并傳送給Client
Client向PXE Server上的TFTP發(fā)送獲取pxelinux.0請求消息,TFTP接收到消息之后再向Client發(fā)送pxelinux.0大小信息,試探Client是否滿意,當(dāng)TFTP收到Client發(fā)回的同意大小信息之后,正式向Client發(fā)送pxelinux.0
Client執(zhí)行接收到的pxelinux.0文件
Client向TFTP Server發(fā)送針對本機(jī)的配置信息文件(在TFTP服務(wù)的pxelinux.cfg目錄下,這是系統(tǒng)菜單文件,格式和isolinux.cfg格式一樣,功能也是類似),TFTP將配置文件發(fā)回Client,繼而Client根據(jù)配置文件執(zhí)行后續(xù)操作。
Client向TFTP發(fā)送Linux內(nèi)核請求信息,TFTP接收到消息之后將內(nèi)核文件發(fā)送給Client
Client向TFTP發(fā)送根文件請求信息,TFTP接收到消息之后返回Linux根文件系統(tǒng)
Client啟動Linux內(nèi)核
Client下載安裝源文件,讀取自動化安裝腳本
Cobbler簡單介紹:
Cobbler是一個Linux服務(wù)器快速網(wǎng)絡(luò)安裝的服務(wù),由python開發(fā),小巧輕便(15k行python代碼),可以通過PXE的方式來快速安裝、重裝物理服務(wù)器和虛擬機(jī),同時還可以管理DHCP,DNS,TFTP、RSYNC以及yum倉庫、構(gòu)造系統(tǒng)ISO鏡像。
Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),還提供了API接口,可以方便二次開發(fā)使用。
Cobbler工作流程:
Client裸機(jī)配置了從網(wǎng)絡(luò)啟動后,開機(jī)后會廣播包請求DHCP服務(wù)器 (Cobbler server)發(fā)送其分配好的一個IP
DHCP服務(wù)器(Cobbler server)收到請求后發(fā)送responese,包括其ip地址
Client裸機(jī)拿到ip后再向Cobbler server發(fā)送請求OS引導(dǎo)文件的請求
Cobbler server告訴裸機(jī)OS引導(dǎo)文件的名字和TFTP server的ip和port
Client裸機(jī)通過上面告知的TFTP server地址通信,下載引導(dǎo)文件
Client裸機(jī)執(zhí)行執(zhí)行該引導(dǎo)文件,確定加載信息,選擇要安裝的OS, 期間會再向cobbler server請求kickstart文件和OS image
Cobbler server發(fā)送請求的kickstart和OS iamge
Client裸機(jī)加載kickstart文件
Client裸機(jī)接收os image,安裝該OS image
Cobbler集成的服務(wù):
PXE服務(wù)支持
DHCP服務(wù)管理
DNS服務(wù)管理(可選bind,dnsmasq)
電源管理
Kickstart服務(wù)支持
YUM倉庫管理
TFTP(PXE啟動時需要)
Apache(提供kickstart的安裝源,并提供定制化的kickstart配置)
Cobbler 設(shè)計方式:
發(fā)行版(distro) :表示一個操作系統(tǒng),它承載了內(nèi)核和initrd的信息,以及內(nèi)核等其他數(shù)據(jù)
存儲庫 (repository):保存了一個yum或者rsync存儲庫的鏡像信息
配置文件(profile):包含了一個發(fā)行版(distro),一個kickstart文件以及可能的存儲庫(repository),還包含了更多的內(nèi)核參數(shù)等其他數(shù)據(jù)
系統(tǒng)(system):表示要配給的機(jī)器,它包含了一個配置文件或一個鏡像,還包含了ip和mac地址,電源管理(地址,憑據(jù),類型)以及更為專業(yè)的數(shù)據(jù)信息
鏡像(image):可替換一個包含不屬于此類別的文件的發(fā)行版對象(eg: 無法作為內(nèi)核和initrd的對象)
以上各個組件中, 發(fā)行版,存儲庫, 配置文件為必須配置項,只有在虛擬環(huán)境中,必須要用cobbler來引導(dǎo)虛擬機(jī)啟動時候,才會用到系統(tǒng)組件但事實上,在生產(chǎn)環(huán)境中需要大量的虛擬機(jī)實例的話,通常利用openstack等來實現(xiàn)虛擬機(jī)節(jié)點
Cobbler配置目錄文件說明:
/etc/cobbler
/etc/cobbler/settings # cobbler 主配置文件
/etc/cobbler/iso/ # iso模板配置文件
/etc/cobbler/pxe # pxe模板文件
/etc/cobbler/power # 電源配置文件
/etc/cobbler/user.conf # web服務(wù)授權(quán)配置文件
/etc/cobbler/users.digest # web訪問的用戶名密碼配置文件
/etc/cobbler/dhcp.template # dhcp服務(wù)器的的配置末班
/etc/cobbler/dnsmasq.template # dns服務(wù)器的配置模板
/etc/cobbler/tftpd.template # tftp服務(wù)的配置模板
/etc/cobbler/modules.conf # 模塊的配置文件
Cobbler數(shù)據(jù)目錄:
/var/lib/cobbler/config/ # 用于存放distros,system,profiles 等信 息配置文件
/var/lib/cobbler/triggers/ # 用于存放用戶定義的cobbler命令
/var/lib/cobbler/kickstart/ # 默認(rèn)存放kickstart文件
/var/lib/cobbler/loaders/ # 存放各種引導(dǎo)程序 ? 鏡像目錄
/var/www/cobbler/ks_mirror/ # 導(dǎo)入的發(fā)行版系統(tǒng)的所有數(shù)據(jù)
/var/www/cobbler/images/ # 導(dǎo)入發(fā)行版的kernel和initrd鏡像用于 遠(yuǎn)程網(wǎng)絡(luò)啟動
/var/www/cobbler/repo_mirror/ # yum 倉庫存儲目錄
Cobbler鏡像目錄:
/var/www/cobbler/ks_mirror/ # 導(dǎo)入的發(fā)行版系統(tǒng)的所有數(shù)據(jù)
/var/www/cobbler/images/ # 導(dǎo)入發(fā)行版的kernel和initrd鏡像用于遠(yuǎn)程網(wǎng)絡(luò)啟動
/var/www/cobbler/repo_mirror/ # yum 倉庫存儲目錄
Cobbler日志目錄:
/var/log/cobbler/installing # 客戶端安裝日志
/var/log/cobbler/cobbler.log # cobbler日志
Cobbler命令介紹:
cobbler check # 核對當(dāng)前設(shè)置是否有問題
cobbler list # 列出所有的cobbler元素
cobbler report # 列出元素的詳細(xì)信息
cobbler sync # 同步配置到數(shù)據(jù)目錄,更改配置最好都要執(zhí)行下
cobbler reposync # 同步y(tǒng)um倉庫
cobbler distro # 查看導(dǎo)入的發(fā)行版系統(tǒng)信息
cobbler system # 查看添加的系統(tǒng)信息
cobbler profile # 查看配置信息
/etc/cobbler/settings中重要的參數(shù)設(shè)置:
default_password_crypted: "
gEc7ilpP$pg5iSOj/mlxTxEslhRvyp/"
manage_dhcp:1
manage_tftpd:1
pxe_just_once:1
next_server:< tftp服務(wù)器的 IP 地址>
server:<Cobbler服務(wù)器IP地址>
Cobble安裝:
系統(tǒng)信息:
cat /etc/redhat-release

-
1、關(guān)閉selinux
vim /etc/selinux/config或getenforce # 必須關(guān)閉selinux
注:getenforce是暫時性關(guān)閉
-
2、關(guān)閉防火墻
systemctl status firewalld
systemctl stop firewalld
systemctl enable firewalld
加入開機(jī)自啟
-
3、查看本機(jī)IP
ifconfig eth0 | awk -F "[ :]+" 'NR==2 {print $3}'
-
4、配置yum源:
yum install wget -y # 下載wget
-
5、epel 配置方法(擴(kuò)展源)
1、備份(如有配置其他epel源)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
-
2、下載新repo 到/etc/yum.repos.d/
epel(RHEL 7):
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
-
6、開始安裝Cobbler,下載相關(guān)服務(wù):
yum -y install cobbler dhcp httpd xinetd tftp-server syslinux pykickstart rsync cobbler-web
-
7、啟動相關(guān)服務(wù)
systemctl start httpd
systemctl enable httpd
systemctl enable cobblerd
systemctl start cobblerd
-
8、通過cobbler check 核對當(dāng)前設(shè)置是否有問題
[root@cobbler ~]# cobbler check
The following are potential configuration items that you may want to fix:
1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely. Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
5 : enable and start rsyncd.service with systemctl
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Restart cobblerd and then run 'cobbler sync' to apply changes.
一般都有8到9個問題需要修復(fù)。
按照提示一個一個的解決問題:
問題1:
[root@cobbler ~]# sed -i 's/^server: 127.0.0.1/server: 10.94.2.240/' /etc/cobbler/settings # 修改server的ip地址為本機(jī)ip
問題2:
[root@cobbler ~]# sed -i 's/^next_server: 127.0.0.1/next_server: 10.94.2.240/' /etc/cobbler/settings # TFTP Server 的IP地址
問題3:
[root@cobbler ~]# vim /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no # 修改為no
per_source = 11
cps = 100 2
flags = IPv4
}
問題4:
[root@cobbler ~]# cobbler get-loaders # 下載缺失的文件
報錯

解決辦法
vim /etc/cobbler/settings 找到第384行
384 server: 10.0.0.61 ####改為自己的IP地址
問題5:
# 添加rsync到自啟動并啟動rsync
[root@cobbler ~]# systemctl enable rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
[root@cobbler ~]# systemctl start rsyncd
問題6:
[root@cobbler ~]# yum install debmirror -y #安裝debian
[root@cobbler ~]# vim /etc/debmirror.conf
28 #@dists="sid";
30 #@arches="i386";
注釋掉這兩行,重新check后沒有報錯了
問題7:
# 修改密碼為123456 ,salt后面是常用的加密方式加密
[root@localhost ~]# openssl passwd -1 -salt '123456' '123456'
$1$123456$wOSEtcyiP2N/IfIl15W6Z0
[root@localhost ~]# vim /etc/cobbler/settings # 修改settings配置文件中下面位置,把新生成的密碼加進(jìn)去
default_password_crypted: "$1$123456$wOSEtcyiP2N/IfIl15W6Z0
問題8:
[root@cobbler ~]# yum install fence-agents -y # fence設(shè)備相關(guān),電源管理模塊
重啟cobbler
systemctl restart cobblerd.service
再次執(zhí)行cobbler check
[root@cobbler ~]# cobbler check
-
9、dhcp利用cobbler管理
[root@cobbler ~]# vim /etc/cobbler/settings # 修改settings中參數(shù),由cobbler控制dhcp
manage_dhcp: 1

-
10、修改dhcp.templates配置文件(僅列出修改部分)
[root@cobbler/var/lib/cobbler/kickstarts]# vim /etc/cobbler/dhcp.template
subnet 10.0.0.0 netmask 255.255.255.0 { #網(wǎng)段 這個可以是10網(wǎng)段,也可以是172網(wǎng)段
option routers 10.0.0.1; #網(wǎng)關(guān)
option domain-name-servers 10.0.0.1; #MDS 詳見:[https://blog.csdn.net/displayMessage/article/details/81133634](https://blog.csdn.net/displayMessage/article/details/81133634)
option subnet-mask 255.255.255.0; #子網(wǎng)掩碼
range dynamic-bootp 10.0.0.210 10.0.0.220; #分配的地址段
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server; #這個是cobbler配置文件里面的變量
-
11、重啟服務(wù)并同步配置,改完dhcp必須要sync同步配置
[root@cobbler ~]# systemctl restart cobblerd.service
[root@cobbler ~]# cobbler sync
-
12、檢查dhcp
[root@cobbler ~]# netstat -tulp | grep dhcp
-
13、現(xiàn)在開始一鍵裝機(jī)
-
1、首先掛載鏡像

Linux 上是需要掛載光盤,我們進(jìn)行掛載
[root@localhost ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
-
2、制作鏡像,用于安裝操作系統(tǒng),使cobbler導(dǎo)入鏡像
[root@m01 ~]# cobbler import --path=/mnt --name=CentOS7.6
task started: 2019-05-03_134203_import
--path=從哪里導(dǎo)入
--name=名稱
--arch=系統(tǒng)位數(shù)32 or 64
task started (id=Media import, time=Fri May 3 13:42:03 2019) ######此處需要較長的一個時間
Found a candidate signature: breed=redhat, version=rhel6
Found a matching signature: breed=redhat, version=rhel6
Adding distros from path /var/www/cobbler/ks_mirror/CentOS7.6:
creating new distro: CentOS7.6-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS7.6 -> /var/www/cobbler/links/CentOS7.6-x86_64
creating new profile: CentOS7.6-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/CentOS7.6 for CentOS7.6-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS7.6
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS7.6
looking for /var/www/cobbler/ks_mirror/CentOS7.6/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS7.6/repodata
*** TASK COMPLETE ***
-
查看cobbler都有哪些命令
[root@localhost /]# cobbler profile
usage
=====
cobbler profile add
cobbler profile copy
cobbler profile dumpvars
cobbler profile edit
cobbler profile find
cobbler profile getks
cobbler profile list
cobbler profile remove
cobbler profile rename
cobbler profile report
-
例如:我們查看當(dāng)前有幾個鏡像
[root@localhost /]# cobbler profile list
CentOS-6-x86_64
CentOS-7-x86_64
-
3、查看我們系統(tǒng)的詳細(xì)信息
[root@localhost /]# cobbler profile report
Name : CentOS-7.1-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : CentOS-7.1-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata : {}
Management Classes : []
Management Parameters : <<inherit>>
Name Servers : []
Name Servers Search Path : []
Owners : ['admin']
Parent Profile :
Internal proxy :
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Repos : []
Server Override : <<inherit>>
Template Files : {}
Virt Auto Boot : 1
Virt Bridge : xenbr0
Virt CPUs : 1
Virt Disk Driver Type : raw
Virt File Size(GB) : 5
Virt Path :
Virt RAM (MB) : 512
Virt Type : kvm
Name : CentOS-7-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : CentOS-7-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata : {}
Management Classes : []
Management Parameters : <<inherit>>
Name Servers : []
Name Servers Search Path : []
Owners : ['admin']
Parent Profile :
Internal proxy :
Red Hat Management Key : <<inherit>>
Red Hat Management Server : <<inherit>>
Repos : []
Server Override : <<inherit>>
Template Files : {}
Virt Auto Boot : 1
Virt Bridge : xenbr0
Virt CPUs : 1
Virt Disk Driver Type : raw
Virt File Size(GB) : 5
Virt Path :
Virt RAM (MB) : 512
Virt Type : kvm
-
4、修改ks的路徑,自定義安裝后,需要設(shè)置的一些東西,例如開啟哪些服務(wù),關(guān)閉哪些服務(wù)。安裝什么東西等
我們先上傳已經(jīng)設(shè)置好的cfg文件
為了規(guī)范,我們把kickstarts文件放在/var/lib/cobbler/kickstarts下面
[root@localhost ~]# cd /var/lib/cobbler/kickstarts/`
[root@localhost kickstarts]# rz
rz waiting to receive.
-
5、檢查一下路徑是否正確
[root@localhost kickstarts]# ll
total 60
-rw-r--r-- 1 root root 3704 Aug 24 2016 CentOS-6-x86_64.cfg
-rw-r--r-- 1 root root 1355 Aug 25 2016 CentOS-7-x86_64.cfg
-rw-r--r-- 1 root root 115 Jan 23 2016 default.ks
-rw-r--r-- 1 root root 22 Jan 23 2016 esxi4-ks.cfg
-rw-r--r-- 1 root root 22 Jan 23 2016 esxi5-ks.cfg
drwxr-xr-x 2 root root 54 Aug 23 09:17 install_profiles
-rw-r--r-- 1 root root 1424 Jan 23 2016 legacy.ks
-rw-r--r-- 1 root root 292 Jan 23 2016 pxerescue.ks
-rw-r--r-- 1 root root 2916 Jan 23 2016 sample_autoyast.xml
-rw-r--r-- 1 root root 1825 Jan 23 2016 sample_end.ks
-rw-r--r-- 1 root root 0 Jan 23 2016 sample_esx4.ks
-rw-r--r-- 1 root root 324 Jan 23 2016 sample_esxi4.ks
-rw-r--r-- 1 root root 386 Jan 23 2016 sample_esxi5.ks
-rw-r--r-- 1 root root 1784 Jan 23 2016 sample.ks
-rw-r--r-- 1 root root 3419 Jan 23 2016 sample_old.seed
-rw-r--r-- 1 root root 5879 Jan 23 2016 sample.seed
-
6、自定義kickstarts文件
我們使用cobbler profile report命令看到Kickstart默認(rèn)在/var/lib/cobbler/kickstarts/sample_end.ks
-
修改7的kickstarts
[root@localhost /]# cobbler profile edit --name=CentOS7.6-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7-x86_64.cfg
-
因為Centos7 默認(rèn)的網(wǎng)卡不在/etc/init.d/network 所以我們需要修改內(nèi)核
[root@localhost /]# cobbler profile report
-
我們查看到這里可以定義內(nèi)核參數(shù)
[root@localhost /]# cobbler profile edit --name=CentOS-7-x86_64 --kopts='net.ifnames=0 biosdevname=0'
這樣我們在安裝Centos7的時候就會默認(rèn)給我們加上這個內(nèi)核參數(shù)
-
7、執(zhí)行cobbler sync會刪除原來的文件,相當(dāng)于從新進(jìn)行加載
[root@localhost /]# cobbler sync
task started: 2016-08-24_001542_sync
task started (id=Sync, time=Wed Aug 24 00:15:42 2016)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/CentOS-7-x86_64
removing: /var/www/cobbler/images/CentOS-7.1-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/CentOS-7-x86_64
removing: /var/lib/tftpboot/images/CentOS-7.1-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying files for distro: CentOS-7.1-x86_64
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/CentOS-7.1-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/CentOS-7.1-x86_64/initrd.img
copying files for distro: CentOS-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7-x86_64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/CentOS-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7-x86_64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/CentOS-7-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: CentOS-7.1-x86_64
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/CentOS-7.1-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7.1-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/CentOS-7.1-x86_64/initrd.img
Writing template files for CentOS-7.1-x86_64
copying files for distro: CentOS-7-x86_64
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/CentOS-7-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/CentOS-7-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/CentOS-7-x86_64/initrd.img
Writing template files for CentOS-7-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: CentOS-7.1-x86_64
processing boot_files for distro: CentOS-7-x86_64
cleaning link caches
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:
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service
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 ***
-
8、新建虛擬機(jī)進(jìn)行安裝
提示:我們先打開系統(tǒng)日志,因為dhcp默認(rèn)會將日志顯示在/var/log/messages


-
9、我們在新建虛擬機(jī) 開機(jī)


-
到了這一步證明你的操作應(yīng)該該是沒有問題了,只需要耐心等待就可以了
-
報錯

-
注:這里可能是你的httpd、dhcp、nftp服務(wù)沒有開,打開再試一次
-
耐心等待,如果超時2次需要重新啟動,因為開啟了dhcp獲取到了IP地址,但是無法下載文件 肯定會超時

-
鼠標(biāo)點進(jìn)去選擇剛才咱們配置好的系統(tǒng),最后只需耐心等待,大功告成了?。?!
-
10、網(wǎng)頁管理cobbler
-
首先設(shè)置用戶名跟密碼
[root@cobbler/server/tools]# htdigest /etc/cobbler/users.digest "Cobbler" cobbler

-
網(wǎng)頁輸入:https://10.0.0.65/cobbler_web
-
報錯:

-
解決方法
因為你的python版本只要高于1.18就會出現(xiàn)這個錯誤
所以下就是解決辦法
[root@cobbler ~]# rpm -qa | grep "python2-django"
python2-django-1.11.20-1.el7.noarch
[root@cobbler ~]# rpm -e --nodeps python2-django-1.11.20-1.el7.noarch
[root@cobbler ~]# yum install python2-pip
[root@cobbler ~]# pip install --upgrade pip
[root@cobbler ~]# pip install Django==1.8.17
-
重啟http
[root@cobbler/server/tools]# systemctl restart httpd
-
再次訪問

-
這里的用戶名是cobbler,密碼就是你剛才輸入的密碼
-
我們可以查看profiles,點擊Edit可以修改系統(tǒng)的一些選項

-
在kernel里面可以設(shè)置一些內(nèi)核參數(shù)

-
在Kickstart Templates 可以查看我們的kickstarts文件

-
我們還可以修改kickstart文件
