Automated O & M tool Kickstart

Source: Internet
Author: User

Automated O & M tool Kickstart


Introduction:

Kickstart and RedHat, the tool for installing Operating Systems in batches, were launched earlier (not to mention, now Cobbler ).

Test environment: CentOS 6.6 x86_64 minimal

1. install the software package

shell > yum -y install dhcp tftp-server syslinux nfs-utils kickstart

Ii. Configure DHCP

Shell> cp/usr/share/doc/dhcp-4.1.1/dhcpd. conf. sample/etc/dhcp/dhcpd. confcp: overwrite "/etc/dhcp/dhcpd. conf "? Yshell> vim/etc/dhcp/dhcpd. conf # dhcpd. conf # option definitions common to all supported networks... option domain-name-servers 192.168.214.2, 202.106.46.151; # A slightly different configuration for an internal subnet. subnet 192.168.214.0 netmask 255.255.255.0 {range 192.168.214.100 192.168.214.120; option routers 192.168.214.2; option subnet-mask 255.255.255.0; filename "/expiration"; default-lease-time 600; max-lease-time 7200 ;}

3. Configure tftp

Shell> vim/etc/xinetd. d/tftpservice tftp {socket_type = dgramprotocol = udpwait = yesuser = rootserver =/usr/sbin/in. tftpdserver_args =-s/var/lib/tftpbootdisable = no # originally yesper_source = 11cps = 100 2 flags = IPv4}

Iv. pxelinux.0

shell > cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/shell > mount /dev/cdrom /mnt/shell > cp /mnt/isolinux/* /var/lib/tftpboot/shell > cd /var/lib/tftpboot/shell > mkdir pxelinux.cfgshell > mv isolinux.cfg pxelinux.cfg/default

5. Configure NFS

shell > vim /etc/exports/mnt 192.168.0.0/24(ro,sync)

Vi. Final adjustments

Shell> chkconfig -- add nfsshell> chkconfig -- add dhcpdshell> chkconfig -- add plugin> chkconfig -- add rpcbindshell> chkconfig -- level 35 nfs onshell> chkconfig -- level 35 dhcpd onshell> chkconfig -- level 35 xinetd onshell> chkconfig -- level 35 rpcbind onshell> exportfs-arshell> service dhcpd restart disable dhcpd: [OK] Starting dhcpd: [OK] shell> service xinetd restart stop xinetd: [OK] Starting xinetd: [OK] shell> service rpcbind restart stop rpcbind: [OK] Starting rpcbind: [OK] shell> service nfs restart close NFS daemon: [OK] disable NFS mountd: [OK] disable NFS service: [OK] Shutting down RPC idmapd: [OK] Start NFS service: [OK] Start NFS mountd: [OK] Start NFS daemon: [OK] start RPC idmapd: [OK] shell> setenforce 0 shell> service iptables stop

VII. Test PXE Pilot installation

1. Set the client to boot from the Network (in fact, you do not need to set it. If you cannot find it locally, you will naturally go to the network to find it). Then you can see the installation interface.

2. Select a language (Chinese Simplified)

3. OK

4. Select the keyboard (us) OK.

5. Select the media location (NFS Directory) OK

6. Configure the network (by default) OK

7. Set NFS service (NFS server name: 192.168.214.10 # NFS server address
CentOS directroy:/mnt # ISO storage location) OK

8. A normal installation interface is displayed here, proving that there is no problem (just like installing the CD)

# This is the PXE Pilot installation, and Kickstart must be configured for unattended intervention!

8. Install the desktop environment

# The following operations are directly performed in a virtual machine, not a terminal connection! (Not necessary)

shell > yum grouplist | grep -iP "(x window system|desktop)"DesktopX Winsow System

# We need to install these two packages.

Shell> yum update # first update yumshell> yum-y groupinstall "X Window System" shell> yum-y groupinstall "Desktop" shell> yum-y groupinstall "Chinese Support" # installation of Chinese support for shell> init 5

# Now the desktop environment is ready

1. Set the font (not required)

# When you open the terminal, the default font is hard to see, and there are spaces in the middle, which cannot be tolerated by Virgo!

System -- preference -- appearance -- font -- (change the same width to ar pl UKai CN) -- OK.

2. install the software package system-config-kickstart.

Shell> yum-y install system-config-kickstartshell> system-config-kickstart # Start the Kickstart configuration program

# The next step is just a few mouse clicks!

· Basic configuration
Default language: Simplified Chinese, or English)
Keyboard: Default
Time zone: Asia/Shanghai, based on actual conditions
UTC clock: select
Root code: 123456
Confirm Root Password: 123456
Root Password Encryption: it is checked by default.

Advanced Configuration
Reboot the system after installation: select
· Installation Method
Execute New installation: select
Select NFS:
NFS server: 192.168.214.10
NFS Directory:/mnt # NFS shared ISO storage directory
· Boot Loader options

Installation type
Install the new Boot Loader: select
Installation Options
Install the boot loader on the Master Boot Record (MBR)
· Partition information
Master Boot Record
Clear Master Boot records: select
Partition
Delete all existing partitions: select
Disk tag
Initialize disk label: select
Layout
Add partitions (same as installing a real machine)
· Network Configuration
Add a network device-network device (eth0)-network type (DHCP)-OK
· Verification
Default
· Firewall Configuration
Disable all
· Display Configuration
Install the graphical environment: uncheck this option (if you do not want to install it)
Disable
· Software package selection
Default
· Pre-installation script
Default
· Script after installation
Default

Select -- file -- save -- (save the file to the/root directory, and the file name is ks. cfg)

Shell> mkdir/nfsdirshell> cp ks. cfg/nfsdirshell> chown 777/nfsdir/ks. mongoshell> vim/etc/exports/mnt 192.168.214.0/24 (ro, sync)/nfsdir 192.168.214.0/24 (ro, sync) # Add the shared directory shell> exportfs-arshell> vim/var/lib/tftpboot/pxelinux. cfg/defaultdefault vesamenu. c32 # prompt 1 timeout 50 display boot. msgmenu background splash.jpg menu title Welcome to CentOS 6.6! Menu color border 0 # ffffffff #00000000 menu color sel 7 # ffffffff # ff000000menu color title 0 # ffffffff #00000000 menu color tabmsg 0 # ffffffff #00000000 menu color unsel 0 # ffffffff #00000000 menu color hotsel 0 # ff000000 # ffffffffmenu color hotkey 7 # ffffffff # ff000000menu color scrollbar 0 # ffffffff #00000000 label linuxmenu label ^ Install or upgrade an existing systemmenu defaultkernel vmlinuzappend ks = nfs: 192.168.214.10:/nfsdir/ks. cfg initrd = initrd. imglabel vesamenu label Install system with ^ basic video driverkernel vmlinuzappend initrd = initrd. img xdriver = vesa nomodesetlabel rescuemenu label ^ Rescue installed systemkernel vmlinuzappend initrd = initrd. img rescuelabel localmenu label Boot from ^ local drivelocalboot 0 xfffflabel memtest86menu label ^ Memory testkernel memtestappend-

# Timeout 50 (this parameter is originally set to 600, that is, the time used to select the mode when the system is entered. We don't want to wait too long, so we want to change it to 5 seconds)

# Add: ks = nfs: 192.168.214.10:/nfsdir/ks. cfg to the first label (define the ks. cfg path)

label linuxmenu label ^Install or upgrade an existing systemmenu defaultkernel vmlinuzappend ks=nfs:192.168.214.10:/nfsdir/ks.cfg initrd=initrd.img

# Paste the ks. cfg file content below (no modification is required)

Shell> vim/nfsdir/ks. cfg # platform = x86, AMD64, or Intel EM64T # version = DEVEL # Firewall configurationfirewall -- disabled # Install OS instead of upgradeinstall # Use NFS installation medianfs -- server = 192.168.214.10 -- dir =/mnt # Root passwordrootpw -- iscrypted $1 $56 NxQt/e $ 3fz. wnuWl7Ak7q9TIpwl0. # System authorization informationauth -- useshadow -- passalgo = sha512 # Use graphical installgraphical # System authentication us # System authentication agelang zh_CN # SELinux authentication -- disabled # Do not configure the X Window Systemskipx # Installation logging levellogging -- level = info # Reboot after installationreboot # System timezonetimezone -- isUtc Asia/Shanghai # Network informationnetwork -- bootproto = dhcp -- device = eth0 -- onboot = on # System bootloader configurationbootloader -- location = mbr # Clear the Master Boot Recordzerombr # Partition clearing ionionclearpart -- all -- initlabel # Disk partitioning informationpart/boot -- fstype = "ext4" -- size = 200 part swap -- fstype = "swap" -- size = 1024 part/-- fstype = "ext4" -- grow -- size = 1

4. Restart the service and the test is unattended.

# Perform step 6

# Now the client only needs to boot (the boot mode is network boot, but you don't need to set it. You will find it yourself!

# No problem after testing!

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.