July 2020
M T W T F S S
« Mar    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

WordPress Quotes

It is better to conquer yourself than to win a thousand battles. Then the victory is yours. It cannot be taken from you, not by angels or by demons, heaven or hell.
Buddha
July 2020
M T W T F S S
« Mar    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (270)
centos8 (3)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (2)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Ubuntu (1)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

0 visitors online now
0 guests, 0 bots, 0 members

Hit Counter provided by dental implants orange county

Kickstart CentOS 7: Making ISO for automated installation

Kickstart” is powerful tool for automated OS installation and configuration available in CentOS or RHEL. You can install CentOS without touching keyboard or mouse and even can automate post installation configuration process.

I’m recently building a Hadoop cluster for R&D, which makes me repeatedly install and re-install CentOS on several virtual machines. This is boring task takes hours. So I googled for automation and the answer was the Kickstart.

Basically a Kickstart is configuration file. CentOS load it at the beginning of installation process and apply it.

There are some ways to load the configuration file, through network, file system, or include installation ISO. I took the ISO way.

There is already good detail article about making kickstart-able ISO: “Building a custom CentOS 7 kickstart disc, part 1”, I followed this article with some modified steps.

Prepare directory and copy files from CentOS installation disk

$ mkdir ks_build
$ mkdir ks_build/isolinux
$ mkdir ks_build/isolinux/images
$ mkdir ks_build/isolinux/ks
$ mkdir ks_build/isolinux/LiveOS
$ mkdir ks_build/isolinux/Packages
$ mkdir ks_build/utils
$ cp /media/cdrom/CentOS7x86_64/isolinux/* ks_build/isolinux/
$ cp -R /media/cdrom/CentOS7x86_64/images/* ks_build/isolinux/images/
$ cp /media/cdrom/CentOS7x86_64/LiveOS/* ks_build/isolinux/LiveOS/
$ cp -p /media/cdrom/CentOS7x86_64/Packages/* ks_build/isolinux/Packages/
$ cp /media/cdrom/CentOS7x86_64/repodata/0e6e90965f55146ba5025ea450f822d1bb0267d0299ef64dd4365825e6bad995-c7-x86_64-comps.xml.gz ks_build/comps.xml.gz
$ gunzip ks_build/comps.xml.gz

Create kickstart configuration file

I created two files. One for Hadoop master nodes and the other for slave nodes. The only difference is disk partition settings. I will only paste configuration for master nodes.

Meaning of each options are described in 23.3. Kickstart Syntax Reference, a Red Hat document. There is also an GUI tool named “system-config-kickstart” for editing a configuration file.

$ vi ks_master.cfg
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL

# Install OS instead of upgrade
install
# Use CDROM installation media
cdrom
# System authorization information
auth  --enableshadow  --passalgo=sha512
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=vda
# Keyboard layouts
keyboard --vckeymap=jp106 --xlayouts='jp','us'
# System language
lang en_US.UTF-8
# Reboot after installation
reboot
# Root password
rootpw  --iscrypted $6$P3w8ID5.Zn3KObRb$eYGfYprCnPzwDF6WVPCLgx.tDFFo4/8prhovv.hEfdyfGRQ12MexcUwBESU3Hl2jS22KjA8si6.VdPChvnB4q1
# System language
timezone Asia/Tokyo --isUtc --nontp
# Firewall configuration
firewall --disabled
# Network information
network  --device=lo --hostname=localhost.localdomain
network --onboot=no --device=eth0 --bootproto=dhcp --noipv6
# Use graphical install
graphical
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# skip eula
eula --agreed

# System bootloader configuration
bootloader --location=mbr --driveorder=vda --append="crashkernel=auto rhgb quiet"
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --asprimary --fstype="ext4" --size=500
part swap --asprimary --fstype="swap" --size=6144
part / --asprimary --fstype="ext4" --grow --size=1

# Repository
repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100
%packages
@core
@base
%end
$ cp ks_master.cfg ks_build/isolinux/ks/

Note, the “–onboot” option is set to “no”. Because I haven’t setup a DHCP server at this time. Without DHCP server, the instllation will stop at configuration screen.

network --onboot=no --device=eth0 --bootproto=dhcp --noipv6

Create repository

$ cd ~/ks_build/isolinux
$ createrepo -g ~/ks_build/comps.xml . 

Build ISO

$ cd ~/ks_build
$ chmod 664 isolinux/isolinux.bin
$ mkisofs -o custom.iso -b isolinux.bin -c boot.cat -no-emul-boot -V 'CentOS 7 x86_64' -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/

Run kickstart

Boot from the ISO created by above command.

Press “ESC” at boot menu.

 

 

Type below command at boot prompt.

linux inst.ks=cdrom:/dev/cdrom:/ks/ks_master.cfg

 

 

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam