Cobbler无人值守批量安装Linux系统(5)

[root@linuxidc cobbler]# cobbler profile edit --name=CentOS7.2-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS7.2.ks
[root@linuxidc cobbler]# cobbler profile report
--name=CentOS7.2-x86_64 | grep -i kickstart Kickstart : /var/lib/cobbler/kickstarts/CentOS7.2.ks Kickstart Metadata : {}

对于centos7系列,则加上内核启动参数net.ifnames和biosdevname使得网卡名使用ethN系列而不使用enoXXXXXXX这样的随机名称。

[root@linuxidc cobbler]# cobbler profile edit --name=CentOS7.2-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS7.2.ks --kopts="net.ifnames=0 biosdevname=0" [root@linuxidc cobbler]# cobbler profile report --name=CentOS7.2-x86_64 | grep -Ei 'kernel|kickstart'
Kernel Options : {'biosdevname': '0', 'net.ifnames': '0'} Kernel Options (Post Install) : {} Kickstart : /var/lib/cobbler/kickstarts/CentOS7.2.ks Kickstart Metadata : {}

当然,不使用自生成的profile,自己添加一个profile也可以,同时还可以设置profile选项,如"--kickstart"项。如下:其中"--distro"指定该profile是添加到哪个distro下的。

[root@linuxidc cobbler]# cobbler profile add --name=CentOS7.2.1-x86_64 --distro=CentOS7.2-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS7.2.ks

实际上,每添加一个profile都是在向/var/lib/tftpboot/pxelinux.cfg/default中添加一个label。

[root@linuxidc cobbler]# cat /var/lib/tftpboot/pxelinux.cfg/default DEFAULT menu PROMPT 0 MENU TITLE Cobbler | http://cobbler.github.io/ TIMEOUT 200 TOTALTIMEOUT 6000 ONTIMEOUT local LABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT -1 LABEL CentOS7.2-x86_64 kernel /images/CentOS7.2-x86_64/vmlinuz MENU LABEL CentOS7.2-x86_64 append initrd=/images/CentOS7.2-x86_64/initrd.img ksdevice=bootif lang= text net.ifnames=0 biosdevname=0 kssendmac ks=http://172.16.10.10/cblr/svc/op/ks/profile/CentOS7.2-x86_64 ipappend 2 LABEL CentOS7.2.1-x86_64 kernel /images/CentOS7.2-x86_64/vmlinuz MENU LABEL CentOS7.2.1-x86_64 append initrd=/images/CentOS7.2-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://172.16.10.10/cblr/svc/op/ks/profile/CentOS7.2.1-x86_64 ipappend 2 MENU end

也就是说,其实可以不用生成profile,自己手动编辑label也可以。

默认使用的菜单背景图片是menu.c32,此处我改为vesamenu.c32,该背景图片是从syslinux包中提取的,背景图片而已,看个人喜好了。另外默认菜单等待时间是2秒,在自动安装的环境中,可以将其设置的短些。并且进入菜单默认停留在local,即从本地启动系统,但是此时系统还没装,所以要实现自动化,建议修改此项。

以下是修改后的项。

DEFAULT vemamenu DEFAULT menu PROMPT 0 MENU TITLE Cobbler | http://cobbler.github.io/ TIMEOUT 20 TOTALTIMEOUT 6000 ONTIMEOUT CentOS7.2-x86_64 LABEL local MENU LABEL (local) LOCALBOOT -1 LABEL CentOS7.2-x86_64 kernel /images/CentOS7.2-x86_64/vmlinuz MENU DEFAULT MENU LABEL CentOS7.2-x86_64 append initrd=/images/CentOS7.2-x86_64/initrd.img ksdevice=bootif lang= text net.ifnames=0 biosdevname=0 kssendmac ks=http://172.16.10.10/cblr/svc/op/ks/profile/CentOS7.2-x86_64 ipappend 2 LABEL CentOS7.2.1-x86_64 kernel /images/CentOS7.2-x86_64/vmlinuz MENU LABEL CentOS7.2.1-x86_64 append initrd=/images/CentOS7.2-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://172.16.10.10/cblr/svc/op/ks/profile/CentOS7.2.1-x86_64 ipappend 2 MENU end

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/13584.html