Redhat 7 Configuring Kickstart Automation to deploy multiple systems

Source: Internet
Author: User

Using Kickstart automation to deploy a variety of systems, I think of two scenarios, a suitable for daily operations, when the computer room on the shelves of individual new servers, according to different purposes, through a multi-system boot menu, enter the appropriate operating system name, you can automatically deploy the corresponding operating system. For example, I see a scenario like this on the Internet:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8C/18/wKioL1hiFh-R3STNAAJU7OQxVT8839.png "title=" 00.PNG "Width=" 423 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:423px;height:240px; "alt=" Wkiol1hifh-r3stnaaju7oqxvt8839.png "/>

But in the second scenario, the system integration project, if you want to install 50 units, 100 units at the same time, each one to enter, it is really painful. System integration projects often encounter a large number of servers, and different projects on the operating system needs of different situations, if the preparation of a kickstart is just to push an automated deployment of an operating system, eliminating the embarrassment of input, but also have the ability to automate the deployment of a variety of systems, as long as the changes, You can switch to push the other system, so you can flexibly adapt to different project requirements, this article is to introduce this scenario is the automated deployment. About Kickstart, PXE principle of the description of the web has a lot of information, no longer repeat, direct straightforward into the deployment configuration link.


First, the test environment

Host Name: Ksserver

Operating system: Red Hat Enterprise Linux Server Release 7.2 (MAIPO) Minimized installation

IP Address: 192.168.10.11

Installed services: DHCP service, TFTP service, PXE service, VSFTPD service, AutoFS service, Kickstart service

Firewall with SELinux: off

Prepared media: (1) Rhel-server-7.2-x86_64-dvd.iso, (2) Rhel-server-6.5-x86_64-dvd.iso

The original source of this article: Jiangjianrong Technical blog http://jiangjianlong.blog.51cto.com/3735273/1886610


Second, install the configuration DHCP service

1, [[email protected] ~] #yum install-y DHCP

2, [[email protected] ~] #systemctl start DHCPD

3, [[email protected] ~] #systemctl Enable DHCPD

4, [[email protected] ~] #cat/etc/dhcp/dhcpd.conf

# DHCP Server Configuration file.# see/usr/share/doc/dhcp*/dhcpd.conf.example# See dhcpd.conf (5) Man Pagedefault-leas E-time 600;max-lease-time 7200;ddns-update-style interim;ignore client-updates;allow booting;allow bootp;subnet 192.168.10.0 netmask 255.255.255.0 {option routers 192.168.10.254;option subnet-mask 255.255.255.0;range DYNAMIC-BOOTP 192.168.10.100 192.168.10.200;next-server 192.168.10.11;filename "pxelinux.0";}

5, [[email protected] ~] #systemctl Restart DHCPD


Third, installation configuration TFTP service and PXE service

1, [[email protected] ~] #yum install-y tftp-server syslinux

2, [[email protected] ~] #systemctl start TFTP

3, [[email protected] ~] #systemctl Enable TFTP

4, [[email protected] ~] #vi/etc/xinetd.d/tftp

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8C/14/wKioL1hhwrXTqoZCAABT5f4hPDc063.png "title=" Ftp04-1.png "alt=" Wkiol1hhwrxtqozcaabt5f4hpdc063.png "/>

5, [[email protected] ~] #cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot

6, [[email protected] ~] #mount/dev/cdrom/mnt

7, [[email protected] ~] #cp/mnt/image/pxeboot/initrd.img/var/lib/tftpboot

8, [[email protected] ~] #cp/mnt/image/pxeboot/vmlinuz/var/lib/tftpboot

9, [[email protected] ~] #cp/mnt/isolinux/*.msg/var/lib/tftpboot

10, [[email protected] ~] #mkdir/var/lib/tftpboot/pxelinux.cfg

11, [[email protected] ~] #cp/mnt/isolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default

12, [[email protected] ~]vi/var/lib/tftpboot/pxelinux.cfg/default

Default RH72 #控制默认从哪个label启动timeout #显示时间5秒

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8C/1D/wKiom1hiK97QaDghAABQaYCUnMI301.png "title=" Default01-1.png "alt=" Wkiom1hik97qadghaabqaycunmi301.png "/>

Iv. Installation of VSFTPD services

1, [[email protected] ~]yum-y install VSFTPD

2, [[email protected] ~]systemctl start VSFTPD

3, [[email protected] ~]systemctl enable VSFTPD


V. Installation and Configuration AutoFS service

1, [[email protected] ~]yum-y install AutoFS

2, [[email protected] ~]systemctl start AutoFS

3, [[email protected] ~]systemctl enable AutoFS

4, [[email protected] ~]mkdir/data

5, [[email protected] ~]ll/data

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8C/1A/wKiom1hiCYKBeMNQAABCYpalkTw029.png "title=" Autofs01. PNG "alt=" Wkiom1hicykbemnqaabcypalktw029.png "/>

6, [[email protected] ~]echo "/var/ftp/pub/etc/auto.ftp" >>/etc/auto.master

7, [Roo[email protected] ~]cat/etc/auto.ftp

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8C/17/wKioL1hiCgyDeJsUAAA8IVlJPqA835.png "title=" Autofs03. PNG "alt=" Wkiol1hicgydejsuaaa8ivljpqa835.png "/>

8, [[email protected] ~]df-ah

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8C/1A/wKiom1hiCl3AN6hXAAEm3C5gTGk541.png "title=" Autofs04-1.png "alt=" Wkiom1hicl3an6hxaaem3c5gtgk541.png "/>

V. Installation and Configuration Kickstart service

The original source of this article: Jiangjianrong Technical Blog http://jiangjianlong.blog.51cto.com/3735273/1886610

1, [[email protected] ~]yum-y install System-config-kickstart

2, prepare rh72_ks.cfg and rh65_ks.cfg, respectively for RedHat7.2 and Redhat6.5 automated deployment, placed in the root directory of FTP, to ensure access through FTP, where rh72_ks.cfg content is as follows:

[Email protected] ~]vi/var/ftp/rh72_ks.cfg

# kickstart file automatically generated by anaconda.   #version =devel#  Install OS instead of upgradeinstall  #key  --skip# use network  installationurl --url= "ftp://192.168.10.11/pub/RH72" #use  graphical installgraphicallang  en_us. utf-8keyboard ustimezone --utc asia/shanghai#network informatonnetwork --onboot  yes --device eth0 --bootproto dhcp --noipv6# root passwordrootpw [ email protected]# firewall configurationfirewall --disabled#selinux  configurationselinux --disabled# system authorization informationauthconfig -- enableshadow --passalgo=sha512# system bootloader configurationbootloader --location= mbr # the following is the partition information you requested#  note that any&nbsP;partitions you deleted are not expressed# here so unless you  clear all partitions first, this is# not guaranteed to work #clearpart  --nonefirstboot --disablelogging --level=info# Clear the Master  boot recordzerombr#clear all partionclearpart --all --initlabel# disk  partitioning informationpart /boot --fstype=ext4 --size=200part swap --size=1024 #part  / --fstype=ext4 --grow --size=20000part pv.01 --size 20480 -- growvolgroup vg01 pv.01logvol / --fstype=ext4 --vgname=vg01 --size=10240 -- name=lv_rootlogvol /var --fstype=ext4 --vgname=vg01 --size=10000 --name=lv_varreboot% Packages --nobase@core%end


VI. Test Automation Deployment Redhat 7.2

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8C/1B/wKiom1hiDZ7BVrBfAAAOINGg3XE459.png "style=" float: none; "Title=" client02. PNG "alt=" Wkiom1hidz7bvrbfaaaoingg3xe459.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8C/17/wKioL1hiDZ_w22ZPAAKIjlc4xGc629.png "style=" width : 730px;height:456px; "title=" Client03-1.png "alt=" Wkiol1hidz_w22zpaakijlc4xgc629.png "width=" 730 "height=" 456 " Border= "0" hspace= "0" vspace= "0"/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8C/17/wKioL1hiDajR2uwqAANcnFePcGY965.png "style=" width : 730px;height:442px; "title=" Client05-1.png "alt=" Wkiol1hidajr2uwqaancnfepcgy965.png "width=" 730 "height=" 442 " Border= "0" hspace= "0" vspace= "0"/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8C/1B/wKiom1hiDajyTPSnAABZC1vFAn4275.png "style=" width : 730px;height:412px; "title=" client06. PNG "alt=" Wkiom1hidajytpsnaabzc1vfan4275.png "width=" 730 "height=" 412 "border=" 0 "hspace=" 0 "vspace=" 0 "/>


VII. Test Automation Deployment Redhat 6.5

The original source of this article: Jiangjianrong Technical Blog http://jiangjianlong.blog.51cto.com/3735273/1886610

Currently we configure the Kickstart to provide only RedHat7.2 automated deployment, but from the above can also be seen I have to provide redhat 6.5 of the relevant preparation, how to use it? In fact, it is very simple, as long as a slight change, you can become the provision of Redhat 6.5 automated deployment. The following changes are in place:

1, modify the default file, the first line of the default RH72 to default RH65, so that the default is to start from the label RH65 of the defaults file, it is the default to provide Redhat 6.5 of the automated deployment.

[Email protected] ~]vi/var/lib/tftpboot/pxelinux.cfg/default

Default RH65

2, but at this time to boot the boot file or Redhat7.2, must be the original Tftpboot directory for Redhat7.2 files to move away, copy files for RedHat6.5 to come in

[Email protected] ~]mv/var/lib/tftpboot/*/var/lib/rh72

[Email protected] ~]cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot

[Email protected] ~]cp/var/ftp/pub/rh65/image/pxeboot/initrd.img/var/lib/tftpboot

[Email protected] ~]cp/var/ftp/pub/rh65/image/pxeboot/vmlinuz/var/lib/tftpboot

[Email protected] ~]cp/var/ftp/pub/rh65/isolinux/*.msg/var/lib/tftpboot

[Email protected] ~]cp-r/var/lib/rh72/pxelinux.cfg/var/lib/tftpboot

3, test, successfully automated deployment Redhat 6.5

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8C/1B/wKiom1hiE5ixoos6AAAiyirlnrY122.png "style=" float: none; "title=" Client07.png "alt=" Wkiom1hie5ixoos6aaaiyirlnry122.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8C/1B/wKiom1hiE6ChS0DtAAMLeY9Io88801.png "style=" width : 730px;height:440px; "title=" Client08-1.png "width=" 730 "height=" to "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1hie6chs0dtaamley9io88801.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8C/18/wKioL1hiE6OzWPgfAAAhiD0KPWM285.png "style=" float: none; "title=" Client09.png "alt=" Wkiol1hie6ozwpgfaaahid0kpwm285.png "/>

4, later if you want to switch to Automatic deployment Redhat7.2, then the first line of the default file is modified to default RH72, as long as two commands to RH65 boot file transfer away, the RH72 transfer in, it is done.

[Email protected] ~]mv/var/lib/tftpboot/*/var/lib/rh65/

[Email protected] ~]mv/var/lib/rh72/*/var/lib/tftpboot/

This article is from the "Jiangjianrong Technology blog" blog, make sure to keep this source http://jiangjianlong.blog.51cto.com/3735273/1886610

Redhat 7 Configuring Kickstart Automation to deploy multiple 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.