Cobbler

无人值守安装

批量安装系统,使用简单,操作方便

可以配置KickStart来进行安装系统后的初始化操作,比如配置yum源、安装特定软件等

参考资料:

https://www.linuxidc.com/Linux/2017-10/147354.htm

https://www.cnblogs.com/pluse/p/8316914.html

1.配置yum

# Epel 源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# Cenos 源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装并启动相关服务

yum install cobbler dhcp
systemctl enable cobblerd
systemctl start cobblerd
systemctl enable  tftp
systemctl start  tftp
systemctl enable httpd
systemctl start httpd

2.检测

cobbler check
#根据提示一个个解决就可以 

解决

#1.修改主机
vim /etc/cobbler/settings
  #修改内容如下
  server: 10.1.1.99
  next_server: 10.1.1.99
  #管理DHCP
  manage_dhcp: 1
  
#2.修改默认密码
openssl passwd -1 123456
#vim /etc/cobbler/setting
default_password_crypted: "$1$AioqjlBC$OOkmSlubepi5kQ6HyFdWn0"

#3.下载所需要的文件
cobbler get-loaders

配置DHCP

# vim /etc/cobbler/dhcp.template
...
subnet 10.1.1.0 netmask 255.255.255.0 {
     option routers             10.1.1.99;
     option domain-name-servers 10.1.1.99;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        10.1.1.100 10.1.1.200;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
......

重启服务

systemctl restart cobblerd
cobbler check
cobbler sync

3.制作yum源

上传镜像,挂载

cobbler import --path=/mnt --name=centos7.6

注意:时间略长,请耐心等待

4.修改启动菜单

如果有需要则修改启动菜单

vim /var/lib/tftpboot/pxelinux.cfg/default

5.自定义KickStart

文件位置: /var/lib/cobbler/kickstarts/sample_end.ks

KickStart 参考: https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax

6.客户端测试

新建个虚拟机,开启后就会显示如下菜单

7.问题

dracut-initqueue[560]: Warning: Could not boot.
Warning: /dev/root does not exist
/sbin/dmsquash-live-root: line 273:printf: write erro: No space left do device

原因:虚拟机内存分配不足造成的。

Last modification:September 16th, 2019 at 07:26 pm