PXE batch implementation of automated installation systems

Source: Internet
Author: User

First, Introduction

In the process of learning, most people use manual installation of the operating system, and in the actual production environment, the way to manually install the system is not realistic, because the server is numerous, so you can use the PXE (Preboot excute Environment) technology to install the operating system in bulk, thereby reducing the " AI ".

Second, the realization principle

Experimental topology diagram:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/C5/wKioL1gcLVyDbw-IAANhmlhcaoI859.png "title=" Pxe.png "alt=" Wkiol1gclvydbw-iaanhmlhcaoi859.png "/>


Principle: PXE installation is important to rely on the TFTP server, DHCP server, repo warehouse and its kickstart configuration file can be completed, when the system is installed, the customer service side host to the DHCP server to initiate a DHCP request, obtain an IP address will go to the TFTP server read Vmlinuz, Initrd.img load the virtual root, let tftp provide the boot file, at this time, if you need to automate the system installation also need to kickstart files to help complete the automated deployment installation.


Third, the realization step

1. Configure the DHCP server so that it can provide IP addresses for installed system hosts

vi/etc/dhcp/dhcpd.conf option Doamin-name "alren.com"; Option routes 192.168.184.130; #可选路由option domain-naem-servers 10.1.0.1; Default-lease-time 60000;    #最小租期max-lease-time 72000; #最大租期log-facility local7;subnet 192.168.184.0 netmask 255.255.255.0 {range 192.168.184.149 192.168.184.159 #IP地址分配范 Around filename "pxelinux.0"; #pxelinux. 0 Boot file Files next-server 192.168.184.130; #引导文件所在的服务器IP地址}

2, start the DHCP service at the customer service side using dhclient-d to detect whether the correct DHCP to obtain the IP address, and its listening port is normal

Systemctl start dhcpd systemctl enable DHCPD dhclient-d #查看是否能自动获取到IP地址 ss-tnl |grep 67|68 #是否监听了67, number 68th UDP port


3, build yum source, provide image and its kickstart file

Mkdir-pv/var/www/html/centos/7/x86_64mount/dev/cdrom/var/www/html/centos/7/x86_64 mkdir/var/ww/html/centos/ kickstarts/#此配置文件在图形化界面下使用system-config-kickstart Generation

     4, Install the configuration Tftp-server server and its boot configuration file to see if it starts UDP port 69th

yum -y install tftp tftp-server syslinux  cp /usr/share/syslinux/ PXELINUX.0 /VAR/LIB/TFTPBOOT/CP /VAR/WWW/HTML/CENTOS/7/X86_64/IMAGES/PXEBOOT/{VNLINZ,INITRD.IMG}  /var/lib/tftpboot/  cp /usr/share/syslinux/{chian.c32,menu.c32,medisk,mboot.c32} / Var/lib/tftpboot/   mkdir /var/lib/tftpboot/pxelinux.cfg   vi /var/lib /tftpboot/pxelinux.cfg/default  default menu.c32prompt 5 #5 seconds after the first boot program is started by default timeout  30 #30 seconds after timeout menu title centos 7 pxe menu   #菜单标题  label linuxmenu  LABEL Install CentOS 7 x86_64   #菜单标签   kernel vmlinuz # Kernel file append initrd=initrd.img  inst.repo=http://192.168.184.130/centos/7/x86_64 # Load Mirror path label linuxmenu label install centos 7 x86_64 auto   #菜单标签  KERNEL vmlinuzAPPEND initrd=initrd.img  inst.repo=http://192.168.184.130/centos/7/x86_64 ks=http://192.168.184.130/ Kickstarts/centos7.cfg


5, start the service, create a new virtual machine, test.

Systemctl Start httpd

Systemctl Start TFTPD

Systemctl Restart DHCPD

        


This article is from the "Small Ears" blog, please be sure to keep this source http://purify.blog.51cto.com/10572011/1869497

PXE batch implementation of automated installation systems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.