cobbler安装centos7.1

网上cobbler相关信息很杂乱,自己整理一版
主要参考:https://anjia0532.github.io/2019/02/22/cobbler/
https://www.cnblogs.com/clsn/p/7839965.html#auto_id_20

写在部署cobbler之前:

  1. 使用cobbler无非是想搭一个服务端,服务端和客户机在同一网络环境中,客户机网卡启动即可自动安装系统。
  2. cobller支持定制操作系统,比如:
  • 客户机启动方式(legacy/uefi),启动盘定位,按预设自动分区
  • 系统预安装哪些rpm包,ip设置(系统安装完ip也设置好),系统安全相关设置(脚本实现)

1.环境

  • 虚拟机VMware
  • yum源:mirrors.aliyun.com
  • 网络环境:某些安装包可能需要科学上网
[root@cobbler ~]# cobbler --version
Cobbler 2.8.4
[root@cobbler ~]# cat /etc/redhat-release 
CentOS Linux release 7.1.1503 (Core) 
[root@cobbler ~]# uname  -r
3.10.0-229.el7.x86_64

2.部署cobbler

1.确定好网络环境和yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all 
yum makecache

2.关闭selinux和防火墙

3.开始安装软件

yum install -y cobbler cobbler-web dhcp tftp-server pykickstart httpd xinetd

4.启动服务

[root@cobbler ~]# systemctl enable httpd
[root@cobbler ~]# systemctl enable xinetd
[root@cobbler ~]# systemctl enable rsyncd
[root@cobbler ~]# systemctl enable tftp
[root@cobbler ~]# systemctl enable cobblerd
----------------------------------------
[root@cobbler ~]# systemctl start httpd
[root@cobbler ~]# systemctl start xinetd
[root@cobbler ~]# systemctl start tftp
[root@cobbler ~]# systemctl start cobblerd

5.cobbler检查语法,根据提示一项项解决

[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 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
    https://github.com/cobbler/cobbler/wiki/Selinux
4 : change 'disable' to 'no' in /etc/xinetd.d/tftp
5 : 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.
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.
  • 一系列命令
sed -i 's/server: 127.0.0.1/server: 你的服务端ip/' /etc/cobbler/settings
sed -i 's/next_server: 127.0.0.1/next_server: 你的服务端ip/' /etc/cobbler/settings
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/' /etc/cobbler/settings
#防多次安装系统
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/' /etc/cobbler/settings
#设置开机root密码,可以不在此处设置,在ks配置文件里设置
sed -ri "/default_password_crypted/s#(.*: ).*#\1\"`openssl passwd -1 -salt 'oldboy' '123456'`\"#" /etc/cobbler/settings
#开启TFTP服务
sed -i 's#yes#no#' /etc/xinetd.d/tftp
  • 配置DHCP
[root@cobbler ~]# vi /etc/cobbler/dhcp.template
\#示例
\......
subnet 192.168.44.0 netmask 255.255.255.0 {
     option routers             192.168.44.1;
     option domain-name-servers 192.168.44.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.44.100 192.168.44.200;
\......

#subnet声明一个dhcp地址范围,ip为网络地址,子网掩码必须写成255.255.255.0
#range dynamic-bootp 设置客户机获取IP地址的范围
#default-lease-time为客户机获取网络参数的默认租约时间
#max-lease-time 为客户机获取网络参数之后的最大租约时
#filename需要推送给客户端的启动文件pxelinux.0
#next-server 参数,告诉客户端在获取到 pxelinux.0 文件之后去哪里获取其余的启动文件

  • 默认情况下,客户机获取分配ip的顺序就是在range dynamic-bootp地址段内从头开始,如果后续ks配置post脚本需要将此分配的ip写进网卡文件,可以删除/var/lib/dhcpd/dhcpd.leases里面已经存在的地址租赁记录。

比如某台服务器重启发现分配的地址是192.168.44.120,本来想使用192.168.44.100,但是发现租赁记录已有别的MAC地址绑定192.168.44.100。如果不删除/var/lib/dhcpd/dhcpd.leases里面已经存在的地址租赁记录192.168.44.100,这台服务器在地址租赁时间内只能用别的地址。

cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5

lease 192.168.44.100 {
  starts 5 2019/05/31 16:46:47;
  ends 5 2019/05/31 22:46:47;
  tstp 5 2019/05/31 22:46:47;
  cltt 5 2019/05/31 16:46:47;
  binding state free;
  hardware ethernet 00:0c:29:50:e0:3f;
  set vendorclass = "PXEClient:Arch:00000:UNDI:002001";
}
lease 192.168.44.101 {
  starts 5 2019/05/31 18:08:14;
  ends 6 2019/06/01 00:08:14;
  tstp 6 2019/06/01 00:08:14;
  cltt 5 2019/05/31 18:08:14;
  binding state free;
  hardware ethernet 00:0c:29:3c:11:b6;
  set vendorclass = "PXEClient:Arch:00000:UNDI:002001";
}
lease 192.168.44.102 {
  starts 1 2019/06/03 04:07:14;
  ends 1 2019/06/03 10:07:14;
  tstp 1 2019/06/03 10:07:14;
  cltt 1 2019/06/03 04:07:14;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:0c:29:aa:e1:6c;
  set vendorclass = "PXEClient:Arch:00000:UNDI:002001";
}
lease 192.168.44.103 {
  starts 1 2019/06/03 04:09:32;
  ends 1 2019/06/03 10:09:32;
  tstp 1 2019/06/03 10:09:32;
  cltt 1 2019/06/03 04:09:32;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 00:0c:29:92:69:fb;
}
server-duid "\000\001\000\001$\203^\007\000\014)\333\274\301";
  • cobbler get-loaders(这一步可能需要科学上网,遇到好几次报错,根据报错自己google)
[root@Cobbler ~]# cobbler get-loaders
[root@Cobbler ~]# ls  /var/lib/cobbler/loaders
COPYING.elilo     elilo-ia64.efi   menu.c32    yaboot
COPYING.syslinux  grub-x86_64.efi  pxelinux.0
COPYING.yaboot    grub-x86.efi     README

贴一个报错

[root@cobbler ~]# cobbler get-loaders
	path /var/lib/cobbler/loaders/README already exists, not overwriting existing content, use --force if you wish to update
	path /var/lib/cobbler/loaders/COPYING.elilo already exists, not overwriting existing content, use --force if you wish to update
	path /var/lib/cobbler/loaders/COPYING.yaboot already exists, not overwriting existing content, use --force if you wish to update
	path /var/lib/cobbler/loaders/COPYING.syslinux already exists, not overwriting existing content, use --force if you wish to update
	path /var/lib/cobbler/loaders/elilo-ia64.efi already exists, not overwriting existing content, use --force if you wish to update
	path /var/lib/cobbler/loaders/yaboot already exists, not overwriting existing content, use --force if you wish to update
	path /var/lib/cobbler/loaders/pxelinux.0 already exists, not overwriting existing content, use --force if you wish to update
	path /var/lib/cobbler/loaders/menu.c32 already exists, not overwriting existing content, use --force if you wish to update
	downloading http://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
	Exception occured: <class 'urlgrabber.grabber.URLGrabError'>
	Exception value: [Errno 14] PYCURL ERROR 56 - "Failure when receiving data from the peer"
	Exception Info:
	  File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 87, in run
	    rc = self._run(self)
	   File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 181, in runner
	    return self.remote.api.dlcontent(self.options.get("force",False), self.logger)
	   File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 751, in dlcontent
	    return grabber.run(force)
	   File "/usr/lib/python2.6/site-packages/cobbler/action_dlcontent.py", line 73, in run
	    urlgrabber.grabber.urlgrab(src, filename=dst, proxies=proxies)
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 618, in urlgrab
	    return default_grabber.urlgrab(url, filename, **kwargs)
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 985, in urlgrab
	    return self._retry(opts, retryfunc, url, filename)
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 886, in _retry
	    r = apply(func, (opts,) + args, {})
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 971, in retryfunc
	    fo = PyCurlFileObject(url, filename, opts)
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1066, in __init__
	    self._do_open()
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1360, in _do_open
	    self._do_grab()
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1490, in _do_grab
	    self._do_perform()
	   File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1347, in _do_perform
	    raise err
	
	!!! TASK FAILED !!!

下面操作基本能够解决上面的报错

[root@cobbler ~]# yum -y install syslinux
[root@cobbler ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/cobbler/loaders/
[root@cobbler ~]# cp /usr/share/syslinux/menu.c32 /var/lib/cobbler/loaders/
[root@cobbler ~]# service cobblerd restart
[root@cobbler ~]# cobbler get-loaders  
  • 重启服务
systemctl start rsyncd
systemctl enable rsyncd
systemctl enable tftp.socket
systemctl start tftp.socket
systemctl restart cobblerd.service
  • 检查语法,如果是下面2条,可以忽略
[root@Cobbler ~]# 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.
  • 同步修改的配置 cobbler sync
[root@cobbler ~]# cobbler sync
----------------------------
running pre-sync triggers
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***

6.测试打开cobblerweb网页(Django框架,且只支持https),此步骤可能遇到报错

  • 理想状态是打开https://192.168.44.60/cobbler_web登陆页面,登陆用户名密码默认cobbler
  • 报错:
    1. Internal Service Error,这是cobbler2.8bug,Django版本太高导致,重新下载Django
    [root@cobbler ~]# yum install -y python-pip
    [root@cobbler ~]# pip2.7 install -U django==1.9.13
    [root@cobbler ~]# systemctl restart cobblerd
    
    2. ImportError at / No module named ipaddress
    此步骤我用pip安装ipaddress依然提示找不到模块,但是就在模块库里。
    解决办法:yum install ipaddress -y

7. 安装系统

  • 导入镜像
    https://${cobbler_ip}/cobbler_web可以正常打开后,挂载安装镜像到/mnt。至于导入镜像,可以命令可以web操作。
    cobbler import --path=/mnt --name=CentOS7.1 --arch=x86_64
    
  • 修改镜像的网卡文件名为eth0,便于管理
#确定镜像的名字
[root@greenet Centos7.1-x86_64]# cobbler profile list
   Centos7.1-x86_64
#修改为eth0
cobbler profile edit --name Centos-7.2-x86_64 --kopts='net.ifnames=0 biosdevname=0' 
#cobbler report查看修改情况
profiles:
==========
Name                           : Centos7.1-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : Centos7.1-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/sample_end.ks
Kickstart Metadata             : {}
Management Classes             : []
  • cobbler rsync只要配置改了就要同步
  • 定制安装配置文件
profile默认是采用  /var/lib/cobbler/kickstarts/sample_end.ks  作为ks文件,可以通过report查看

[root@cobbler ~]# cobbler report
distros:
==========
Name                           : Centos7.1-x86_64
Architecture                   : x86_64
TFTP Boot Files                : {}
Breed                          : redhat
Comment                        : 
Fetchable Files                : {}
Initrd                         : /var/www/cobbler/ks_mirror/Centos7.1-x86_64/images/pxeboot/initrd.img
Kernel                         : /var/www/cobbler/ks_mirror/Centos7.1-x86_64/images/pxeboot/vmlinuz
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Kickstart Metadata             : {'tree': 'http://@@http_server@@/cblr/links/Centos7.1-x86_64'}
Management Classes             : []
OS Version                     : rhel7
Owners                         : ['admin']
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<inherit>>
Template Files                 : {}


profiles:
==========
Name                           : Centos7.1-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : Centos7.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


systems:
==========

repos:
==========

images:
==========

mgmtclasses:
==========

packages:
==========

files:
==========

如果用此配置文件定制,可以用类似下面的做法(不配mac地址可以多台机器使用这个配置)

  
cobbler system  add \
 
--name=node12 \
 
--hostname=cobbler-test  \
 
--profile=CentOS6.2-x86_64 \
 
--interface=eth0 \
 
--mac=00:25:90:67:CE:1A \
 
--interface=eth0 \
 
--ip-address=192.168.80.20 \
 
--subnet=255.255.255.0 \
 
--gateway=192.168.80.1 \
 
--static=1 \
 
--power-type=ipmilan \
 
--power-user=root \
 
--power-pass=calvin \
 
--power-address=192.168.80.120
  • /var/lib/cobbler/kickstarts/sample_end.ks 样本
# This kickstart file should only be used with EL > 5 and/or Fedora > 7.
# For older versions please use the sample.ks kickstart file.

#platform=x86, AMD64, or Intel EM64T
# System authorization information
#auth  --useshadow  --enablemd5
auth --useshadow  --passalgo=sha512

#启动盘设定sda
# System bootloader configuration
#bootloader --location=mbr
bootloader --append="biosdevname=0 net.ifnames=0 console=tty0 nomodeset crashkernel=auto" --location=mbr --boot-drive=sda
#自动分区格式
autopart --type=lvm
#格式化sda,避免格式化其他盘
# Partition clearing information
#clearpart --all --initlabel
clearpart --all --initlabel --drives=sda
# Use text mode install
text
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
ignoredisk --only-use=sda
# System keyboard
#keyboard us
keyboard --vckeymap=us --xlayouts='us'
# System language
lang zh_CN.UTF-8
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config')
# Reboot after installation
reboot

#加密的密码自己设定
#Root password
rootpw --iscrypted ******************************
user --name=liu --iscrypted --password=******************************
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  Asia/Shanghai --isUtc
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
#autopart


%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end

%packages
$SNIPPET('func_install_if_enabled')
@core
gdb
net-tools
ipmitool
wget
pciutils
sysstat
telnet
ftp
tcpdump
psmisc
unzip
ipmiutil
lrzsz
ntpdate
pigz
traceroute
unrar
xz
mcelog
netperf
iftop
tcpreplay
iptraf-ng
perl
python
httpd
mariadb
php
php-mysql
php-gd
php-mbstring
php-xml
perf
valgrind
ntfs-3g
net-snmp
net-snmp-utils
%end

%post --nochroot
$SNIPPET('log_ks_post_nochroot')
%end

%post
$SNIPPET('log_ks_post')
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
$SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
$SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
$SNIPPET('post_anamon')
# Start final steps
$SNIPPET('kickstart_done')
# End final steps
%end

%post --log=/root/ks-post.log
#disable service 
systemctl disable irqbalance.service
systemctl disable NetworkManager.service
# 下载脚本包,执行各个脚本
mkdir ./cdrom
wget -c -O ./cdrom/gn.tar.gz --no-check-certificate https://192.168.44.60/cobbler/ks_mirror/Centos7.1-x86_64/gn.tar.gz
cd /cdrom&&tar zxf gn.tar.gz&&chmod -R 777 /cdrom/
if [ $? -eq 0 ];then
        if [ -d "/cdrom/sh/" ];then
                cp -rfa /cdrom/sh/* /opt/
                for cmd in `ls /cdrom/sh/` ;do
                        ret=`echo $cmd| grep sh`
                        if [ -n $ret ];then
                                bash /cdrom/sh/$cmd
                        fi
                done
        fi
fi
%end

各部分配置的参考

配置文件采用了载入文件的方式,可载入得模块在/var/lib/cobbler/snippets/目录下,载入方式为$SNIPPET(‘文件名’) ,可以在/var/lib/cobbler/snippets/下建立文件,并在相应的模块(%pre %package %post)载入,即可完成。其中

%packages指令支持下面的选项:

--nobase,不要安装@Base 组.如果想创建一个很小的系统,可以使用这个选项.

--resolvedeps,选项已经被取消了.目前依赖关系可以自动地被解析.

--ignoredeps,选项已经被取消了.目前依赖关系可以自动地被解析.

--ignoremissing,忽略缺少的软件包或软件包组,而不是暂停安装来向用户询问是中止还是继续安装.


%pre(kickstart预安装脚本)开头.可以在%pre部分访问网络;然而,此时命名服务还未被配置,所以只能使用IP地址.

注:预安装脚本不在改换了的根环境(chroot)中运行.

--interpreter /usr/bin/python,允许指定不同的脚本语言,如Python.把/usr/bin/python替换成想使用的脚本语言.



%post(kickstart安装后脚本)常用,即在系统安装完成后执行一些脚本,即载入的$SINIPPET,(有兴趣的同学可以查看,/var/lib/cobbler/sinppets/下的各个文件,还有一些相应的参数.

也可以加入在系统安装完毕后运行的命令.这部分内容必须在kickstart的最后而且用%post命令开头.它被用于实现某些功能,如安装其他的软件和配置其他的命名服务器.

注:如果用静态IP信息和命名服务器配置网络,可以在%post部分访问和解析IP地址.如果使用DHCP配置网络,当安装程序执行到%post部分时,/etc/resolv.conf文件还没有准备好.此时,可以访问网络,但是不能解析IP地址.因此,如果使用DHCP,必须在%post部分指定IP地址.

注:post-install 脚本是在 chroot 环境里运行的.因此,某些任务如从安装介质复制脚本或RPM将无法执行.

%post  --nochroot,允许指定想在chroot环境之外运行的命令

下例把/etc/resolv.conf文件复制到刚安装的文件系统里.

%post  --nochroot   
cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
 


%post  --interpreter /usr/bin/python

允许指定不同的脚本语言,如Python.把/usr/bin/python替换成想使用的脚本语言.

%post  --log /path/to/logfile
将post脚本操作日志写进指定文件
%post --log=/root/ks-post.log

3.客户机从网卡启动安装,选择镜像安装

报错:1.获取不到TFTP服务器,可能是selinux和防火墙,可能是TFTP和cobbler配置问题。2.安装过程中报错,可能是ks配置文件有问题。

不管哪个环节报错,优先找报错日志

4. cobbler默认引导启动项是local,timeout20秒,需要手动选择进入安装系统引导项,比如下面的引导项名字是Centos7.1-x86_64。认为此步骤麻烦,希望默认进入安装系统,需要修改/etc/cobbler/pxe/pxedefault.template

[root@greenet liu]# cat /var/lib/tftpboot/pxelinux.cfg/default 
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://cobbler.github.io/
TIMEOUT 100
TOTALTIMEOUT 6000
ONTIMEOUT local

LABEL local
        MENU LABEL (local)
        MENU DEFAULT
        #MENU LABEL (local)
        LOCALBOOT -1

LABEL Centos7.1-x86_64
        kernel /images/Centos7.1-x86_64/vmlinuz
        MENU LABEL Centos7.1-x86_64
        append initrd=/images/Centos7.1-x86_64/initrd.img ksdevice=bootif lang=  text net.ifnames=0 biosdevname=0 kssendmac  ks=http://192.168.44.60/cblr/svc/op/ks/profile/Centos7.1-x86_64
        ipappend 2



MENU end

改/etc/cobbler/pxe/pxedefault.template第一行default,在系统引导行末尾加 ,同时注销local引导的MENU DEFAULT。cobbler sync同步配置,这样样/var/lib/tftpboot/pxelinux.cfg/default会同步修改。 修改后,不会出现启动项选择界面,直接进入安装。但是这样有个风险,如果客户机的网卡启动在BIOS是第一行,会多次重装系统。可以用在初次安装系统时,由于BIOS启动顺序中网卡启动在最下面,保持默认,客户机启动没检测到系统后,加载网卡启动。

举例:

#DEFAULT menu
DEFAULT Centos7.1-x86_64
PROMPT 0
MENU TITLE Cobbler | http://cobbler.github.io/
TIMEOUT 100
TOTALTIMEOUT 6000
ONTIMEOUT $pxe_timeout_profile

LABEL local
        MENU LABEL (local)
        #MENU DEFAULT
        #MENU LABEL (local)
        LOCALBOOT -1

$pxe_menu_items
        MENU DEFAULT
MENU end

转载于:https://my.oschina.net/u/3746745/blog/3057486

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值