cobbler的運行依賴于dhcp、tftp、rsync、dns、http、xinetd服務(wù)
cobbler #cobbler程序包
pykickstart #cobbler檢查kickstart語法錯誤
httpd #Apache web服務(wù)
dhcp #Dhcp服務(wù)
tftp #tftp服務(wù)
xinetd #諸多服務(wù)的超級守護進程
配置文件目錄 /etc/cobbler
/etc/cobbler #配置文件目錄
/etc/cobbler/settings #cobbler主配置文件
/etc/cobbler/dhcp.template #DHCP服務(wù)的配置模板
/etc/cobbler/tftpd.template #tftp服務(wù)的配置模板
/etc/cobbler/rsync.template #rsync服務(wù)的配置模板
/etc/cobbler/iso #iso模板配置文件目錄
/etc/cobbler/pxe #pxe模板文件目錄
/etc/cobbler/power #電源的配置文件目錄
/etc/cobbler/users.conf #web服務(wù)授權(quán)配置文件
/etc/cobbler/users.digest #web訪問的用戶名密碼配置文件
/etc/cobbler/dnsmasq.template #DNS服務(wù)的配置模板
/etc/cobbler/modules.conf #Cobbler模塊配置文件
Cobbler數(shù)據(jù)目錄
/var/lib/cobbler
/var/lib/cobbler/config #配置文件
/var/lib/cobbler/kickstarts #默認存放kickstart文件
/var/lib/cobbler/loaders #存放的各種引導(dǎo)程序
/var/www/cobbler #系統(tǒng)安裝鏡像目錄
/var/www/cobbler/ks_mirror #導(dǎo)入的系統(tǒng)鏡像列表,cobbler distro文件目錄
/var/www/cobbler/images #導(dǎo)入的系統(tǒng)鏡像啟動文件
/var/www/cobbler/repo_mirror #yum源存儲目錄
日志目錄
/var/log/cobbler
/var/log/cobbler/install.log #客戶端系統(tǒng)安裝日志
/var/log/cobbler/cobbler.log #cobbler日志
環(huán)境
[root@m01 ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@m01 ~]# uname -a
Linux m01 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@m01 ~]# curl -s -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@m01 ~]# curl -s -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@m01 ~]# getenforce
Disabled
[root@m01 ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@m01 ~]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.61 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::20c:29ff:fe1c:6e7f prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:1c:6e:7f txqueuelen 1000 (Ethernet)
RX packets 22627 bytes 24506454 (23.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11245 bytes 1357860 (1.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
yum方式安裝相關(guān)組件包
yum install -y httpd tftp dhcp cobbler pykickstart xinetd cobbler-web
[root@m01 ~]# yum install -y httpd tftp dhcp cobbler pykickstart xinetd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
(1/2): extras/7/x86_64/primary_db | 188 kB 00:00:02
(2/2): updates/7/x86_64/primary_db | 4.2 MB 00:00:04
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
The program yum-complete-transaction is found in the yum-utils package.
……………………………………………………………………………………………………………………………………………………………部分省略……………………………………………………………………………………………………………………………………………………………………………
Installed:
cobbler.x86_64 0:2.8.4-4.el7 dhcp.x86_64 12:4.2.5-68.el7.centos.1 httpd.x86_64 0:2.4.6-89.el7.centos pykickstart.noarch 0:1.99.66.19-2.el7 tftp.x86_64 0:5.2-22.el7
xinetd.x86_64 2:2.3.15-13.el7
Dependency Installed:
PyYAML.x86_64 0:3.10-11.el7 createrepo.noarch 0:0.9.9-28.el7 deltarpm.x86_64 0:3.6-3.el7
genisoimage.x86_64 0:1.1.11-25.el7 httpd-tools.x86_64 0:2.4.6-89.el7.centos jbigkit-libs.x86_64 0:2.0-11.el7
libtiff.x86_64 0:4.0.3-27.el7_3 libusal.x86_64 0:1.1.11-25.el7 libwebp.x86_64 0:0.3.0-7.el7
libyaml.x86_64 0:0.1.4-11.el7_0 mailcap.noarch 0:2.1.41-2.el7 mod_wsgi.x86_64 0:3.4-18.el7
mtools.x86_64 0:4.0.18-5.el7 python-backports.x86_64 0:1.0-8.el7 python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7
python-chardet.noarch 0:2.2.1-1.el7_1 python-cheetah.x86_64 0:2.4.4-5.el7.centos python-deltarpm.x86_64 0:3.6-3.el7
python-ipaddress.noarch 0:1.0.16-2.el7 python-kitchen.noarch 0:1.1.1-5.el7 python-netaddr.noarch 0:0.7.5-9.el7
python-pillow.x86_64 0:2.0.0-19.gitd1c6db8.el7 python-pygments.noarch 0:1.4-10.el7 python-setuptools.noarch 0:0.9.8-7.el7
python2-markdown.noarch 0:2.4.1-4.el7 python2-pyyaml.noarch 0:3.10-0.el7 python2-simplejson.x86_64 0:3.10.0-2.el7
syslinux.x86_64 0:4.05-15.el7 tftp-server.x86_64 0:5.2-22.el7 yum-utils.noarch 0:1.1.31-50.el7
Complete!
配置DHCP服務(wù)
[root@m01 ~]# cat /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.200 10.0.0.220;
default-lease-time 600;
max-lease-time 7200;
filename "pxelinux.0";
}
[root@m01 ~]# systemctl restart dhcpd
[root@m01 ~]# systemctl enable dhcpd
[root@m01 ~]# cat /etc/cobbler/dhcp.template
……………………………………………………………………………………………………………………………………………………………部分省略……………………………………………………………………………………………………………………………………………………………………………
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.254;
option domain-name-servers 223.5.5.5;
option subnet-mask 255.255.255.0;
range dynamic-bootp 10.0.0.200 10.0.0.220;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
}
……………………………………………………………………………………………………………………………………………………………部分省略……………………………………………………………………………………………………………………………………………………………………………
配置tftp服務(wù)
[root@m01 ~]# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no ######將默認的'yes'改為'no'
per_source = 11
cps = 100 2
flags = IPv4
[root@m01 ~]# systemctl restart xinetd.service
[root@m01 ~]# systemctl enable xinetd.service
[root@m01 ~]# systemctl restart httpd
[root@m01 ~]# systemctl enable httpd
[root@m01 ~]# systemctl restart cobblerd
[root@m01 ~]# systemctl enable cobblerd
[root@m01 ~]# sed -i 's#manage_dhcp: 0#manage_dhcp: 1#g' /etc/cobbler/settings
配置cobbler
運行cobbler chec得出以下提示
[root@m01 ~]# 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 : 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.
4 : enable and start rsyncd.service with systemctl
5 : debmirror package is not installed, it will be required to manage debian deployments and repositories
6 : 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
7 : 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.
問題1
cobbler文件默認是127.0.0.1本地回環(huán)地址,需要更改為提供cobbler服務(wù)的ip地址 10.0.0.61,在384行
sed -i 's#server: 127.0.0.1#server: 10.0.0.61#g' /etc/cobbler/settings
[root@m01 ~]# sed -i 's#server: 127.0.0.1#server: 10.0.0.61#g' /etc/cobbler/settings
問題2
netx_server也是默認本地127.0.0.1回環(huán)地址,需要修改為提供cobbler服務(wù)的ip地址 192.163.182,128,在272行
sed -i 's#next_server: 127.0.0.1#next_server: 10.0.0.61#g' /etc/cobbler/settings
[root@m01 ~]# sed -i 's#next_server: 127.0.0.1#next_server: 10.0.0.61#g' /etc/cobbler/settings
問題3
提示讓執(zhí)行cobbler get-loaders命令,執(zhí)行下就好了。(可以忽略)
[root@m01 ~]# cobbler get-loaders
task started: 2019-05-03_132702_get_loaders
task started (id=Download Bootloader Content, time=Fri May 3 13:27:02 2019)
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***
問題4
啟動rsyncd服務(wù)
[root@m01 ~]# systemctl start rsyncd
[root@m01 ~]# systemctl enable rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
問題5
提示沒有安裝debmirror包,需要管理debian部署和存儲庫(可以忽略)
問題6
提示更改密碼
[root@m01 ~]# openssl passwd -1 -salt "123" "123456"
$1$123$7mft0jKnzzvAdU4t0unTG1
并把把新生成的密碼寫入到/etc/cobbler/settings中,所處101行
default_password_crypted: "$1$123$7mft0jKnzzvAdU4t0unTG1"
問題7
可以忽略
以上問題解決完成后需要同步和重啟服務(wù)
[root@m01 ~]# systemctl restart cobblerd.service
[root@m01 ~]# cobbler sync
task started: 2019-05-03_133401_sync
task started (id=Sync, time=Fri May 3 13:34:01 2019)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
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 images
generating PXE configuration files
generating PXE menu structure
rendering TFTPD files
generating /etc/xinetd.d/tftp
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 shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
[root@m01 ~]# systemctl restart cobblerd.service
[root@m01 ~]# systemctl enable cobblerd.service
[root@m01 ~]# systemctl restart httpd.service
[root@m01 ~]# systemctl enable httpd.service
再次檢查是否完成更改
[root@m01 ~]# cobbler check
The following are potential configuration items that you may want to fix:
1 : debmirror package is not installed, it will be required to manage debian deployments and repositories
2 : 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.
磁盤掛載并導(dǎo)入
[root@m01 ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@m01 ~]# cobbler import --path=/mnt --name=CentOS7.6
task started: 2019-05-03_134203_import
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 ***
查看導(dǎo)入結(jié)果
[root@m01 ~]# cobbler distro list
CentOS7.6-x86_64
[root@m01 ~]# cobbler profile list
CentOS7.6-x86_64
distro : 發(fā)行版, 就是我們安裝什么版本的linux操作系統(tǒng)的名稱 一會我們會導(dǎo)入一個 distro.
profile : 類似于一個 配置文件,類似于你的 bash_profile, 里面包含你可以添加 kernel 參數(shù),對應(yīng)的kickstart 文件 以及 此profile 對應(yīng)的 distro 等等.
準備kickstart文件
在root目錄下找到ks文件,并移動到/var/lib/cobbler/kickstarts/到目錄下改名為ks.cfg或者使用下面的
CentOS6:
#Kickstart Configurator for cobbler by Jason Zhao
#platform=x86, AMD64, or Intel EM64T
key --skip
#System language
lang en_US
#System keyboard
keyboard us
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $default_password_crypted
#Use text mode install
text
#Install OS instead of upgrade
install
#Use NFS installation Media
url --url=http://10.0.0.61/cobbler/ks_mirror/* #這里需要更改為repodata所在的http地址
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext4 --size 1024 --ondisk sda
part swap --size 16384 --ondisk sda
part / --fstype ext4 --size 1 --grow --ondisk sda
#System authorization infomation
auth --useshadow --enablemd5
#Network information
$SNIPPET('network_config')
#network --bootproto=dhcp --device=em1 --onboot=on
#Reboot after installation
reboot
#Firewall configuration
firewall --disabled
#SELinux configuration
selinux --disabled
#Do not configure XWindows
skipx
#Package install information
%packages
@ base
@ chinese-support
@ core
sysstat
iptraf
ntp
e2fsprogs-devel
keyutils-libs-devel
krb5-devel
libselinux-devel
libsepol-devel
lrzsz
ncurses-devel
openssl-devel
zlib-devel
OpenIPMI-tools
mysql
lockdev
minicom
nmap
%post
#/bin/sed -i 's/#Protocol 2,1/Protocol 2/' /etc/ssh/sshd_config
/bin/sed -i 's/^ca::ctrlaltdel:/#ca::ctrlaltdel:/' /etc/inittab
/sbin/chkconfig --level 3 diskdump off
/sbin/chkconfig --level 3 dc_server off
/sbin/chkconfig --level 3 nscd off
/sbin/chkconfig --level 3 netfs off
/sbin/chkconfig --level 3 psacct off
/sbin/chkconfig --level 3 mdmpd off
/sbin/chkconfig --level 3 netdump off
/sbin/chkconfig --level 3 readahead off
/sbin/chkconfig --level 3 wpa_supplicant off
/sbin/chkconfig --level 3 mdmonitor off
/sbin/chkconfig --level 3 microcode_ctl off
/sbin/chkconfig --level 3 xfs off
/sbin/chkconfig --level 3 lvm2-monitor off
/sbin/chkconfig --level 3 iptables off
/sbin/chkconfig --level 3 nfs off
/sbin/chkconfig --level 3 ipmi off
/sbin/chkconfig --level 3 autofs off
/sbin/chkconfig --level 3 iiim off
/sbin/chkconfig --level 3 cups off
/sbin/chkconfig --level 3 openibd off
/sbin/chkconfig --level 3 saslauthd off
/sbin/chkconfig --level 3 ypbind off
/sbin/chkconfig --level 3 auditd off
/sbin/chkconfig --level 3 rdisc off
/sbin/chkconfig --level 3 tog-pegasus off
/sbin/chkconfig --level 3 rpcgssd off
/sbin/chkconfig --level 3 kudzu off
/sbin/chkconfig --level 3 gpm off
/sbin/chkconfig --level 3 arptables_jf off
/sbin/chkconfig --level 3 dc_client off
/sbin/chkconfig --level 3 lm_sensors off
/sbin/chkconfig --level 3 apmd off
/sbin/chkconfig --level 3 sysstat off
/sbin/chkconfig --level 3 cpuspeed off
/sbin/chkconfig --level 3 rpcidmapd off
/sbin/chkconfig --level 3 rawdevices off
/sbin/chkconfig --level 3 rhnsd off
/sbin/chkconfig --level 3 nfslock off
/sbin/chkconfig --level 3 winbind off
/sbin/chkconfig --level 3 bluetooth off
/sbin/chkconfig --level 3 isdn off
/sbin/chkconfig --level 3 portmap off
/sbin/chkconfig --level 3 anacron off
/sbin/chkconfig --level 3 irda off
/sbin/chkconfig --level 3 NetworkManager off
/sbin/chkconfig --level 3 acpid off
/sbin/chkconfig --level 3 pcmcia off
/sbin/chkconfig --level 3 atd off
/sbin/chkconfig --level 3 sendmail off
/sbin/chkconfig --level 3 haldaemon off
/sbin/chkconfig --level 3 smartd off
/sbin/chkconfig --level 3 xinetd off
/sbin/chkconfig --level 3 netplugd off
/sbin/chkconfig --level 3 readahead_early off
/sbin/chkconfig --level 3 xinetd off
/sbin/chkconfig --level 3 ntpd on
/sbin/chkconfig --level 3 avahi-daemon off
/sbin/chkconfig --level 3 ip6tables off
/sbin/chkconfig --level 3 restorecond off
/sbin/chkconfig --level 3 postfix off
CentOS7:
#Kickstart Configurator for cobbler by Jason Zhao
#platform=x86, AMD64, or Intel EM64T
#System language
lang en_US
#System keyboard
keyboard us
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $default_password_crypted
#Use text mode install
text
#Install OS instead of upgrade
install
#Use NFS installation Media
url --url=http://10.0.0.61/cobbler/ks_mirror/CentOS7.6/ #這里需要更改為repodata所在的http地址
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype xfs --size 1024 --ondisk sda
part swap --size 16384 --ondisk sda
part / --fstype xfs --size 1 --grow --ondisk sda
#System authorization infomation
auth --useshadow --enablemd5
#Network information
$SNIPPET('network_config')
#network --bootproto=dhcp --device=em1 --onboot=on
# Reboot after installation
reboot
#Firewall configuration
firewall --disabled
#SELinux configuration
selinux --disabled
#Do not configure XWindows
skipx
#Package install information
%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end
%packages
@ base
@ core
sysstat
iptraf
ntp
lrzsz
ncurses-devel
openssl-devel
zlib-devel
OpenIPMI-tools
mysql
nmap
screen
%end
%post
systemctl disable postfix.service
%end
主機名默認是localhost
修改方式,在配置文件中添加
network --hostname=test
修改網(wǎng)卡名稱從eth0開始技術(shù) ######CentOS7默認是ens33開始計數(shù),
[root@m01 ~]# cobbler profile edit --name=CentOS7.6-x86_64 --kopts='net.ifnames=0 biosdevname=0' --kickstart=/var/lib/cobbler/kickstarts/ks.cfg
[root@m01 ~]# cobbler profile report CentOS7.6-x86_64
Name : CentOS7.6-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : CentOS7.6-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {'biosdevname': '0', 'net.ifnames': '0'}
Kernel Options (Post Install) : {}
Kickstart : /var/lib/cobbler/kickstarts/ks.cfg
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
選擇相應(yīng)操作系統(tǒng)回車執(zhí)行下一步

等待自動安裝結(jié)束
裝機頁面自定義
[root@m01 ~]# cat /etc/cobbler/pxe/pxedefault.template
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://cobbler.github.io/
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT $pxe_timeout_profile
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
$pxe_menu_items
MENU end
修改完配置文件后一定要執(zhí)行 cobbler sync
根據(jù)MAC地址設(shè)置固定IP
[root@m01 ~]# cobbler system add --name=test --mac=00:50:56:29:32:09 --profile=CentOS7.6 --ip-address=10.0.0.200 subnet=255.255.255.0 --gateway=10.0.0.254 --interface=eth0 --static=1 --hostname=nginx
設(shè)置完成后curl http://10.0.0.61/cblr/svc/op/ks/system/test 得到ks配置文件
建議內(nèi)存大于3G否則可能會產(chǎn)生不可預(yù)知的錯誤
如果無法下載ks文件檢查所有服務(wù)狀態(tài)是否正常
httpd dhcpd xinetd tftp 等..