PXE Server Batch Deployment
1. Unattended automatic Installation
2. Make LVM Manage disk
3, after the installation of the automatic initialization configuration
Service 176.20.32.208ls
# Yum-config-manager--add-repo ftp://176.20.32.208/rhel6 genetic a Yum source
# echo ' gpgcheck=0 ' >>/etc/yum.repos.d/176.20.32.208_rhel6.repo
I. Configuring DHCP (Dynamic Host Configuration Protocol)
DHCP Port number UDP67/68
The client sends the DHCPDISCOVER broadcast message, the server responds to the DHCPOFFER message, and the client returns
DHCPRequest message, the last service sends a DHCPACK message acknowledgment.
# yum-y Install DHCP
# cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf
# vim/etc/dhcp/dhcpd.conf//import Template
Subnet 176.20.32.0 netmask 255.255.255.0 {//Declaration network Segment
Option routers 176.20.32.208; Gateway
Option Domain-name-servers 176.20.32.208; DNS server address
Range 176.20.32.101 176.20.32.200; Allocation of address pool ranges
Default-lease-time 86400; Minimum lease time
Max-lease-time 172800; Maximum lease time
Next-server 176.20.32.208; TFTP server address
FileName "pxelinux.0";//NIC Boot file name
}
# service DHCPD start//start DHCP
# vim/var/log/messages//error log
# VIM/ETC/SYSCONFIG/DHCPD
Dhcpdargs=eth0
Second, TFTP installation
UDP69
# yum-y Install Tftp-server
# cd/var/lib/tftpboot/
# mkdir Pxelinux.cfg
# cp/var/ftp/rhel6/isolinux/*/var/lib/tftpboot/
Copy all files under the RHEL6 CD Isolinux directory to/var/lib/tftpboot/
# CP Isolinux.cfg Pxelinux.cfg/default
# chmod 644 Pxelinux.cfg/default
# vim Pxelinux.cfg/default Add a menu item
Label rhel6.7//definition named rhel6.7r label
Menu Label ^install rhel6.7
Menu default
Kernel vmlinuz/Download the specified kernel and run
Append initrd=initrd.img ks=ftp://176.20.32.208/rhel6/rhel6.cfg repo=ftp://176.20.32.254/rhel6 ks.device=bootif// Download the specified initial file and run it, specifying the CFG file for unattended installation
# yum-y Install Syslinux
# RPM-QL Syslinux|grep Pxelinux
# Cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot
# Chkconfig TFTP on
# service xinetd start; Chkconfig xinetd on
# NESTAT-ULNP |grep:69
Third, configuration Kickstart
# yum-y Install VSFTPD
# yum Install-y System-config-kickstart
# System-config-kickstart//Generate an automatic installation script to save to/var/ftp/rhel6/rhel6.cfg
# vim/etc/ftp/rhel6/rhel6.cfg
Vim/var/ftp/rhel6/rhel6.cfg
echo 123456 |passwd--stdin Bob
Useradd-u Bob
echo 123456 |passwd--stdin Bob
Cat <<EOF>/etc/yum.repos.d/server.repo
[Server]
Name=server
Baseurl=ftp://176.20.32.208/rhel6
Enabled=1
Gpgcheck=0
Eof
Rpm-rf
rpm-rf/etc/yum.repos.d/centos*
Yum-y Install Vsftp
Yum-y Install FTP
Yum-y Install DHCP
%end
%packages
@base
@chinese-support
@performance
"/var/ftp/rhel6/rhel6.cfg" 65L, 1301C written
[Email protected] ~]# vim/var/ftp/rhel6/rhel6.cfg
%post
Useradd-u Bob
echo 123456 |passwd--stdin Bob
Cat <<EOF>/etc/yum.repos.d/server.repo
[Server]
Name=server
Baseurl=ftp://176.20.32.208/rhel6
Enabled=1
Gpgcheck=0
Eof
Rpm-rf
rpm-rf/etc/yum.repos.d/centos*
Yum-y Install Vsftp
Yum-y Install FTP
Yum-y Install DHCP
%end
%packages
@base
@chinese-support
"/var/ftp/rhel6/rhel6.cfg" 65L, 1301C 50,1 90%
Reboot
# System TimeZone
TimeZone Africa/abidjan
# System Bootloader Configuration
Bootloader--LOCATION=MBR
# Clear the Master Boot Record
Zerombr
# Partition Clearing Information
Clearpart--all--initlabel
# Disk Partitioning Information
Part/--fstype= "EXT4"--size=10000
Part/boot--fstype= "Ext4"--size=200
Part swap--fstype= "swap"--size=1024
%post
Useradd-u Bob
echo 123456 |passwd--stdin Bob
Cat <<EOF>/etc/yum.repos.d/server.repo
[Server]
Name=server
Baseurl=ftp://176.20.32.208/rhel6
Enabled=1
Gpgcheck=0
Eof
Rpm-rf
rpm-rf/etc/yum.repos.d/centos*
Yum-y Install Vsftp-server
Yum-y Install FTP
Yum-y Install DHCP
%end
%packages
@base
@chinese-support
@performance
@storage-client-multipath
%end
V. Provision of RHEL7 system installation
# cd/var/lib/tftpboot/
# mkdir Rhel7
Copy the relevant text from the RHEL7 CD directory to the TFTP server
# cp/var/ftp/rhel7/images/pxeboot/*/var/lib/tftpboot/rhel7
# Vim Pxelinux.cfg/default
Lable rhel7.0
Menu lable Install ^rhel7
Kernel Rhel7/vmlinuz
Append initrd=rhel7/initrd.img ks=ftp://176.20.32.208/rhel7/rhel7.cfg repo=ftp://176.20.32.208/rhel7 ks.device= Bootif
Note: The Rhel7 KS file needs to be generated on the RHEL7 system, generated and placed into the 176.20.32.208 FTP server directory under RHEL7, named Rhel7.cfg
# service VSFTPD start; Chkconfig vsftpd on
Iv. Testing
Create a virtual machine to connect to the PRIVATE1 network
PXE Linux installed (multi-system installation)