cobbler
cobbler
简介
Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等。
Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。
Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。
Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet,暂时不支持SaltStack。
Cobbler官网:http://cobbler.github.io/
cobbler集成的服务
- PXE服务支持
- DHCP服务管理
- DNS服务管理(可选bind,dnsmasq)
- 电源管理
- Kickstart服务支持
- YUM仓库管理
- TFTP(PXE启动时需要) Apache(提供kickstart的安装源,并提供定制化的kickstart配置),是用来给轻量文件传输的
cobbler配置文件详解
cobbler配置文件目录在/etc/cobbler
| 配置文件 | 作用 |
|---|---|
| /etc/cobbler/settings | cobbler 主配置文件 |
| /etc/cobbler/iso/ | iso模板配置文件 |
| /etc/cobbler/pxe | pxe模板配置文件 |
| /etc/cobbler/power | 电源配置文件 |
| /etc/cobbler/user.conf | web服务授权配置文件 |
| /etc/cobbler/users.digest | web访问的用户名密码配置文件 |
| /etc/cobbler/dhcp.template | dhcp服务器的的配置模板 |
| /etc/cobbler/dnsmasq.template | dns服务器的配置模板 |
| /etc/cobbler/tftpd.template | tftp服务的配置模板 |
| /etc/cobbler/modules.conf | 模块的配置文件 |
cobbler数据目录
| 目录 | 作用 |
|---|---|
| /var/lib/cobbler/config/ | 用于存放distros,system,profiles等信息配置文件 |
| /var/lib/cobbler/triggers/ | 用于存放用户定义的cobbler命令 |
| /var/lib/cobbler/kickstart/ | 默认存放kickstart文件 |
| /var/lib/cobbler/loaders/ | 存放各种引导程序以及镜像目录 |
| /var/www/cobbler/ks_mirror/ | 导入的发行版系统的所有数据 |
| /var/www/cobbler/images/ | 导入发行版的kernel和initrd镜像用于远程网络启动 |
| /var/www/cobbler/repo_mirror/ | yum仓库存储目录 |
cobbler日志文件
| 日志文件路径 | 说明 |
|---|---|
| /var/log/cobbler/installing | 客户端安装日志 |
| /var/log/cobbler/cobbler.log | cobbler日志 |
部署
[root@localhost ~]# systemctl disable --now firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# vim /etc/selinux/config
[root@localhost ~]# reboot
[root@localhost ~]# setenforce 0
setenforce: SELinux is disabled
安装dnf
[root@localhost ~]# yum -y install dnf
安装epel源
[root@localhost ~]# yum -y install epel-release
安装cobbler以及相关的软件
[root@localhost ~]# yum -y install httpd dhcp-* tftp xinetd pykickstart
[root@localhost ~]# yum -y install module enable cobbler
查看一下cobbler
[root@localhost ~]# yum list all|grep cobbler
cobbler.x86_64 2.8.5-0.3.el7 @epel
cobbler-web.noarch 2.8.5-0.3.el7 epel
[root@localhost ~]# yum -y install cobbler cobbler-web
启动服务并设置开机自启
[root@localhost ~]# systemctl enable --now httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable --now cobblerd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/cobblerd.service to /usr/lib/systemd/system/cobblerd.service.
[root@localhost ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 5 127.0.0.1:25151 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 :::80 :::*
LISTEN 0 128 :::22 :::*
LISTEN 0 100 ::1:25 :::*
LISTEN 0 128 :::443 :::*
将tftp和serverip设置为本机ip
[root@localhost ~]# sed -i 's/^server: 127.0.0.1/server: 192.168.145.188/' /etc/cobbler/settings.yaml
[root@localhost ~]# sed -i 's/^next_server: 127.0.0.1/next_server: 192.168.145.188/' /etc/cobbler/settings.yaml
下载缺失文件
[root@localhost ~]# cobbler get-loaders
task started: 2021-10-13_043247_get_loaders
task started (id=Download Bootloader Content, time=Wed Oct 13 04:32:47 2021)
running python triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
shell triggers finished successfully
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
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/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 ***
为cobbler提供发行版存放目录及存储库文件
[root@localhost ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/cobbler/loaders/
cp: overwrite '/var/lib/cobbler/loaders/pxelinux.0'? y
[root@localhost ~]# cp /usr/share/syslinux/menu.c32 /var/lib/cobbler/loaders/
cp: overwrite '/var/lib/cobbler/loaders/menu.c32'? y
重启服务
root@localhost ~]# systemctl restart cobblerd
修改配置文件
[root@localhost cobbler]# vim settings
server: 192.168.145.149
next_server: 192.168.145.149
生成密码
[root@localhost ~]# openssl passwd -1
Password:
Verifying - Password:
$1$tdfM4Jv1$ULGr7idAE9MEPTrFD0Uje/
配置文件中修改生成的密码
[root@localhost cobbler]# vim settings
default_password_crypted: "$1$tdfM4Jv1$ULGr7idAE9MEPTrFD0Uje/"
启动rsyncd并设置开机自启
[root@localhost cobbler]# systemctl enable --now rsyncd
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
[root@localhost cobbler]# systemctl status rsyncd
● rsyncd.service - fast remote file copy program daemon
Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; enabled; vendor preset: disabled)
Active: active (running) since 三 2021-10-13 10:36:41 EDT; 12s ago
Main PID: 67465 (rsync)
CGroup: /system.slice/rsyncd.service
└─67465 /usr/bin/rsync --daemon --no-detach
10月 13 10:36:41 localhost.localdomain systemd[1]: Started fast remote file copy progr....
10月 13 10:36:41 localhost.localdomain systemd[1]: Starting fast remote file copy prog....
10月 13 10:36:41 localhost.localdomain rsyncd[67465]: rsyncd version 3.1.2 starting, l...3
Hint: Some lines were ellipsized, use -l to show in full.
重启一下cobblerd
[root@localhost ~]# systemctl restart cobblerd
[root@localhost 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 //yes 改成 no
per_source = 11
cps = 100 2
flags = IPv4
}
[root@localhost cobbler]# cobbler check //检查一下错误问题
The following are potential configuration items that you may want to fix:
1 : 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.
2 : debmirror package is not installed, it will be required to manage debian deployments and repositories
3 : 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.
第二个与第三个问题是关于debian系统的错误可以忽略
安装包fence-agents解决第三个问题
[root@localhost cobbler]# yum -y install fence-agents
在CentOS8传输文件到CentOS7中解决第一个问题
[root@localhost ~]# cd /var/lib/cobbler/loaders/
[root@localhost loaders]# ls
COPYING.syslinux README grub-x86_64.efi pxelinux.0
COPYING.yaboot grub-x86.efi menu.c32 yaboot
[root@localhost loaders]# scp -r /var/lib/cobbler/loaders root@192.168.145.149:/var/lib/cobbler/
root@192.168.145.149's password:
README 100% 9339 9.6MB/s 00:00
COPYING.yaboot 100% 9339 8.5MB/s 00:00
COPYING.syslinux 100% 9339 5.9MB/s 00:00
yaboot 100% 9339 8.1MB/s 00:00
pxelinux.0 100% 41KB 26.0MB/s 00:00
menu.c32 100% 26KB 24.0MB/s 00:00
grub-x86.efi 100% 9339 11.8MB/s 00:00
grub-x86_64.efi 100% 9339 12.5MB/s 00:00
[root@localhost cobbler]# ls
config kickstarts lock snippets web.ss
distro_signatures.json loaders scripts triggers webui_sessions
[root@localhost cobbler]# ll
总用量 64
drwxr-xr-x 10 root root 143 10月 13 02:38 config
-rw-r--r-- 1 root root 50604 8月 30 2019 distro_signatures.json
drwxr-xr-x 3 root root 4096 10月 13 02:38 kickstarts
drwxr-xr-x 2 root root 157 10月 13 04:55 loaders
-rw-r--r-- 1 root root 0 10月 13 02:52 lock
drwxr-xr-x 2 root root 63 10月 13 02:38 scripts
drwxr-xr-x 2 root root 4096 10月 13 02:38 snippets
drwxr-xr-x 7 root root 72 10月 13 02:38 triggers
-rw------- 1 apache root 1024 10月 13 11:08 web.ss
drwx------ 2 apache root 6 10月 14 2019 webui_sessions
[root@localhost cobbler]# ls loaders/
COPYING.syslinux grub-x86_64.efi menu.c32 README
COPYING.yaboot grub-x86.efi pxelinux.0 yaboot
重启cobblerd同步一下
[root@localhost cobbler]# systemctl restart cobblerd
[root@localhost cobbler]# cobbler sync
task started: 2021-10-13_112435_sync
task started (id=Sync, time=Wed Oct 13 11:24:35 2021)
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@localhost cobbler]# vim settings
manage_dhcp: 1
[root@localhost cobbler]# vim dhcp.template
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.145.0 netmask 255.255.255.0 {
option routers 192.168.145.149;
option domain-name-servers 192.168.145.2;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.145.200 192.168.145.254;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
重启同步
[root@localhost cobbler]# systemctl restart cobblerd
[root@localhost cobbler]# cobbler sync
task started: 2021-10-13_113155_sync
task started (id=Sync, time=Wed Oct 13 11:31:55 2021)
running pre-sync triggers
cleaning trees
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/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 images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
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: 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.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
安装net-tools 查看dhcp功能是否打开
[root@localhost cobbler]# yum -y install net-tools
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.njupt.edu.cn
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.njupt.edu.cn
* updates: mirrors.njupt.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 net-tools.x86_64.0.2.0-0.25.20131004git.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
===========================================================================================
Package 架构 版本 源 大小
===========================================================================================
正在安装:
net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k
事务概要
===========================================================================================
安装 1 软件包
总下载量:306 k
安装大小:917 k
Downloading packages:
net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1
验证中 : net-tools-2.0-0.25.20131004git.el7.x86_64 1/1
已安装:
net-tools.x86_64 0:2.0-0.25.20131004git.el7
完毕!
[root@localhost cobbler]# netstat -anulp|grep dhcp
udp 0 0 0.0.0.0:67 0.0.0.0:* 117078/dhcpd
挂载安装光盘
[root@localhost ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# ls /mnt/
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
导入
[root@localhost ~]# cobbler import --path=/mnt --name=centos-7 --arch=x86_64
task started: 2021-10-13_114833_import
task started (id=Media import, time=Wed Oct 13 11:48:33 2021)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/centos-7-x86_64:
creating new distro: centos-7-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos-7-x86_64 -> /var/www/cobbler/links/centos-7-x86_64
creating new profile: centos-7-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/centos-7-x86_64 for centos-7-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos-7-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/centos-7-x86_64
looking for /var/www/cobbler/ks_mirror/centos-7-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos-7-x86_64/repodata
*** TASK COMPLETE ***
查看
[root@localhost cobbler]# cobbler list
distros:
centos-7-x86_64
profiles:
centos-7-x86_64
systems:
repos:
images:
mgmtclasses:
packages:
files:
生成文件
[root@localhost ~]# cat > /var/lib/cobbler/kickstarts/rhel-7-x86_64.ks <<'EOF'
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.145.149/cobbler/ks_mirror/rhel-7-x86_64
$yum_repo_stanza
reboot
rootpw --iscrypted $6$2WTFvfNvAMgCUPuC$MJgWGzhakgxrRObcEbAwSe8vkz0s//xyiTllGwxRsHHruQhcskO69u2LVTU9u0eemHXH2pzcGawyAJ54R2E/x0
selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr
%packages
@^minimal
@core
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
EOF
修改名字
[root@localhost cobbler]# cd /var/lib/cobbler/kickstarts/
[root@localhost kickstarts]# mv rhel-7-x86_64.ks centos-7-x86_64.ks
[root@localhost kickstarts]# ls
centos-7-x86_64.ks install_profiles sample_end.ks sample_esxi6.ks sample.seed.28
default.ks legacy.ks sample_esx4.ks sample.ks
esxi4-ks.cfg pxerescue.ks sample_esxi4.ks sample_old.seed
esxi5-ks.cfg sample_autoyast.xml sample_esxi5.ks sample.seed
把anaconda-ks.cfg里面的密码替换centos-7-x86_64.ks里的密码
[root@localhost ~]# vim anaconda-ks.cfg
# Root password
rootpw --iscrypted $6$lhC7jSt4gX8hWhza$yVoq4SRtV/QKvFdFK9DI0uODI7K.7alKhkLnZPWDERJNXWTrLlCnXIjcVWKIiBIc9B86XwgUA7zj8ngCfHG9d.
[root@localhost kickstarts]# vim centos-7-x86_64.ks
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4" --grow --size=15000
text
firewall --disabled
firstboot --disable
keyboard us
lang en_US
url --url=http://192.168.145.149/cobbler/ks_mirror/centos-7-x86_64 //告诉它文件的位置
$yum_repo_stanza
reboot
rootpw --iscrypted $6$lhC7jSt4gX8hWhza$yVoq4SRtV/QKvFdFK9DI0uODI7K.7alKhkLnZPWDERJNXWTrLlCnXIjcVWKIiBIc9B86XwgUA7zj8ngCfHG9d.
selinux --disabled
skipx
timezone Asia/Shanghai --isUtc --nontp
install
zerombr
%packages
@^minimal
@core
kexec-tools
%end
语法检查
[root@localhost kickstarts]# cobbler validateks
task started: 2021-10-13_121044_validateks
task started (id=Kickstart Validation, time=Wed Oct 13 12:10:44 2021)
----------------------------
osversion: rhel7
checking url: http://192.168.145.149/cblr/svc/op/ks/profile/centos-7-x86_64
running: /usr/bin/ksvalidator -v "rhel7" "http://192.168.145.149/cblr/svc/op/ks/profile/centos-7-x86_64"
received on stdout:
received on stderr:
*** all kickstarts seem to be ok ***
*** TASK COMPLETE ***
查看配置文件
[root@localhost kickstarts]# cobbler profile list
centos-7-x86_64
修改profile,将我们新建的ks文件设为默认的kickstarts安装文件
[root@localhost kickstarts]# cobbler profile edit --name centos-7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos-7-x86_64.ks
配置网卡名称为传统网卡名称eth0
[root@localhost kickstarts]# cobbler profile edit --name centos-7-x86_64 --kopts='net.ifnames=0 biosdevname=0'
[root@localhost kickstarts]# cobbler profile report
DHCP Tag : default
Distribution : centos-7-x86_64
Enable gPXE? : 0
Enable PXE Menu? : 1
Fetchable Files : {}
Kernel Options : {'biosdevname': '0', 'net.ifnames': '0'}
Kernel Options (Post Install) : {}
同步
[root@localhost kickstarts]# cobbler sync
task started: 2021-10-13_121906_sync
task started (id=Sync, time=Wed Oct 13 12:19:06 2021)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/centos-7-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/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-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-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-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.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
重启服务
[root@localhost kickstarts]# systemctl restart xinetd
[root@localhost kickstarts]# systemctl restart httpd
[root@localhost kickstarts]# systemctl restart cobblerd
pxelinux.0 和menu.c32 这两个文件要用系统自带的,不能用从centos8那边复制过来的
[root@localhost ~]# cd /var/lib/cobbler/loaders/
[root@localhost loaders]# ls
COPYING.syslinux grub-x86_64.efi menu.c32 README
COPYING.yaboot grub-x86.efi pxelinux.0 yaboot
[root@localhost loaders]# find / -name pxelinux.0
/var/lib/tftpboot/pxelinux.0
/var/lib/cobbler/loaders/pxelinux.0
/usr/share/syslinux/pxelinux.0
[root@localhost loaders]# ll pxelinux.0 /usr/share/syslinux/pxelinux.0
-rw-r--r-- 2 root root 42376 10月 13 04:55 pxelinux.0
-rw-r--r-- 1 root root 26759 10月 30 2018 /usr/share/syslinux/pxelinux.0
[root@localhost loaders]# \cp /usr/share/syslinux/pxelinux.0 .
[root@localhost loaders]# ll pxelinux.0
-rw-r--r-- 2 root root 26759 10月 13 12:44 pxelinux.0
[root@localhost loaders]# find / -name menu.c32
/var/lib/tftpboot/menu.c32
/var/lib/cobbler/loaders/menu.c32
/usr/share/syslinux/menu.c32
[root@localhost loaders]# ll /usr/share/syslinux/menu.c32 menu.c32
-rw-r--r-- 2 root root 26272 10月 13 04:55 menu.c32
-rw-r--r-- 1 root root 55140 10月 30 2018 /usr/share/syslinux/menu.c32
[root@localhost loaders]# \cp /usr/share/syslinux/menu.c32 menu.c32
[root@localhost loaders]# ll /usr/share/syslinux/menu.c32 menu.c32
-rw-r--r-- 2 root root 55140 10月 13 12:45 menu.c32
-rw-r--r-- 1 root root 55140 10月 30 2018 /usr/share/syslinux/menu.c32
![]()


定制安装
定制安装步骤:
统计服务器mac地址 配置cobbler 安装
在 cobbler 的web界面上配置:
注:账号与密码都是cobbler




启动直接安装跳过蓝屏界面



浙公网安备 33010602011771号