Dhcp+http+kickstart the automation CD to start the deployment server

Source: Internet
Author: User

Automated CD-ROM start deployment server


This is a virtual machine before the actual deployment of the test, fully available for the actual deployment work, the completion of a self-made bootable CD and a Linux system can be installed with HTTP and DHCP service server automation installation operating system.

Virtual environments:

Operating system Rhel-server-5.4-x86 ip:192.168.1.3

The system that the client needs to install: rhel-server-5.4-x86

NOTICE: Network Automation installs the operating system and requires the client to support network card startup and PXE functionality.


Implementation steps:


First, configure the DHCP server:


1) Install the DHCP server

[[Email protected] ~] #yum install-y dhcp*

2) Edit the DHCP server configuration file/etc/dhcp/dhcpd.conf

Because the purpose is to install the operating system instead of as a dedicated DHCP server, you only need to configure a few simple parameters

Ddns-update-style Interim;

Allow booting;
Allow BOOTP;
Ignore client-updates;
Set vendorclass = option Vendor-class-identifier;
Subnet 192.168.1.0 netmask 255.255.255.0 {
Option routers 192.168.1.1;
# option Domain-name "ns.rrl.com";
# option Domain-name-servers 192.168.1.1;
Option Subnet-mask 255.255.255.0;
Range DYNAMIC-BOOTP 192.168.1.100 192.168.1.199;
FileName "/pxelinux.0";
Default-lease-time 21600;
Max-lease-time 43200;
Next-server 192.168.1.3;
}

Brief introduction:
Option routers specifies the gateway;
Option domain-name-server specifies a DNS server;
Option subnet-mask Specifies the mask;
Range DYNAMIC-BOOTP Specifies the IP address segment assigned to the client;
FILENAME specifies the boot image;
NEXT-SERVER specifies the TFTP server.

Comment out the DNS configuration because the specified DNS server is required for resolution when installing certain versions of the Red Hat system, resulting in an automated installation failure.


3) Start the DHCP service


[[Email protected] ~] #service dhcpd Start

[[Email protected] ~] #chkconfig--add dhcpd #设置dhcp服务开机自动启动

4) View the assigned DHCP address

[[Email protected] ~] #cat/var/lib/dhcp/dhcpd.leaseslease 192.168.1.199 {starts 4 2016/12/08 08:13:17;  Ends 4 2016/12/08 14:13:17;  binding state active;  Next binding State free;  Hardware Ethernet 00:50:56:9C:7B:A5; Client-hostname "Jacktest";}


Second, configure the Web server


1) Install HTTPD server

[Email protected]~] #yum install–y httpd*

2) Configure the Web server

The location of the HTTPD Server Web page files installed through Yum is located in the/var/www/html directory. We create a mount directory of rhel5.4 images in this directory. Then re-mount the image to this directory.

[Email protected]~] #mkdir/var/www/html/rhel5.4[[email protected]~] #umount/media/iso [[email protected]~] #mount –o Loop,ro rhel-server-5.4-i386-dvd.iso/var/www/html/rhel5.4

3) Start httpd server

[Email protected]~] #service httpd start [[email protected]~] #chkconfig--add httpd #设置httpd服务开机自动启动

At this stage we can also use NFS or FTP deployment, the configuration process is also very simple. You only need to execute a few commands and modify the configuration options that are pointed to in the corresponding kickstart file to specify the installation tree. In the following kickstart file I will give the NFS and FTP point configuration, you can refer to.


Third, configuration Kickstart file

Three ways to create a kickstart file


1.1.system-config-kickstart mode: This requires us to install the Syste-config-kickstart software package in advance, using Yum installation. Then use this software to customize our kickstart file;


[email protected] ~]# Yum install system-config-kickstart.noarch

[[email protected] ~]# ksvalidator/root/anaconda-ks.cfg # Check for file errors

[Email protected] ~]# Timeconfig
[[email protected] ~]# System-config-kickstart & # graphical build /root/class.cfg file


1.2 Copy/root/anaconda-ks.cfg file mode:

Due to the Red Hat operating system, after the installation is complete, a anaconda-ks.cfg file is automatically created in the root directory, which truly records the configuration of the system during installation. We can copy this file and then configure it based on it.


[[email protected] ~]# Mount/dev/cdrom/media # mount the installation CD to/media

[Email protected] images]# ls/media/images
README TRANS. TBL boot.iso diskboot.img minstg2.img pxeboot stage2.img Xen
[Email protected] images]# cp/media/images/boot.iso/root/
[Email protected] ~]# ls/root/
Boot.iso

[Email protected] ~]# Mount-o loop boot.iso/mnt/cdrom/ # mount the file to/mnt/cdrom/
[Email protected] ~]# cd/mnt/cdrom/
[[email protected] cdrom]# ls
TRANS. TBL Isolinux
[Email protected] isolinux]# ls/mnt/cdrom/isolinux/
TRANS. TBL boot.msg initrd.img isolinux.cfg options.msg rescue.msg vmlinuz
Boot.cat general.msg isolinux.bin memtest param.msg SPLASH.LSS

[[Email protected] ~]# mv class.cfg ks.cfg # changed ks.cfg file as Attachment


[Email protected] tmp]# mkdir ISO
[Email protected] tmp]# CD iso/
[[email protected] iso]# cp/mnt/cdrom/*./-R # to copy the/mnt/cdrom content into the current directory
[[email protected] iso]# ls
TRANS. TBL Isolinux
[Email protected] iso]# CD isolinux/
[[email protected] isolinux]# ls
TRANS. TBL boot.msg initrd.img isolinux.cfg options.msg rescue.msg vmlinuz
Boot.cat general.msg isolinux.bin memtest param.msg SPLASH.LSS


[Email protected] iso]# cp/root/class.cfg./ks.cfg
[[email protected] iso]# ls
TRANS. TBL Isolinux ks.cfg

[Email protected] iso]# chmod +r/root/ks.cfg

[Email protected] iso]# ll/root/ks.cfg

-rw-r--r--1 root root 2064 Dec 7 09:51/root/ks.cfg
[Email protected] isolinux]# vim isolinux.cfg

Default Linux ks=cdrom:/ks.cfg #红色为新增部分, which indicates that the disc is booting


[[email protected] isolinux]# vi/tmp/iso/isolinux/boot.msg # edit this file to show as

^l
^xsplash.lss

-To install or upgrade in graphical mode, press the ^O01<ENTER>^O07 key.
Xxx
-To install or upgrade in text mode, type: ^o01linux text <enter>^o07.
Xxx
-Use the function keys listed below for more information.
Xxx
^o0f[f1-main] [f2-options] [f3-general] [F4-kernel] [f5-rescue]^o07

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8B/4A/wKioL1hJFviigON5AAL1wzWjN7s521.png-wh_500x0-wm_3 -wmp_4-s_103818842.png "style=" Float:none; "title=" Autosetup2.png "alt=" Wkiol1hjfviigon5aal1wzwjn7s521.png-wh_50 " />

[[email protected] isolinux]# ls
TRANS. TBL boot.msg initrd.img isolinux.cfg options.msg rescue.msg vmlinuz
Boot.cat general.msg isolinux.bin memtest param.msg SPLASH.LSS

[Email protected] ~]# Vi/tftpboot/pxelinux.cfg/default
Default Linux
Prompt 1
Timeout # Red part is changed

...

Append initrd=initrd.img text # because of the use of CD access, this does not change

# If this file accesses the red part via HTTP, change to: ks=http://192.168.1.3/ks.cfg


[[email protected] isolinux]# cd/tmp # Switch to a non-ISO directory
[Email protected] tmp]#mkisofs -r-b isolinux/isolinux.bin-no-emul-boot-boot-load-size 4- Boot-info-table-o Boot.iso iso/


650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/4D/wKiom1hJFv3gMdQwAAAjF5i-AQw554.png-wh_500x0-wm_3 -wmp_4-s_2513173874.png "style=" Float:none; "title=" Autosetup4.png "alt=" wkiom1hjfv3gmdqwaaajf5i-aqw554.png-wh_50 "/>

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8B/4A/wKioL1hJFvmARA4NAACnwwQfe40351.png-wh_500x0-wm_3 -wmp_4-s_2344212822.png "style=" Float:none; "title=" Autosetup3.png "alt=" wkiol1hjfvmara4naacnwwqfe40351.png-wh_50 "/>


1.3. Document KS.CFG Pure Handmade way, is the use of text tools (such as: VI) directly edit configuration;


[Email protected] iso]# cat ks.cfg
# Kickstart file automatically generated by Anaconda.
#version =devel
Install
#nfs--server=192.168.1.3--dir=/media/cdrom
#url--url=ftp://root:[email protected]/var/ftp

URL--url=ftp://192.168.1.3/rhel5.4
Lang en_US
Langsupport--default en_US en_US
Keyboard US
Text
Key–skip
Network–bootproto=dhcp--device=eth0--onboot=on
ROOTPW Root
# Reboot after installation
Reboot
Firewall--disabled
Authconfig--useshadow--passalgo=sha512
SELinux--disabled
TimeZone Asia/shanghai
Bootloader--LOCATION=MBR--DRIVEORDER=SDA

# The following is the partition information you requested
# Note that any partitions deleted is not expressed
# unless you clear all partitions first
# Guaranteed to work

Clearpart--all--initlabel

#part/boot--fstype=ext4--size=500
#part Swap--size=2048
#part/--FSTYPE=EXT4--grow--size=2 #--grow indicates that all remaining space is allocated to this

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/4A/wKioL1hJFUrx2KdFAAEPKNArN6E631.png-wh_500x0-wm_3 -wmp_4-s_1163300925.png "title=" Autosetup5.png "alt=" Wkiol1hjfurx2kdfaaepknarn6e631.png-wh_50 "/>

Part/boot--bytes-per-inode=4096--fstype= "ext3"--size=1024
Part/home--bytes-per-inode=4096--fstype= "ext3"--size=4096
Part/tmp--bytes-per-inode=4096--fstype= "ext3"--size=4096
PART/USR--bytes-per-inode=4096--fstype= "ext3"--size=4096
Part swap--bytes-per-inode=4096--fstype= "swap"--size=2048
Part/--bytes-per-inode=4096--fstype= "ext3"--grow--size=1


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/4D/wKiom1hJE2KSQYruAADebTJf1jg327.png-wh_500x0-wm_3 -wmp_4-s_2600767859.png "title=" Autosetup1.png "alt=" Wkiom1hje2ksqyruaadebtjf1jg327.png-wh_50 "/>


# X Window System configuration information
Xconfig--defaultdesktop=gnome--depth=16--resolution=1024x768--startxonboot

%packages
@Base
@Core
@base
@client-mgmt-tools
@debugging
@emacs
@ftp-server
@hardware-monitoring
@large-systems
@network-file-system-client
OpenSSH
Openssh-server
Openssh-clients
vim-enhanced
Firefox
Mutt
Screen

NOTICE: Red Hat 5 Series and Red Hat 6 series Kickstart file a little different, in the Red Hat 5 series if there is%end option, in the installation process will be an error, Red Hat 6.0 after the System support this option. the highest supported ext3 file system for the Red Hat 5 series, The Red Hat 6 series has the highest support for EXT4 file systems, so the kickstart file is modified according to the version of the system.

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8B/4D/wKiom1hJFqSjF21xAAFNVyoA0KI782.png-wh_500x0-wm_3 -wmp_4-s_3565127325.png "title=" Autosetup6.png "alt=" Wkiom1hjfqsjf21xaafnvyoa0ki782.png-wh_50 "/>


---end---

Dhcp+http+kickstart the automation CD to start the deployment server

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.