本篇博文是使用cobbler的小工具来实现咱们的系统的自动安装,说这个工具小吧,其实它其中包含了不少的工具,固然了咱们须要使用epel源来实现咱们的安装,epel的源的修改地址在/etc/yum.repos.d/下,咱们能够把本身想配置的epel源或者本地仓库的修改文件放在这下面,经过yum clean all,yum makecache,yum repolist,来进行一系列操做。
linux
当咱们经过epel源安装以后,咱们能够打开咱们的这几个工具(dhcpd cobblerd httpd tftp)的开机启动,部分工具当即启动,由于dhcp须要配置,因此在配置好以前还不能使其启动,我使用的是centos7的系统,因此vim
systemctl enable dhcpd cobblerd httpd tftp //开机启动
systemctl start cobblerd httpd tftp //当即启动
检查cobbler换将,cobbler checkcentos
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 : 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.
4 : change ‘disable’ to ‘no’ in /etc/xinetd.d/rsync
5 : comment ‘dists’ on /etc/debmirror.conf for proper debian support
6 : comment ‘arches’ on /etc/debmirror.conf for proper debian support
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
解决方法:在文件/etc/cobbler/settings下修改这些内容,其中的密码我生成的是123
bash
vim /etc/cobbler/settings
default_password_crypted: "$1$9/k4QnLN$RpMDw8oILNAfkpOA2Qkth." #openssl passwd -1生成口令
next_server: 192.168.91.127
server: 192.168.91.127
manage_dhcp: 1
保存退出
systemctl restart cobblerd
获取相关的启动文件网络
联网:
cobbler get-loaders #联网状况下会自动获取这两个文件到指定目录
不联网:
cp /usr/share/syslinux/{pxelinux.0,menu.c32} /var/lib/tftpboot/
修改dhcp的配置文件
dom
vim /etc/cobbler/dhcp.template
subnet 192.168.91.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.91.100 192.168.91.254;
cobbler sync
systemctl start dhcpd #启动dhcp
管理distroide
cobbler import --path=/misc/cd/ --name=centos7.3
cobbler distro list
设置cobbler的各个属性
工具
cp /root/ks7.cfg /var/lib/cobbler/kickstarts/
cobbler profile add --name=centos7.3-x86_64-desktop --distro=centos7.3-x86_64 --kickstar
t=/var/lib/cobbler/kickstarts/ks7.cfg
cobbler profile list
cobbler profile remove --name=centos7.3-x86_64
而后咱们新建虚拟机,并在其网络上选择和试验机一个网段的仅主机模式,而后开机选择network boot from Inter E1000。
ui