I. Introduction of Cobbler
Cobbler is a Linux server-installed service that allows you to quickly install, reinstall, and manage Dhcp,dns, as well as the physical server and virtual machines through a network boot (PXE)
1. Main functions:
①cobbler can be managed using the command line, also provides a web-based interface management tool (Cobbler-web), and also provides API interface for easy two development use
②cobbler is an upgraded version of the earlier kickstart, the advantage is relatively easy to configure, but also comes with the Web interface easier to manage
③cobbler has built-in a lightweight configuration management system, but it also supports integration with other configuration management systems, such as puppet, and temporarily does not support Saltstack
2, cobbler can manage the service
PXE Service Support
DHCP Service Management
DNS service Management (optional BIND,DNSMASQ)
Power Management
Kickstart Service Support
Yum Warehouse Management
TFTP (required at PXE boot)
Apache (provides a kickstart installation source and provides a customized kickstart configuration)
Second, cobbler deployment configuration
1. Environment
[[email protected] ~]# cat/etc/redhat-release CentOS release 6.9 (Final) [[email protected] ~]# uname-< Span style= "COLOR: #000000" >r 2.6 . 32 -696 ~]#/etc/init.d/iptables statusiptables: Firewall is not running.[ [Email protected] ~]# getenforce disabled[[email protected] ~]# hostname-i 10.0 . 0.121 172.16 . 1.121
2, Installation Cobbler
CentOS6 installs yum localinstall Django14-1.4. 1. el6.noarch.rpm-y install cobbler cobbler-web dhcp tftp-server Pykickstart httpd# Description: The yum source has removed the Diango download source CentOS7 Installation - y install cobbler cobbler-web dhcp Tftp-server pykickstart httpd
3. Start Cobbler Service
[Email protected] ~]#/etc/init.d/httpd restartstopping httpd: [ OK ]starting httpd: [ OK ~]#/etc/init.d/cobblerd startstarting Cobbler daemon: [ OK ]
4. Check Cobbler Configuration
[email protected] tools]# Cobbler checkthe Following is potential configuration items that you may want to FIX:1: the'Server'Fieldinch/etc/cobbler/settings must beSetTo something other than localhost, or kickstarting features won't work. This should is a resolvable hostname or IP forThe boot server asReachable by any machines that would use it.2: For PXE to be functional, the'Next_server'Fieldinch/etc/cobbler/settings must beSetTo something other than127.0.0.1, and should match the IP of the boot server on the PXE network.3: Change'Disable'To'No' inch/etc/xinetd.d/TFTP4: Some network boot-loaders is missing from/var/lib/cobbler/loaders, May run'Cobbler Get-loaders'To download them, or,ifYou are want to handle x86/x86_64 netbooting and you may ensure so you have installed a *recent* version of the syslinux p Ackage installed and can ignore ThisMessage entirely. Filesinch Thisdirectory, should want to support all architectures, should include Pxelinux.0, Menu.c32, Elilo.efi, and Yaboot. The'Cobbler Get-loaders'Command isThe easiest to resolve these requirements.5: Change'Disable'To'No' inch/etc/xinetd.d/rsync6: file/etc/xinetd.d/rsync does not exist7: Debmirror Package isNot installed, it'll be required to manage Debian deployments and repositories8: thedefaultPassword used by the sample templates forNewly Installed machines (default_password_cryptedinch/etc/cobbler/settings) isStillSetTo'Cobbler'And should be changed,Try:"OpenSSL passwd-1-salt ' random-phrase-here ' Your-password-here '"To generateNew One9: Fencing tools were not found, and is required to use the (optional) power management features. Install Cman or fence-agents to use Themrestart cobblerd and then run'Cobbler Sync'To apply changes. #只需一步一步解决上面出现的问题即可, and then restart Cobbler
5, solve cobbler problem
cp/etc/cobbler/ Settings{,.bak} #备份Cobbler主配置文件sed-I.'s/server:127.0.0.1/server:172.16.1.121/'/etc/cobbler/Settings sed-I.'s/next_server:127.0.0.1/next_server:172.16.1.121/'/etc/cobbler/settingssed-I.'s/manage_dhcp:0/manage_dhcp:1/'/etc/cobbler/settings #使用cobbler管理dhcpsed-I.'s/pxe_just_once:0/pxe_just_once:1/'/etc/cobbler/settings #防止有些机子第一启动是pxe循环重装系统, set here to only once sed-ri"/default_password_crypted/s# (. *:). *#\1\ "' OpenSSL passwd-1-salt ' cobbler ' 123456 ' \ ' #"/etc/cobbler/settings #设置系统的默认密码为123456sed-I.'s#yes#no#'/etc/xinetd.d/rsyncsed-I.'s#yes#no#'/etc/xinetd.d/tftp
6. Configuring the Cobbler DHCP template
Sed-i's#192.168.1#172.16.1#g;22d;23d'/etc/cobbler/dhcp.template#修改过后内容如下:... subnet172.16.1.0Netmask255.255.255.0{option Subnet-mask255.255.255.0; RangeDynamic-bootp172.16.1.100 172.16.1.254; default-lease-time21600; Max-lease-time43200; Next-server $next _server, ..... [Email protected] tools]#/etc/init.d/xinetd restartstopping xinetd: [OK]starting xinetd: [OK] [Email protected] tools]#/etc/init.d/cobblerd restartstopping Cobbler daemon: [OK]starting Cobbler Daemon: [OK] [Email protected] tools]#/etc/init.d/httpd restartstopping httpd: [OK]starting httpd: [OK]
7. Synchronous Cobbler Configuration
[email protected] tools]# Cobbler Synctask started: .- One-07_145244_synctask started (ID=sync, Time=tue Nov7 -: the: - .) running pre-sync triggerscleaning treesremoving:/var/lib/tftpboot/pxelinux.cfg/defaultRemoving:/var/lib/tftpboot/grub/efidefaultremoving:/var/lib/tftpboot/grub/imagesremoving:/var/lib/tftpboot/s390x/profile_listcopying bootloaderscopying distros to tftpbootcopying imagesgenerating PXE configuration Files# Check Cobbler again[[email protected] tools]# Cobbler checkthe Following is potential configuration items that you may want To fix:1: Some network boot-loaders is missing from/var/lib/cobbler/loaders, May run'Cobbler Get-loaders'To download them, or,ifYou are want to handle x86/x86_64 netbooting and you may ensure so you have installed a *recent* version of the syslinux p Ackage installed and can ignore ThisMessage entirely. Filesinch Thisdirectory, should want to support all architectures, should include Pxelinux.0, Menu.c32, Elilo.efi, and Yaboot. The'Cobbler Get-loaders'Command isThe easiest to resolve these requirements.2: Debmirror Package isNot installed, it'll be required to manage Debian deployments and repositories3: Fencing tools were not found, and is required to use the (optional) power management features. Install Cman or fence-agents to use Themrestart cobblerd and then run'Cobbler Sync'To apply changes.#问题解决完毕
8. Open Browser input at this time
Third, the use of Cobbler Web page to implement automated installation system
1. Import image
[Email protected] ~]# mount/dev/cdrom/mnt/Mount:block Device/dev/sr0 iswrite-protected, mounting read-Only[[email protected]~]# DF-hfilesystem Size used Avail use%mounted on/dev/sda2 19G1.6G 16G9% /Tmpfs 931M0931M0%/dev/SHM/DEV/SDA1 190M 35M 146M +% /Boot/dev/sr03.7G3.7G0 -%/mnt
Importing mirrors via Rsync
[Email protected] ~]# ps-ef|grep rsyncroot 2087 1599 ? 00:00:05 rsync-a/mnt//var/www/cobbler/ks_mirror/centos6.9-x86_64--progressroot 2088 2087 0 16:57? 00:00:00 rsync-a/mnt//var/www/cobbler/ks_mirror/centos6.9-x86_64--progressroot 2089 2088 00:00:03 rsync-a/mnt//var/www/cobbler/ks_mirror/centos6.9-x86_64--progressroot 2106 1256 0 16:58 PTS/1 00:00:00 grep rsync
After the import is complete
2. Create KS file
3. Customized System
Fixed IP address based on MAC address of machine
Eth1
Eth0
Save
4. New Blank virtual machine test
Take a break and come back for a moment. View Results
Linux operation and Architecture-cobbler unattended