Automatic Operation and Maintenance-PXE Implementation of Automatic Installation System

Keywords: Linux CentOS yum Anaconda network

Introduction to PXE

Preboot Excution Environment Preboot Execution Environment
 Based on Client/Server network mode, it supports remote hosts to download images from remote servers through the network, and thus supports the installation of operating systems through the network.
PXE can boot and install Windows,Linux and other operating systems. Here, only PXE is used to realize the automatic installation of centos system.

2. Pre-operation preparation: Turn off dhcp service of vmware only in host mode

III. Operational steps

1. install HTTP

yum install httpd
systemctl enable httpd
system start httpd


2. Add CD-ROM to mount the mirror file of centos6 and refresh it with command

echo '- - -' > /sys/class/scsi_host/host0/scan  //If not refreshed, you can change host0 to host1, host2 try again




3. Preparing KS files

cp /root/anaconda-ks.cfg /var/www/html/ksdir/miniks7.cfg  //Copy/root/anaconda-ks.cfg as template file on the installed centos7 host and make KS file of centos7 after modification.
vim  /var/www/html/ksdir/miniks7.cfg


cp /root/anaconda-ks.cfg  /var/www/html/ksdir/miniks6.cfg  //Copy/root/anaconda-ks.cfg as template file on the installed centos6 host and make KS file of centos6 after modification.
vim  /var/www/html/ksdir/miniks6.cfg



4. Install the TFTP service (place the files to be used later in its generated / var/lib/tftpboot / directory for sharing)

yum install tftp-server
systemctl start tftp
systemctl enable tftp

5. Installing DHCP Service

yum install dhcp

cp  /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example   /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf   //Configuring dhcp services


systemctl start dhcpd  //Startup service
systemctl enable dhcpd  //Set it as boot-up start-up

6. Prepare startup files

yum install syslinux  //Install the syslinux package
cp /usr/share/syslinux/pxelinux.0  /var/lib/tftpboot //Copy startup file
cp /usr/share/syslinux/menu.c32    /var/lib/tftpboot  //Copy Start Menu Format
cp /var/www/html/centos/7/isolinux/vmlinuz  /var/lib/tftpboot/kernel7  //Copy the centos7 kernel (centos6 does the same)
cp/var/www/html/centos/7/isolinux/initrd.img  /var/lib/tftpboot/kernel7  //Copy the centos7 process startup entry (centos6 does the same)
mkdir /var/lib/tftpboot/pxelinux.cfg/    
cp /var/www/html/centos/7/isolinux/isolinux.cfg  /var/lib/tftpboot/pxelinux.cfg/default  //Copy the default menu boot file into the newly created / var/lib/tftpboot/pxelinux.cfg folder
tree /var/lib/tftpboot/  // View the files needed for automatic startup


7. Prepare to start menu files


8. Create a new virtual machine and start installation

9. The shortcut key M is to install centos7 and n is to install centos6.

Posted by run_GMoney on Sat, 20 Apr 2019 23:06:33 -0700