Many system administrators would prefer
to use an automated installation method to install Red Hat / CentOS /
Fedora on their machines. To answer this need, Red Hat created the
kickstart installation method. Using kickstart, a system administrator
can create a single file containing the answers to all the questions
that would normally be asked during a typical installation.
Kickstart files can be kept on a single server system and read by individual computers during the installation. This installation method can support the use of a single kickstart file to install Red Hat Enterprise Linux on multiple machines, making it ideal for network and system administrators.
Kickstart installation can be performed in different ways:
1) HTTP method.
2) NFS
3) FTP
Here I am explaining the HTTP method for kickstart installation in vmware workstation, in my lab environment.
In kickstart installation, one machine will act as the kickstart server and another machine will be the client machine. Installation includes the following major steps.
1) Mount the installation media to the kickstart server
2) Create kickstart configuration file.
3) boot the client machine from the boot image and mention the boot parametes in the boot prompt
Installation steps in detail:
Steps1:
Let the machine with IP address “192.168.133.128″ be the kickstart server for the installation. As we are using the HTTP methos of kickstart installation, make sure that apache is running in the server. If it is not running, start using the follwing command.
# /etc/init.d/httpd start
If it is not installed, install using command.
# yum install httpd
Step2:
The next part of the configuration will be to create the directory structure we will use to serve the installation files and populate them. You can create this directory structure from a CentOS / Redhat ISO image.
I am using a VM in Vmware to configure the kickstart. For creating the installation media, insert CentOS / Redhat ISO image to the kickstart server (192.168.133.128). You can do this as follows:
Go to Virtual Machine settings >> select CD/DVD (IDE) >> Browse the ISO image to “Use ISO image file section”
Once you insert the ISO image to the VM, you can see the mounted image in mount point “/media/CentOS_5.5_Final”.
We are using HTTP method of kickstart installation. So we need to re-mount this ISO image to document root of the apache server. By default /var/www/html will be the document root. So I created one folder named “dataServe” in /var/www/html and mount the ISO image to that path.
Now you can see the new mount point /var/www/html/dataServe with required directory structure.
Step:3
[root@centos ~]# cat /var/www/html/ks/ks.cfg
# Kickstart file for a basic install.
install
url –url http://192.168.133.128/dataServe/
lang en_US.UTF-8
keyboard us
#Assign Ip address to client during boot time
network –device eth0 –bootproto static –ip=192.168.133.132 –netmask=255.255.255.0 –gateway 192.168.133.2 –nameserver 192.168.133.2 –hostname centos –noipv6
#rootpw –iscrypted
# boot loader location bootloader –location=mbr –driveorder=sda
#set time zone timezone –utc America/New_York
#wipe all the partitions and create the below.
clearpart –drives=sda –all –initlabel part /boot –fstype ext3 –size=100 part / –fstype ext3 –size=5000 part swap –size=1024 part /home –fstype ext3 –size=100 –grow
# install the base and core packages with open ssh client and server
%packages
@Core
@Base
openssh-clients
openssh-server
++++++++++++++++++++++++++++++++++++++++
Now everything is done for kickstart server. The kickstart server has been built, the kickstart file is in place, and you are ready to boot up your client to start testing a kickstart installation.
Step4:
To boot up the client machine, we need boot image file. This file can be available from CentOS / Redhat download page with name “netinstall.iso”. Otherwise you can get it from the installation media itself.
See the path “/media/CentOS_5.5_Final/images/boot.iso”.
Boot the client machine from the netinstall.iso / boot.iso file and it will show the installation start page. Type the following line in the boot prompt.
boot: linux text ks=http://192.168.133.128/ks/ks.cfg append ip=192.168.133.134 netmask=255.255.255.0
This command tells the client to boot the kernel, look for the 192.168.133.128 server (our kickstart server), retrieve the ks.cfg file from /var/www/html/ks/, and assign the client a static address of 192.168.133.134.
Please stop the iptables in the kickstart server if required [Incase if your client machie face any problem in retriving ks.cfg file]
Kickstart files can be kept on a single server system and read by individual computers during the installation. This installation method can support the use of a single kickstart file to install Red Hat Enterprise Linux on multiple machines, making it ideal for network and system administrators.
Kickstart installation can be performed in different ways:
1) HTTP method.
2) NFS
3) FTP
Here I am explaining the HTTP method for kickstart installation in vmware workstation, in my lab environment.
In kickstart installation, one machine will act as the kickstart server and another machine will be the client machine. Installation includes the following major steps.
1) Mount the installation media to the kickstart server
2) Create kickstart configuration file.
3) boot the client machine from the boot image and mention the boot parametes in the boot prompt
Installation steps in detail:
Steps1:
Let the machine with IP address “192.168.133.128″ be the kickstart server for the installation. As we are using the HTTP methos of kickstart installation, make sure that apache is running in the server. If it is not running, start using the follwing command.
# /etc/init.d/httpd start
If it is not installed, install using command.
# yum install httpd
Step2:
The next part of the configuration will be to create the directory structure we will use to serve the installation files and populate them. You can create this directory structure from a CentOS / Redhat ISO image.
I am using a VM in Vmware to configure the kickstart. For creating the installation media, insert CentOS / Redhat ISO image to the kickstart server (192.168.133.128). You can do this as follows:
Go to Virtual Machine settings >> select CD/DVD (IDE) >> Browse the ISO image to “Use ISO image file section”
Once you insert the ISO image to the VM, you can see the mounted image in mount point “/media/CentOS_5.5_Final”.
We are using HTTP method of kickstart installation. So we need to re-mount this ISO image to document root of the apache server. By default /var/www/html will be the document root. So I created one folder named “dataServe” in /var/www/html and mount the ISO image to that path.
Now you can see the new mount point /var/www/html/dataServe with required directory structure.
Step:3
For next
step, will need to build a kickstart file and copy it into
/var/www/html/ks directory, where the clients will pull it from during
install. Below is the example of a simple kickstart file I am using.
Kickstart files can get very complex with scripts and custom settings
which is why we are going to use this basic template.
++++++++++++++++++++++++++++++++++++++[root@centos ~]# cat /var/www/html/ks/ks.cfg
# Kickstart file for a basic install.
install
url –url http://192.168.133.128/dataServe/
lang en_US.UTF-8
keyboard us
#Assign Ip address to client during boot time
network –device eth0 –bootproto static –ip=192.168.133.132 –netmask=255.255.255.0 –gateway 192.168.133.2 –nameserver 192.168.133.2 –hostname centos –noipv6
#rootpw –iscrypted
# Enable the firewall and open port 22
firewall –enabled –port=22:tcp
# Setup security and SELinux levels
authconfig –enableshadow –enablemd5
selinux –permissive# boot loader location bootloader –location=mbr –driveorder=sda
#set time zone timezone –utc America/New_York
#wipe all the partitions and create the below.
clearpart –drives=sda –all –initlabel part /boot –fstype ext3 –size=100 part / –fstype ext3 –size=5000 part swap –size=1024 part /home –fstype ext3 –size=100 –grow
# install the base and core packages with open ssh client and server
%packages
@Core
@Base
openssh-clients
openssh-server
++++++++++++++++++++++++++++++++++++++++
Now everything is done for kickstart server. The kickstart server has been built, the kickstart file is in place, and you are ready to boot up your client to start testing a kickstart installation.
Step4:
To boot up the client machine, we need boot image file. This file can be available from CentOS / Redhat download page with name “netinstall.iso”. Otherwise you can get it from the installation media itself.
See the path “/media/CentOS_5.5_Final/images/boot.iso”.
Create a new virtual machine as client machine and Insert this “netinstall.iso” or “boot.iso” client machine.
Same as the procedure mentioned in step2
[ Go to Virtual Machine settings >> select CD/DVD (IDE) >> Browse the ISO image to "Use ISO image file section" ]Same as the procedure mentioned in step2
Now boot the client machine from the “boot.iso” file.
Step5:Boot the client machine from the netinstall.iso / boot.iso file and it will show the installation start page. Type the following line in the boot prompt.
boot: linux text ks=http://192.168.133.128/ks/ks.cfg append ip=192.168.133.134 netmask=255.255.255.0
This command tells the client to boot the kernel, look for the 192.168.133.128 server (our kickstart server), retrieve the ks.cfg file from /var/www/html/ks/, and assign the client a static address of 192.168.133.134.
Please stop the iptables in the kickstart server if required [Incase if your client machie face any problem in retriving ks.cfg file]
There are
two things to be noted here. If you dont want to use a static address
you will need a functional DHCP server with correct settings and the
static ip assignment can actually take place in the kickstart file
however there is a bug in CentOS currently which prevents this from
happening, This is the reason why we specified the IP address via
kernel boot parameters. If you have typed the command correctly and the
server is setup properly you will see the client begin to install the
system automatically.
Just
before starting the installation, it will ask for the root password. If
you already specified the root password in the ks.cfg file, it wont ask
for password.
After you
type the password, it will start the installation of packages and once
the installation is the completed, the client machine will ask for
reboot.
Yes, your machine has been installed and booted up now using our kickstart server now… Now, happy practicing
No comments:
Post a Comment