本篇博文是使用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
一、2解決方法: 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 保存退出 3.解決方法: 聯網: cobbler get-loaders #聯網狀況下會自動獲取這兩個文件到指定目錄 不聯網: cp /usr/share/syslinux/{pxelinux.0,menu.c32} /var/lib/tftpboot/ 4.第四個的解決就很容易了,很明顯是到/etc/xinetd.d/rsync中的disable改成no systemctl restart cobblerd
修改dhcp的配置文件
網絡
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
管理distrodom
cobbler import --path=/misc/cd/ --name=centos7.3 cobbler distro list
設置cobbler的各個屬性
ide
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。
工具