转载自http://www.it165.net/os/html/201311/6703.html
一、前言
在上篇博客中我们讲解了cobbler命令的详细使用,并在最后我们详细的讲解了Cobbler安装CentOS5.5全部过程,不清楚的博友可以先参考上一篇博文(http://www.it165.net/os/html/201311/6695.html),在这一篇博客中我们主要和大家总结一下上几篇博客讲解的内容,并详细讲解一下自定义Kickstart文件与Cobbler相关目录的说明,最后以一个实际案例做结尾。好了,废话不多说,下面我们先来回顾一下Cobbler工作原理。
二、Cobbler 工作原理详解
1.概述
在前几篇博客中我们和大家说了,Cobbler集众家之长支持众多有服务,我在这里简单的说一下Cobbler集成了哪些服务,
PXE 服务
DHCP服务管理
DNS服务管理
HTTP服务管理
TFTP服务管理
Kickstart服务
yum仓库管理
电源管理
2.工作流程
(1).需要安装系统的客户端主机的网卡支持网络安装,也就是支持以PXE模式启动。如下图,
(2).客户端主机需要有一个IP地址来与Cobbler Server进行通信,这时网络中必须要有一个主机能自动分配IP。DHCP就是一个能为客户端主机自动分配IP地址的服务,DHCP就是安装在Cobbler Server主机上。
(3).客户端得到IP地址后,需要提供一个引导程序pxelinux.0(类似于grub) 此文件由syslinux程序提供,所以需要安装syslinux并且能加载内核及内核镜像文件(vmlinuz与initrd.img),客户端可以通过TFTP协议到TFTP Server上下载内核及内核镜像文件(vmlinuz与initrd.img),所以需要一个TFTP 服务,TFTP也是安装在Cobbler Server主机上,客户端只是知道可以用TFTP协议下载文件,但是TFTP Server的IP是那个,这个还得需要DHCP服务器指名告诉客户端那个是TFTP Server(注,所以我们在配置DHCP模板时指定next-server,同时指定了filename,这里的filename就是指定的pxelinux.0引导程序),而TFTP服务需要超级进程进行管理,此进程是xinetd,因此需要在Cobbler Server上安装xinet服务。下面是DHCP模板的部分内容,
01.
[root@node2 ~]
# vim /etc/cobbler/dhcp.template
02.
subnet 192.168.18.0 netmask 255.255.255.0 {
03.
option routers 192.168.18.254;
04.
option domain-name-servers 192.168.18.254;
05.
option subnet-mask 255.255.255.0;
06.
range dynamic-bootp 192.168.18.221 192.168.18.225;
07.
filename
"/pxelinux.0"
;
#指定的网络引导程序
08.
default-lease-
time
21600;
09.
max-lease-
time
43200;
10.
next-server $next_server;
#指定的TFTP服务器的地址
(4).客户端完全自动化部署操作系统,则需要一个kickstart文件,默认使用的是/var/lib/cobbler/kickstarts/default.ks文件,我们也可以自己自定义一个kickstart文件,自定义kickstart文件可以自己手动的编写,也可以用system-config-kickstart工具进行生成,如果需要则可以在Cobbler Server上安装system-config-kickstart工具生成一个kickstart文件。
(5).已经有了kickstart文件,需要在kickstart文件中指定一个参数,告诉客户端以什么方式安装(http/ftp/nfs等),这里的参数指的就是到哪里去找安装源(安装源就是指安装系统所需的软件),这样的方式可以是nfs,ftp,http等,选择其一即可,Cobbler Server在此选择以http方式提供安装源。
3.Cobbler 所依赖的软件包
注,上述流程可以得到Cobbler安装软件所需的主要的依赖性包。
dhcp 提供IP地址、指名TFTP Server的地址、指定pxelinux文件 tftp-server 提供引导所需的文件、内核文件、内核镜像文件等 xinetd 管理tftp服务的超级进程 syslinux 提供pxelinux文件 system-config-kickstart 生成kickstart文件 httpd 提供安装源 cman 提供电源管理 其它依赖包
好了,刚才我们重新整理一下Cobbler的工作原理,希望可以帮助大家理解。下面我们来看一下Cobbler的常用命令!
三、Cobbler 常用命令汇总
1.导入镜像文件
命令:cobbler import --path=镜像路径 -- name=安装引导名 --arch=32位或64位
参数:
path 是镜像所挂载的目录
name 是导入到cobbler里面显示的名字
arch 是32位系统还是64位系统
2.导入kickstart文件
命令:cobbler profile add --name=list名 --distro=镜像 --kickstart=路径
参数:
name是表示添加的ks 的名字,用cobbler report可以看到这个名字
distro 是用哪个镜像,list的distros里面选择一个,需要版本相对应
kickstart 是具体的 ks 文件路径
3.同步DHCP、HTTPD
命令:cobbler sync
注,每次修改完dhcp.template之类的配置文件需要执行一次使其生效。
4.查看Cobbler列表
命令:cobbler list
注,列出Cobbler所有的元素。
5.删除相关列表
命令:cobbler distro/profile remove --name=要删除的引导文件名
删除指定 distro , 也就是镜像
删除指定的 profile 文件,也就是 ks
四、Cobbler 各种目录说明(注,这里只介绍重点的文件或目录 )
1.cobbler配置文件目录/etc/cobbler
1.
[root@node2 cobbler]
# ls /etc/cobbler/
2.
auth.conf cobblerd.service dnsmasq.template mongodb.conf
rsync
.exclude
users
.conf
3.
cheetah_macros cobbler_web.conf import_rsync_whitelist named.template
rsync
.template
users
.digest
4.
cobbler_bash completions iso power secondary.template version
5.
cobbler.conf dhcp.template ldap pxe settings zone.template
6.
cobblerd_rotate distro_signatures.json modules.conf reporting tftpd.template zone_templates
/etc/cobbler/settings cobbler主配置文件
/etc/cobbler/iso/ iso模板配置文件
/etc/cobbler/pxe pxe模板文件
/etc/cobbler/power 电源的配置文件
/etc/cobbler/users.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模块配置文件
2.cobbler数据目录/var/lib/cobbler
1.
[root@node2 cobbler]
# ls /var/lib/cobbler/
2.
config distro_signatures.json kickstarts loaders lock scripts snippets triggers web.ss
3.
[root@node2 config]
# ls
4.
distros.d files.d images.d mgmtclasses.d packages.d profiles.d repos.d systems.d
5.
[root@node2 loaders]
# ls
6.
COPYING.elilo COPYING.yaboot grub-x86_64.efi menu.c32 README
7.
COPYING.syslinux elilo-ia64.efi grub-x86.efi pxelinux.0 yaboot
/var/lib/cobbler/config/ 用于存放distros、systems、profiles等信息配置文件
/var/lib/cobbler/triggers 用于存放用户定义的cobbler 命令
/var/lib/cobbler/kickstarts/ 默认存放kickstart文件
/var/lib/cobbler/loaders 存放的各种引导程序
3.镜像数据目录/var/www/cobbler
1.
[root@node2 cobbler]
# ls
2.
aux images ks_mirror links localmirror pub rendered repo_mirror svc
/var/www/cobbler/ks_mirror/ 导入的发行版系统的所有数据
/var/www/cobbler/images/ 导入发行版的Kernel和initrd镜像用于远程网络启动
/var/www/cobbler/repo_mirror/ yum仓库存储目录
4.日志目录 /var/log/cobbler/
1.
[root@node2 cobbler]
# ls
2.
anamon cobbler.log
install
.log kicklog syslog tasks
3.
[root@node2 cobbler]
# cat install.log
4.
profile CentOS-5.5-x86_64 192.168.18.222 start 1384219313.49
5.
profile CentOS-5.5-x86_64 192.168.18.222 stop 1384219512.05
/var/log/cobbler/install.log 客户端的安装系统日志
/var/log/cobbler/cobbler.log cobbler日志
五、自定义Kickstart文件详解
1.默认的Kickstart文件
1.
[root@node2 kickstarts]
# cd /var/lib/cobbler/kickstarts/
2.
[root@node2 kickstarts]
# ls
3.
default.ks legacy.ks sample_end.ks sample_esxi5.ks sample.seed
4.
esxi4-ks.cfg pxerescue.ks sample_esx4.ks sample.ks
5.
esxi5-ks.cfg sample_autoyast.xml sample_esxi4.ks sample_old.seed
注,一般sample.ks与sample_end.ks用的比较多,下面我们来查看一下。
01.
[root@node2 ~]
# cobbler report
02.
#上面部分内容省略
03.
profiles:
04.
==========
05.
Name : CentOS-5.5-x86_64
06.
TFTP Boot Files : {}
07.
Comment :
08.
DHCP Tag : default
09.
Distribution : CentOS-5.5-x86_64
10.
Enable gPXE? : 0
11.
Enable PXE Menu? : 1
12.
Fetchable Files : {}
13.
Kernel Options : {}
14.
Kernel Options (Post Install) : {}
15.
Kickstart : /var/lib/cobbler/kickstarts/sample.ks
注,大家可以看到我们导入的CentOS5.5的镜像默认使用的kickstarts文件是sample.ks ,下面我们来具体看一下sample.ks的内容。
01.
[root@node2 ~]
# cat /var/lib/cobbler/kickstarts/sample.ks
02.
#platform=x86, AMD64, or Intel EM64T
03.
# System authorization information
04.
auth --useshadow --enablemd5
#用户登录认证
05.
# System bootloader configuration
06.
bootloader --location=mbr
#mbr引导
07.
# Partition clearing information
08.
clearpart --all --initlabel
#默认清除所以分区
09.
# Use text mode install
10.
text
#默认以文本模式安装
11.
# Firewall configuration
12.
firewall --enabled
#防火墙默认开启
13.
# Run the Setup Agent on first boot
14.
firstboot --disable
#禁用启动代理
15.
# System keyboard
16.
keyboard us
#默认英文键盘
17.
# System language
18.
lang en_US
#默认语言英文
19.
# Use network installation
20.
url --url=$tree
#网络安装路径
21.
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
22.
$yum_repo_stanza
#默认的yum仓库
23.
# Network information
24.
$SNIPPET('network_config')
25.
# Reboot after installation
26.
reboot
#安装完成后重启
27.
#Root password
28.
rootpw --iscrypted $default_password_crypted
#密码是我们/etc/cobbler/settings设置密码
29.
# SELinux configuration
30.
selinux --disabled
#默认关闭selinux
31.
# Do not configure the X Window System
32.
skipx
#默认没有安装图形界面
33.
# System timezone
34.
timezone America/New_York
#默认时区是美国/纽约
35.
# Install OS instead of upgrade
36.
install
#定义的是安装系统而不是升级系统
37.
# Clear the Master Boot Record
38.
zerombr
#默认清空所有的mbr
39.
# Allow anaconda to partition the system as needed
40.
autopart
#默认自动分区
41.
#下面就是Cobbler自定执行的一些脚本,我就不解释了。
42.
%pre
43.
$SNIPPET('log_ks_pre')
44.
$SNIPPET('kickstart_start')
45.
$SNIPPET('pre_install_network_config')
46.
# Enable installation monitoring
47.
$SNIPPET('pre_anamon')
48.
%packages
49.
$SNIPPET('func_install_if_enabled')
50.
$SNIPPET('puppet_install_if_enabled')
51.
%post
52.
$SNIPPET('log_ks_post')
53.
# Start yum configuration
54.
$yum_config_stanza
55.
# End yum configuration
56.
$SNIPPET('post_install_kernel_options')
57.
$SNIPPET('post_install_network_config')
58.
$SNIPPET('func_register_if_enabled')
59.
$SNIPPET('puppet_register_if_enabled')
60.
$SNIPPET('download_config_files')
61.
$SNIPPET('koan_environment')
62.
$SNIPPET('redhat_register')
63.
$SNIPPET('cobbler_register')
64.
# Enable post-install boot notification
65.
$SNIPPET('post_anamon')
66.
# Start final steps
67.
$SNIPPET('kickstart_done')
68.
# End final steps
注,大家可以看到默认的Kickstart文件,有许多地方并不符合我们的安装需求,如:默认时区不符合、分区不符合等。所以,我们得自定义Kickstart文件。
2.自定义Kickstart文件
一般两种方案:
手动的修改已有的Kickstart文件
用system-config-kickstart工具生成Kickstart文件
(1).手动的修改已有的Kickstart文件
注,手动修改已存在的Kickstart文件,其中有两个地方有Kickstart文件。一个在root家目录下的anaconda-ks.cfg文件,另一个就是我们默认的/var/lib/cobbler/kickstarts/sample.ks文件。其中anaconda-ks.cfg文件中有我们需要的时区信息、分区信息等,而sample.ks文件有我们需要的其它信息。我们可以手动修改一下,整理出我们需要的Kickstart文件。好了,下面我们就来手动的修改一下。
注,查看默认的 anaconda-ks.cfg 文件。
01.
[root@node2 ~]
# cat anaconda-ks.cfg
02.
# Kickstart file automatically generated by anaconda.
03.
#version=DEVEL
04.
install
05.
cdrom
06.
lang zh_CN.UTF-8
07.
keyboard us
08.
network --onboot no --device eth0 --bootproto dhcp --noipv6
09.
rootpw --iscrypted $6$rLcXd8hdqBw35VJ4$xMY155kcD1IULRuOW5AllU48obFbIgp11OBg72nPAE575mo8oC9Eqo8tGzJgtM2HkrDSciAGVUtCMXTjiIdaG.
10.
firewall --service=
ssh
11.
authconfig --enableshadow --passalgo=sha512
12.
selinux --enforcing
13.
timezone --utc Asia/Shanghai
14.
bootloader --location=mbr --driveorder=sda --append=
"crashkernel=auto rhgb quiet"
15.
# The following is the partition information you requested
16.
# Note that any partitions you deleted are not expressed
17.
# here so unless you clear all partitions first, this is
18.
# not guaranteed to work
19.
#clearpart --none
20.
#part /boot --fstype=ext4 --size=200
21.
#part / --fstype=ext4 --size=10000
22.
#part /data --fstype=ext4 --size=5000
23.
#part swap --size=1000
24.
repo --name=
"CentOS"
--baseurl=cdrom:sr0 --cost=100
25.
%packages
26.
@chinese-support
27.
@core
28.
@development
29.
@server-policy
注,查看默认的/var/lib/cobbler/kickstarts/sample.ks文件。
01.
[root@node2 ~]
# cat /var/lib/cobbler/kickstarts/sample.ks
02.
#platform=x86, AMD64, or Intel EM64T
03.
# System authorization information
04.
auth --useshadow --enablemd5
05.
# System bootloader configuration
06.
bootloader --location=mbr
07.
# Partition clearing information
08.
clearpart --all --initlabel
09.
# Use text mode install
10.
text
11.
# Firewall configuration
12.
firewall --enabled
13.
# Run the Setup Agent on first boot
14.
firstboot --disable
15.
# System keyboard
16.
keyboard us
17.
# System language
18.
lang en_US
19.
# Use network installation
20.
url --url=$tree
21.
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
22.
$yum_repo_stanza
23.
# Network information
24.
$SNIPPET('network_config')
25.
# Reboot after installation
26.
reboot
27.
#Root password
28.
rootpw --iscrypted $default_password_crypted
29.
# SELinux configuration
30.
selinux --disabled
31.
# Do not configure the X Window System
32.
skipx
33.
# System timezone
34.
timezone America/New_York
35.
# Install OS instead of upgrade
36.
install
37.
# Clear the Master Boot Record
38.
zerombr
39.
# Allow anaconda to partition the system as needed
40.
autopart
41.
%pre
42.
$SNIPPET('log_ks_pre')
43.
$SNIPPET('kickstart_start')
44.
$SNIPPET('pre_install_network_config')
45.
# Enable installation monitoring
46.
$SNIPPET('pre_anamon')
47.
%packages
48.
$SNIPPET('func_install_if_enabled')
49.
$SNIPPET('puppet_install_if_enabled')
50.
%post
51.
$SNIPPET('log_ks_post')
52.
# Start yum configuration
53.
$yum_config_stanza
54.
# End yum configuration
55.
$SNIPPET('post_install_kernel_options')
56.
$SNIPPET('post_install_network_config')
57.
$SNIPPET('func_register_if_enabled')
58.
$SNIPPET('puppet_register_if_enabled')
59.
$SNIPPET('download_config_files')
60.
$SNIPPET('koan_environment')
61.
$SNIPPET('redhat_register')
62.
$SNIPPET('cobbler_register')
63.
# Enable post-install boot notification
64.
$SNIPPET('post_anamon')
65.
# Start final steps
66.
$SNIPPET('kickstart_done')
67.
# End final steps
注,修改后的Kickstart文件。
01.
[root@node2 ~]
# cd /var/lib/cobbler/kickstarts/
02.
[root@node2 kickstarts]
# cp sample.ks centos.ks
03.
[root@node2 kickstarts]
# cat centos.ks
04.
#platform=x86, AMD64, or Intel EM64T
05.
# System authorization information
06.
auth --useshadow --enablemd5
07.
# System bootloader configuration
08.
bootloader --location=mbr
09.
# Partition clearing information
10.
clearpart --all --initlabel
11.
# Use text mode install
12.
text
13.
# Firewall configuration
14.
firewall --service=
ssh
#开启动防火墙但开放ssh服务
15.
# Run the Setup Agent on first boot
16.
firstboot --disable
17.
# System keyboard
18.
keyboard us
19.
# System language
20.
lang en_US
21.
# Use network installation
22.
url --url=$tree
23.
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
24.
$yum_repo_stanza
25.
# Network information
26.
$SNIPPET('network_config')
27.
# Reboot after installation
28.
reboot
29.
#Root password
30.
rootpw --iscrypted $default_password_crypted
31.
# SELinux configuration
32.
selinux --disabled
33.
# Do not configure the X Window System
34.
skipx
35.
# System timezone
36.
timezone --utc Asia/Shanghai
#时区修改为亚洲/上海
37.
# Install OS instead of upgrade
38.
install
39.
# Clear the Master Boot Record
40.
zerombr
41.
# Allow anaconda to partition the system as needed
42.
#下面定义的是默认分区,这个分区大小可以自己定义,单位为MB。由于我这里是虚拟机只有20的硬盘空间,所以我是这样划分的/boot 200MB、/ 10G 、/data 5G、swap 1G。
43.
part /boot --fstype=ext4 --size=200
44.
part / --fstype=ext4 --size=10000
45.
part /data --fstype=ext4 --size=5000
46.
part swap --size=1000
47.
%pre
48.
$SNIPPET('log_ks_pre')
49.
$SNIPPET('kickstart_start')
50.
$SNIPPET('pre_install_network_config')
51.
# Enable installation monitoring
52.
$SNIPPET('pre_anamon')
53.
%packages
#这里增加了默认安装的软件包,包括对中文的支持与开发组件。
54.
$SNIPPET('func_install_if_enabled')
55.
$SNIPPET('puppet_install_if_enabled')
56.
@chinese-support
57.
@core
58.
@development
59.
%post
60.
$SNIPPET('log_ks_post')
61.
# Start yum configuration
62.
$yum_config_stanza
63.
# End yum configuration
64.
$SNIPPET('post_install_kernel_options')
65.
$SNIPPET('post_install_network_config')
66.
$SNIPPET('func_register_if_enabled')
67.
$SNIPPET('puppet_register_if_enabled')
68.
$SNIPPET('download_config_files')
69.
$SNIPPET('koan_environment')
70.
$SNIPPET('redhat_register')
71.
$SNIPPET('cobbler_register')
72.
# Enable post-install boot notification
73.
$SNIPPET('post_anamon')
74.
# Start final steps
75.
$SNIPPET('kickstart_done')
76.
# End final steps
好了,到这里我们的手动修改Kickstart文件就全部讲解完成了,下面我们来说一下怎么用system-config-kickstart工具生成Kickstart文件。
(2).用system-config-kickstart工具生成Kickstart文件
注,首先我们得用yum安装一下system-config-kickstart工具。
1.
[root@node2 ~]
# yum install -y system-config-kickstart
注,下面我们就来具体演示一下怎么生成Kickstart文件。
1.
[root@node2 ~]
# system-config-kickstart
注,修改相关选项,设置时区、设置根口令、选择“安装后重新引导系统”。
注,选择“执行新安装”、安装方法选择“http”设置相关参数。
注,这里选择“清除主引导记录”、“删除所有现在分区”、“不要初始化磁盘标签”、设置分区。
注,配置网络信息,增加eth0设置为DHCP获得。
注,验证这里全部默认不需要修改。
注,设置防火墙与SELinux为禁用状态。
注,显示配置我这里安装了图形环境,你可以根据需要设置是否安装。首次引导设置代理“禁用”。
注,软件包这边我选择了“开发工具”,其它都没有选择其实就是默认安装。
注,语言支持这边我们选择是“中文支持”。
注,预安装脚本与安装后脚本可以根据需求自定义配置。
注,先预览一下我们的配置的Kickstart文件,发现在没有问题我们保存一下就好。
注,发现在没有问题了,我们保存一下。
01.
[root@node2 ~]
# ls
02.
anaconda-ks.cfg
install
.log
install
.log.syslog ks.cfg
03.
[root@node2 ~]
# cat ks.cfg
04.
#platform=x86, AMD64, 或 Intel EM64T
05.
#version=DEVEL
06.
# Firewall configuration
07.
firewall --disabled
08.
# Install OS instead of upgrade
09.
install
10.
# Use network installation
11.
url --url=
"http://192.168.18.202/cobbler/ks_mirror/CentOS-5.5-x86_64/"
12.
# Root password
13.
rootpw --iscrypted $1$lNz9giZK$b.1VPUVpxYkCYd/Su.E5r1
14.
# System authorization information
15.
auth --useshadow --passalgo=sha512
16.
# Use graphical install
17.
graphical
18.
firstboot --disable
19.
# System keyboard
20.
keyboard us
21.
# System language
22.
lang en_US
23.
# SELinux configuration
24.
selinux --disabled
25.
# Installation logging level
26.
logging --level=info
27.
# Reboot after installation
28.
reboot
29.
# System timezone
30.
timezone --isUtc Asia/Shanghai
31.
# Network information
32.
network --bootproto=dhcp --device=eth0 --onboot=on
33.
# Clear the Master Boot Record
34.
zerombr
35.
# Partition clearing information
36.
clearpart --all
37.
# Disk partitioning information
38.
part /boot --fstype=
"ext4"
--size=256
39.
part / --fstype=
"ext4"
--size=10000
40.
part /data --fstype=
"ext4"
--size=5000
41.
part swap --fstype=
"swap"
--size=1000
42.
%packages
43.
@chinese-support
44.
@development
45.
git
46.
-ibus-table-cangjie
47.
-ibus-table-erbi
48.
-ibus-table-wubi
49.
%end
好了,到这里我们的自定义Kickstart文件就全部讲解完成了,下面我们来说一下怎么将自定义的Kickstart文件与导入的镜像文件相关联。
3.将自定义的Kickstart文件与导入的镜像文件相关联
(1).查看一下导入的镜像文件
01.
[root@node2 ~]
# cobbler list
02.
distros:
03.
CentOS-5.5-x86_64
04.
CentOS-5.5-xen-x86_64
05.
profiles:
06.
CentOS-5.5-x86_64
07.
CentOS-5.5-xen-x86_64
08.
systems:
09.
repos:
10.
images:
11.
mgmtclasses:
12.
packages:
13.
files:
注,大家可以看到我们导入的是CentOS5.5镜像,下面我们再来查看一下此镜像对就的Kickstart文件。
01.
[root@node2 ~]
# cobbler report
02.
注,上面一些内容省略。
03.
profiles:
04.
==========
05.
Name : CentOS-5.5-x86_64
06.
TFTP Boot Files : {}
07.
Comment :
08.
DHCP Tag : default
09.
Distribution : CentOS-5.5-x86_64
10.
Enable gPXE? : 0
11.
Enable PXE Menu? : 1
12.
Fetchable Files : {}
13.
Kernel Options : {}
14.
Kernel Options (Post Install) : {}
15.
Kickstart : /var/lib/cobbler/kickstarts/sample.ks
16.
Kickstart Metadata : {}
17.
Management Classes : []
18.
Management Parameters : &
lt
;&
lt
;inherit&
gt
;&
gt
;
19.
Name Servers : []
20.
Name Servers Search Path : []
21.
Owners : ['admin']
22.
……
注,大家可以看到现在默认的Kickstart文件是sample.ks,现在我就来修改一下设置Kickstart文件文件为我们手动修改的Kickstart文件。
01.
[root@node2 ~]
# cobbler profile edit --name=CentOS-5.5-x86_64 --distro=CentOS-5.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos.ks
02.
[root@node2 ~]
# cobbler report
03.
注,上面一些内容省略。
04.
profiles:
05.
==========
06.
Name : CentOS-5.5-x86_64
07.
TFTP Boot Files : {}
08.
Comment :
09.
DHCP Tag : default
10.
Distribution : CentOS-5.5-x86_64
11.
Enable gPXE? : 0
12.
Enable PXE Menu? : 1
13.
Fetchable Files : {}
14.
Kernel Options : {}
15.
Kernel Options (Post Install) : {}
16.
Kickstart : /var/lib/cobbler/kickstarts/centos.ks
17.
……
好了,大家可以看到现在使用的Kickstart文件是我们自定义的Kickstart文件了,客户端再安装系统就会使用的我们定义Kickstart文件去执行。到这里我们的自定义Kickstart文件就全部讲解完成,最后我们来讲解一个案例来结束我们本篇博客。
六、Cobbler 实战案例安装CentOS6.4
1.实验拓扑
2.安装yum源
1.
[root@node2 ~]
# rpm -ivhhttp://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2.
Retrievinghttp://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
3.
warning: /var/tmp/rpm-tmp.N9dqlP: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
4.
Preparing...
########################################### [100%]
5.
1:epel-release
########################################### [100%]
3.同步系统时间
1.
[root@node2 ~]
# yum install -y ntp
2.
[root@node2 ~]
# ntpdate 202.120.2.101
3.
13 Nov 15:14:52 ntpdate[1174]: step
time
server 202.120.2.101 offset -28799.776629 sec
4.
[root@node2 ~]
# hwclock -w
4.安装Cobbler基础包
1.
[root@node2 ~]
# yum install -y cobbler tftp dhcp httpd cman pykickstart debmirror
5.安装Cobbler依赖包
1.
[root@node2 ~]
# yum install -y ed patch perl perl-Compress-Zlib perl-Digest-SHA1 perl-LockFile-Simple perl-libwww-perl
6.将所有服务加入开机自启动
1.
[root@node2 ~]
# chkconfig httpd on
2.
[root@node2 ~]
# chkconfig dhcpd on
3.
[root@node2 ~]
# chkconfig xinetd on
4.
[root@node2 ~]
# chkconfig cobblerd on
7.修改httpd配置文件并启动httpd
1.
[root@node2 ~]
# vim /etc/httpd/conf/httpd.conf
2.
ServerName 127.0.0.1:80
3.
[root@node2 ~]
# service httpd start
4.
正在启动 httpd: [确定]
5.
[root@node2 ~]
# netstat -ntulp | grep :80
6.
tcp 0 0 :::80 :::* LISTEN 1525/httpd
8.启动Cobbler服务并执行检查命令
01.
[root@node2 ~]
# service cobblerd start
02.
Starting cobbler daemon: [确定]
03.
[root@node2 ~]
# cobbler check
04.
The following are potential configuration items that you may want to fix:
05.
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.
06.
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.
07.
3 : 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.
08.
4 : change 'disable' to 'no'
in
/etc/xinetd.d/
rsync
09.
5 : comment out 'dists' on /etc/debmirror.conf
for
proper debian support
10.
6 : comment out 'arches' on /etc/debmirror.conf
for
proper debian support
11.
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
12.
Restart cobblerd and
then
run 'cobbler
sync
' to apply changes.
9.解决上述相关配置错误
(1).错误1,修改/etc/cobbler/settings 里面的 server 为Cobbler Server的IP地址 ;
1.
[root@node2 ~]
# vim /etc/cobbler/settings
2.
server: 192.168.18.202
(2).错误2,修改/etc/cobbler/settings 里面的 next_serverw 为本机的 ip;
1.
[root@node2 ~]
# vim /etc/cobbler/settings
2.
next_server: 192.168.18.202
(3).错误3,据说这个错误可以忽略,有强迫完美运行症的人士可以运行以下命令来解决;
01.
[root@node2 ~]
# cobbler get-loaders
02.
task started: 2013-11-04_143149_get_loaders
03.
task started (
id
=Download Bootloader Content,
time
=Mon Nov 4 14:31:49 2013)
04.
downloadinghttp://www.cobblerd.org/loaders/README to /var/lib/cobbler/loaders/README
05.
downloadinghttp://www.cobblerd.org/loaders/COPYING.elilo to/var/lib/cobbler/loaders/COPYING.elilo
06.
downloadinghttp://www.cobblerd.org/loaders/COPYING.yaboot to/var/lib/cobbler/loaders/COPYING.yaboot
07.
downloadinghttp://www.cobblerd.org/loaders/COPYING.syslinux to/var/lib/cobbler/loaders/COPYING.syslinux
08.
downloadinghttp://www.cobblerd.org/loaders/elilo-3.8-ia64.efi to/var/lib/cobbler/loaders/elilo-ia64.efi
09.
downloadinghttp://www.cobblerd.org/loaders/yaboot-1.3.14-12 to/var/lib/cobbler/loaders/yaboot
10.
downloadinghttp://www.cobblerd.org/loaders/pxelinux.0-3.61 to/var/lib/cobbler/loaders/pxelinux.0
11.
downloadinghttp://www.cobblerd.org/loaders/menu.c32-3.61 to /var/lib/cobbler/loaders/menu.c32
12.
downloadinghttp://www.cobblerd.org/loaders/grub-0.97-x86.efi to/var/lib/cobbler/loaders/grub-x86.efi
13.
downloadinghttp://www.cobblerd.org/loaders/grub-0.97-x86_64.efi to/var/lib/cobbler/loaders/grub-x86_64.efi
14.
*** TASK COMPLETE ***
(4).错误4,修改/etc/xinetd.d/tftp 把'disable' 修改为'no';修改/etc/xinetd.d/rsync 把'disable' 修改为'no';
1.
[root@node2 ~]
# vim /etc/xinetd.d/tftp
2.
disable = no
3.
[root@node2 ~]
# vim /etc/xinetd.d/rsync
4.
disable = no
注,启动xinetd服务。
1.
[root@node2 ~]
# service xinetd start
2.
正在启动 xinetd: [确定]
(5).错误5与错误6,debmmirror有错误;
1.
[root@node2 ~]
# vim /etc/debmirror.conf
2.
#注释掉@dists="sid"与@arches="i386即可
3.
#@dists="sid";
4.
#@arches="i386";
(6).错误7,设置默认root密码;
注,刚接触Cobbler的博友会问,这个密码是什么密码。有的博友系统安装好了会问,root密码是什么。这里设置的就是客户端安装好系统的root密码。
注,生成你想要的密码的加密字符串,然后复制运行命令之后的加密代码;
1.
[root@node2 ~]
# openssl passwd -1 -salt 'hahaha' '123456'
2.
$1$hahaha$hSxFjZSHRoiEn4DYrrGUI.
10.重新启动Cobbler并运行检查命令
1.
[root@node2 ~]
# service cobblerd restart
2.
Stopping cobbler daemon: [确定]
3.
Starting cobbler daemon: [确定]
4.
[root@node2 ~]
# cobbler check
5.
The following are potential configuration items that you may want to fix:
6.
1 : service dhcpd is not running
7.
Restart cobblerd and
then
run 'cobbler
sync
' to apply changes.
11.修改DHCP模板
01.
[root@node2 ~]
# vim /etc/cobbler/dhcp.template
02.
subnet 192.168.18.0 netmask 255.255.255.0 {
03.
option routers 192.168.18.254;
04.
option domain-name-servers 192.168.18.254;
05.
option subnet-mask 255.255.255.0;
06.
range dynamic-bootp 192.168.18.221 192.168.18.225;
07.
filename
"/pxelinux.0"
;
08.
default-lease-
time
21600;
09.
max-lease-
time
43200;
10.
next-server $next_server;
12.执行一下同步操作并检查配置文件
01.
[root@node2 ~]
# cobbler sync
02.
task started: 2013-11-13_153610_sync
03.
task started (
id
=Sync,
time
=Wed Nov 13 15:36:10 2013)
04.
running pre-
sync
triggers
05.
cleaning trees
06.
mkdir
: /var/lib/tftpboot/pxelinux.cfg
07.
mkdir
: /var/lib/tftpboot/grub
08.
mkdir
: /var/lib/tftpboot/s390x
09.
mkdir
: /var/lib/tftpboot/ppc
10.
mkdir
: /var/lib/tftpboot/etc
11.
removing: /var/lib/tftpboot/grub/images
12.
copying bootloaders
13.
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -&
gt
; /var/lib/tftpboot/pxelinux.0
14.
trying hardlink /var/lib/cobbler/loaders/menu.c32 -&
gt
; /var/lib/tftpboot/menu.c32
15.
trying hardlink /var/lib/cobbler/loaders/yaboot -&
gt
; /var/lib/tftpboot/yaboot
16.
trying hardlink /usr/share/syslinux/memdisk -&
gt
; /var/lib/tftpboot/memdisk
17.
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -&
gt
; /var/lib/tftpboot/grub/grub-x86_64.efi
18.
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -&
gt
; /var/lib/tftpboot/grub/grub-x86.efi
19.
copying distros to tftpboot
20.
copying images
21.
generating PXE configuration files
22.
generating PXE menu structure
23.
rendering DHCP files
24.
generating /etc/dhcp/dhcpd.conf
25.
rendering TFTPD files
26.
generating /etc/xinetd.d/tftp
27.
cleaning link caches
28.
running post-
sync
triggers
29.
running python triggers from /var/lib/cobbler/triggers/
sync
/post/*
30.
running python trigger cobbler.modules.sync_post_restart_services
31.
running: dhcpd -t -q
32.
received on stdout:
33.
received on stderr:
34.
running: service dhcpd restart
35.
received on stdout: 正在启动 dhcpd:[确定]
36.
received on stderr:
37.
running shell triggers from /var/lib/cobbler/triggers/
sync
/post/*
38.
running python triggers from /var/lib/cobbler/triggers/change/*
39.
running python trigger cobbler.modules.scm_track
40.
running shell triggers from /var/lib/cobbler/triggers/change/*
41.
*** TASK COMPLETE ***
42.
[root@node2 ~]
# cobbler check
43.
No configuration problems found. All systems go.
好了,到这里我们Cobbler安装就全部完成了,最后我们来重新启动一下xinetd并查看一下启动的端口。
01.
[root@node2 ~]
# service xinetd restart
02.
停止 xinetd: [确定]
03.
正在启动 xinetd:
04.
[确定]
05.
[root@node2 ~]
# netstat -ntulp
06.
Active Internet connections (only servers)
07.
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
08.
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1010/sshd
09.
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1087/master
10.
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 1125/sshd
11.
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 1478/sshd
12.
tcp 0 0 127.0.0.1:25151 0.0.0.0:* LISTEN 1643/python
13.
tcp 0 0 :::80 :::* LISTEN 1525/httpd
14.
tcp 0 0 :::22 :::* LISTEN 1010/sshd
15.
tcp 0 0 ::1:25 :::* LISTEN 1087/master
16.
tcp 0 0 ::1:6010 :::* LISTEN 1125/sshd
17.
tcp 0 0 ::1:6011 :::* LISTEN 1478/sshd
18.
tcp 0 0 :::873 :::* LISTEN 1777/xinetd
19.
udp 0 0 0.0.0.0:67 0.0.0.0:* 1715/dhcpd
20.
udp 0 0 0.0.0.0:69 0.0.0.0:* 1777/xinetd
21.
udp 0 0 0.0.0.0:69 0.0.0.0:* 1618/
in
.tftpd
13.导入CentOS6.4镜像文件
01.
[root@node2 ~]
# mount /dev/cdrom /mnt
02.
mount
: block device /dev/sr0 is write-protected, mounting
read
-only
03.
[root@node2 ~]
# cd /mnt/
04.
[root@node2 mnt]
# ls
05.
CentOS_BuildTag GPL Packages RPM-GPG-KEY-CentOS-6 RPM-GPG-KEY-CentOS-Testing-6
06.
EFI images RELEASE-NOTES-en-US.html RPM-GPG-KEY-CentOS-Debug-6 TRANS.TBL
07.
EULA isolinux repodata RPM-GPG-KEY-CentOS-Security-6
08.
[root@node2 ~]
# cobbler import --path=/mnt/ --name=CentOS-6.4 --arch=x86_64
09.
task started: 2013-11-13_154155_import
10.
task started (
id
=Media
import
,
time
=Wed Nov 13 15:41:55 2013)
11.
Found a candidate signature: breed=redhat, version=rhel6
12.
Found a matching signature: breed=redhat, version=rhel6
13.
Adding distros from path /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64:
14.
creating new distro: CentOS-6.4-x86_64
15.
trying
symlink
: /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64 -&
gt
; /var/www/cobbler/links/CentOS-6.4-x86_64
16.
creating new profile: CentOS-6.4-x86_64
17.
associating repos
18.
checking
for
rsync
repo(s)
19.
checking
for
rhn repo(s)
20.
checking
for
yum repo(s)
21.
starting descent into /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
for
CentOS-6.4-x86_64
22.
processing repo at : /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
23.
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
24.
looking
for
/var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/repodata/*comps*.xml
25.
running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/repodata/2727fcb43fbe4c1a3588992af8c19e4d97167aee2f6088959221fc285cab6f72-c6-x86_64-comps.xml /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64
26.
received on stdout: Spawning worker 0 with 3955 pkgs
27.
Workers Finished
28.
Gathering worker results
29.
Saving Primary metadata
30.
Saving
file
lists metadata
31.
Saving other metadata
32.
Generating sqlite DBs
33.
Sqlite DBs complete
34.
received on stderr:
35.
*** TASK COMPLETE ***
36.
[root@node2 ~]
# cobbler list
37.
distros:
38.
CentOS-6.4-x86_64
39.
profiles:
40.
CentOS-6.4-x86_64
41.
systems:
42.
repos:
43.
images:
44.
mgmtclasses:
45.
packages:
46.
files:
14.查看一下导入镜像的详细信息
01.
[root@node2 ~]
# cobbler report
02.
distros:
03.
==========
04.
Name : CentOS-6.4-x86_64
05.
Architecture : x86_64
06.
TFTP Boot Files : {}
07.
Breed : redhat
08.
Comment :
09.
Fetchable Files : {}
10.
Initrd : /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/images/pxeboot/initrd.img
11.
Kernel : /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/images/pxeboot/vmlinuz
12.
Kernel Options : {}
13.
Kernel Options (Post Install) : {}
14.
Kickstart Metadata : {'tree': 'http://@@http_server@@/cblr/links/CentOS-6.4-x86_64'}
15.
Management Classes : []
16.
OS Version : rhel6
17.
Owners : ['admin']
18.
Red Hat Management Key : &
lt
;&
lt
;inherit&
gt
;&
gt
;
19.
Red Hat Management Server : &
lt
;&
lt
;inherit&
gt
;&
gt
;
20.
Template Files : {}
21.
profiles:
22.
==========
23.
Name : CentOS-6.4-x86_64
24.
TFTP Boot Files : {}
25.
Comment :
26.
DHCP Tag : default
27.
Distribution : CentOS-6.4-x86_64
28.
Enable gPXE? : 0
29.
Enable PXE Menu? : 1
30.
Fetchable Files : {}
31.
Kernel Options : {}
32.
Kernel Options (Post Install) : {}
33.
Kickstart : /var/lib/cobbler/kickstarts/sample_end.ks
34.
Kickstart Metadata : {}
35.
Management Classes : []
36.
Management Parameters : &
lt
;&
lt
;inherit&
gt
;&
gt
;
37.
Name Servers : []
38.
Name Servers Search Path : []
39.
Owners : ['admin']
40.
Parent Profile :
41.
Proxy :
42.
Red Hat Management Key : &
lt
;&
lt
;inherit&
gt
;&
gt
;
43.
Red Hat Management Server : &
lt
;&
lt
;inherit&
gt
;&
gt
;
44.
Repos : []
45.
Server Override : &
lt
;&
lt
;inherit&
gt
;&
gt
;
46.
Template Files : {}
47.
Virt Auto Boot : 1
48.
Virt Bridge : xenbr0
49.
Virt CPUs : 1
50.
Virt Disk Driver Type : raw
51.
Virt File Size(GB) : 5
52.
Virt Path :
53.
Virt RAM (MB) : 512
54.
Virt Type : kvm
55.
systems:
56.
==========
57.
repos:
58.
==========
59.
images:
60.
==========
61.
mgmtclasses:
62.
==========
63.
packages:
64.
==========
65.
files:
66.
==========
15.自定义kickstart文件
01.
[root@node2 ~]
# cd /var/lib/cobbler/kickstarts/
02.
[root@node2 kickstarts]
# cp sample_end.ks centos6.ks
03.
[root@node2 kickstarts]
# vim centos6.ks
04.
# kickstart template for Fedora 8 and later.
05.
# (includes %end blocks)
06.
# do not use with earlier distros
07.
#platform=x86, AMD64, or Intel EM64T
08.
# System authorization information
09.
auth --useshadow --enablemd5
10.
# System bootloader configuration
11.
bootloader --location=mbr
12.
# Partition clearing information
13.
clearpart --all --initlabel
14.
# Use text mode install
15.
text
16.
# Firewall configuration
17.
firewall --service=
ssh
18.
# Run the Setup Agent on first boot
19.
firstboot --disable
20.
# System keyboard
21.
keyboard us
22.
# System language
23.
lang en_US
24.
# Use network installation
25.
url --url=$tree
26.
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
27.
$yum_repo_stanza
28.
# Network information
29.
$SNIPPET('network_config')
30.
# Reboot after installation
31.
reboot
32.
#Root password
33.
rootpw --iscrypted $default_password_crypted
34.
# SELinux configuration
35.
selinux --disabled
36.
# Do not configure the X Window System
37.
skipx
38.
# System timezone
39.
timezone --utc Asia/Shanghai
40.
# Install OS instead of upgrade
41.
install
42.
# Clear the Master Boot Record
43.
zerombr
44.
# Allow anaconda to partition the system as needed
45.
part /boot --fstype=ext4 --size=200
46.
part / --fstype=ext4 --size=10000
47.
part /data --fstype=ext4 --size=5000
48.
part swap --size=1000
49.
%pre
50.
$SNIPPET('log_ks_pre')
51.
$SNIPPET('kickstart_start')
52.
$SNIPPET('pre_install_network_config')
53.
# Enable installation monitoring
54.
$SNIPPET('pre_anamon')
55.
%end
56.
%packages
57.
@chinese-support
58.
@development
59.
$SNIPPET('func_install_if_enabled')
60.
%end
61.
%post
62.
$SNIPPET('log_ks_post')
63.
# Start yum configuration
64.
$yum_config_stanza
65.
# End yum configuration
66.
$SNIPPET('post_install_kernel_options')
67.
$SNIPPET('post_install_network_config')
68.
$SNIPPET('func_register_if_enabled')
69.
$SNIPPET('download_config_files')
70.
$SNIPPET('koan_environment')
71.
$SNIPPET('redhat_register')
72.
$SNIPPET('cobbler_register')
73.
# Enable post-install boot notification
74.
$SNIPPET('post_anamon')
75.
# Start final steps
76.
$SNIPPET('kickstart_done')
77.
# End final steps
78.
%end
16.将自定义的kickstart文件与镜像相关联
01.
[root@node2 ~]
# cobbler profile edit --name=CentOS-6.4-x86_64 --distro=CentOS-6.4-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos6.ks
02.
[root@node2 ~]
# cobbler report
03.
注,上面部分省略。
04.
profiles:
05.
==========
06.
Name : CentOS-6.4-x86_64
07.
TFTP Boot Files : {}
08.
Comment :
09.
DHCP Tag : default
10.
Distribution : CentOS-6.4-x86_64
11.
Enable gPXE? : 0
12.
Enable PXE Menu? : 1
13.
Fetchable Files : {}
14.
Kernel Options : {}
15.
Kernel Options (Post Install) : {}
16.
Kickstart : /var/lib/cobbler/kickstarts/centos6.ks
17.同步一下
01.
[root@node2 ~]
# cobbler sync
02.
task started: 2013-11-13_163907_sync
03.
task started (
id
=Sync,
time
=Wed Nov 13 16:39:07 2013)
04.
running pre-
sync
triggers
05.
cleaning trees
06.
removing: /var/www/cobbler/images/CentOS-6.4-x86_64
07.
removing: /var/lib/tftpboot/pxelinux.cfg/default
08.
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
09.
removing: /var/lib/tftpboot/grub/images
10.
removing: /var/lib/tftpboot/grub/efidefault
11.
removing: /var/lib/tftpboot/grub/grub-x86.efi
12.
removing: /var/lib/tftpboot/images/CentOS-6.4-x86_64
13.
removing: /var/lib/tftpboot/s390x/profile_list
14.
copying bootloaders
15.
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -&
gt
; /var/lib/tftpboot/grub/grub-x86_64.efi
16.
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -&
gt
; /var/lib/tftpboot/grub/grub-x86.efi
17.
copying distros to tftpboot
18.
copying files
for
distro: CentOS-6.4-x86_64
19.
trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/images/pxeboot/vmlinuz -&
gt
; /var/lib/tftpboot/images/CentOS-6.4-x86_64/vmlinuz
20.
trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/images/pxeboot/initrd.img -&
gt
; /var/lib/tftpboot/images/CentOS-6.4-x86_64/initrd.img
21.
copying images
22.
generating PXE configuration files
23.
generating PXE menu structure
24.
copying files
for
distro: CentOS-6.4-x86_64
25.
trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/images/pxeboot/vmlinuz -&
gt
; /var/www/cobbler/images/CentOS-6.4-x86_64/vmlinuz
26.
trying hardlink /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64/images/pxeboot/initrd.img -&
gt
; /var/www/cobbler/images/CentOS-6.4-x86_64/initrd.img
27.
Writing template files
for
CentOS-6.4-x86_64
28.
rendering DHCP files
29.
generating /etc/dhcp/dhcpd.conf
30.
rendering TFTPD files
31.
generating /etc/xinetd.d/tftp
32.
cleaning link caches
33.
running post-
sync
triggers
34.
running python triggers from /var/lib/cobbler/triggers/
sync
/post/*
35.
running python trigger cobbler.modules.sync_post_restart_services
36.
running: dhcpd -t -q
37.
received on stdout:
38.
received on stderr:
39.
running: service dhcpd restart
40.
received on stdout: 关闭 dhcpd:[确定]
41.
正在启动 dhcpd:[确定]
42.
received on stderr:
43.
running shell triggers from /var/lib/cobbler/triggers/
sync
/post/*
44.
running python triggers from /var/lib/cobbler/triggers/change/*
45.
running python trigger cobbler.modules.scm_track
46.
running shell triggers from /var/lib/cobbler/triggers/change/*
47.
*** TASK COMPLETE ***
18.新建客户端虚拟机
19.启动客户端并进行系统安装
(1).选择 “CentOS-6.4-x86_64”进行安装。
(2).选择后直接回车进行安装。
(3).开始安装初始化
(4).安装相关软件包
(5).软件包安装完成,大概过1分钟后进行重启
(6).重新启动虚拟机客户端
(8).进入登录界面
20.下面我们对客户端安装系统进行登录测试并查看
(1).输入用户名root与密码123456进行登录测试
(2).查看自定义的分区与时区
好了,到这里我们Linux运维自化工具之Cobbler工具就全部讲解完成了,最后希望大家有所收获吧!^_^……