四.修改dhcp配置
# vim /etc/cobbler/dhcp.template --在此文件的第21行到第25行修改成你对应的网段和ip
subnet 192.168.100.0 netmask 255.255.255.0 {
option routers 192.168.100.221;
option domain-name-servers 192.168.100.221;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.100.100 192.168.100.254;
--图形的操作过程这里省略后续还有这一步 重要
# vim /etc/cobbler/settings --再去修改这个配置文件,改成dhcp服务由cobbler来管理
242 manage_dhcp: 1 --把0改为1
# systemctl restart cobblerd.service --保存后,再重启此服务
五.使用cobbler sync同步,并启动xinetd服务
下面的cobbler sync 很重要,如果这步报错一定要排出来,就经验来说这步出错一般是IP配置出错,记得细心一点,个体差异不用就不详细表述~
# cobbler sync
[root@bokeyuan ~]# cobbler sync
task started: 2017-09-03_180107_sync
task started (id=Sync, time=Sun Sep 3 18:01:07 2017)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/centos7.3-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/images/centos7.3-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /usr/share/syslinux/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /usr/share/syslinux/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
copying distros to tftpboot
copying files for distro: centos7.3-x86_64
trying hardlink /var/www/cobbler/ks_mirror/centos7.3/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/centos7.3-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/centos7.3/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/centos7.3-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: centos7.3-x86_64
trying hardlink /var/www/cobbler/ks_mirror/centos7.3/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos7.3-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/centos7.3/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos7.3-x86_64/initrd.img
Writing template files for centos7.3-x86_64
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: centos7.3-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
# systemctl restart xinetd.service
# systemctl enable xinetd.service
六.新建另一个虚拟机 选择网络安装PXE (保证相同私有网络,并且最好2G内存,内存小的话会在安装时报空间不够的错误),进行安装测试
安装完成后,更改boot引导