Cobbler支持UEFI

已经好久没折腾Cobbler,这次主要目的是要解决UEFI的问题。这里主要是记录一下全过程。

实验环境

vmware workstation 在NAT网络后面进行实验,关闭NAT网络的DHCP,

EPEL

Cobbler最新版本是2.8,已经update到Epel上。

yum install epel-release

Cobbler

yum install cobbler cobbler-web dhcp syslinux pykickstart xinetd fence-agents -y

启动相关服务

systemctl start cobblerd ; systemctl enable cobblerd
systemctl start httpd ; systemctl enable httpd
systemctl start rsyncd.service ; systemctl enable rsyncd.service
systemctl start xinetd ; systemctl enable xinetd

配置Cobbler

创建一个root账号的加密密码

# openssl passwd -1
Password: 
Verifying - Password: 
$1$j6bXkl6w$D/hKqAG1e5Oz6/77tuSlR.

编辑 /etc/cobbler/settings

default_password_crypted: "$1$j6bXkl6w$D/hKqAG1e5Oz6/77tuSlR."
manage_dhcp: 1
pxe_just_once: 1
next_server: 192.168.27.10
server: 192.168.27.10

配置dhcp

这是关键,DHCP会根据客户机器请求进行区分,Bios和UEFI,不同的方式来响应。

更新 /etc/cobbler/dhcp.template

subnet 192.168.27.0 netmask 255.255.255.0 {
     option routers             192.168.27.2;
     option domain-name-servers 192.168.27.10;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.27.100 192.168.27.200;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;

     class "pxeclients" {
          match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
          if option pxe-system-type = 00:02 {
                  filename "ia64/elilo.efi";
          } else if option pxe-system-type = 00:06 {
                  filename "grub/grub-x86.efi";
          } else if option pxe-system-type = 00:07 {
                  filename "grub/grub-x86_64.efi";
          } else if option pxe-system-type = 00:09 {
                  filename "grub/grub-x86_64.efi";
          } else {
                  filename "pxelinux.0";
          }
     }
}

重启和启动相关服务

systemctl restart cobblerd
cobbler get-loaders
cobbler sync
cobbler check

你会看到下面信息

# 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

Restart cobblerd and then run 'cobbler sync' to apply changes.

debmirror,可以忽略就行。

启动DHCP服务

systemctl enable dhcpd.service
systemctl restart dhcpd.service

重启xinetd服务

systemctl restart xinetd

导入镜像

mkdir /mnt/iso
mount -o loop /root/CentOS-7-x86_64-Minimal-1611.iso /mnt/iso/
cobbler import --arch=x86_64 --path=/mnt/iso --name=CentOS7

编辑efi的模板

# cat /etc/cobbler/pxe/efidefault.template 
default=0
timeout=10
title local
        quit
$grub_menu_items

cobbler同步

cobbler sync

这时候,可以启动一个bios,一个UEFI的虚拟机来测试。

抓包命令

tcpdump -i ens33 port 69

建议测试的时候,先启动一个bios虚拟机,确认pxe可以正常安装,再去搞UEFI的虚拟机。

如果你启动UEFI的虚拟机

看到这个界面,其实表示还是有问题。你需要抓包来定位一下问题。

如果你看到

现在CentOS进行安装,就会出现

那就恭喜,你已经搞定。时间有点长,慢慢等待就可以。

参考文档

https://www.olindata.com/blog/2015/07/cobbler-setup-centos7

http://www.linuxtechi.com/install-and-configure-cobbler-on-centos-7/

https://access.redhat.com/discussions/1168563

https://redmine.pfsense.org/issues/5046

陈沙克日志稿源:陈沙克日志 (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 后端存储 » Cobbler支持UEFI

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录