Saturday 14 September 2013

automated installations - kickstart

Objective: How to automate installation(kickstart) CentOS

Environment: RHEL/CentOS 6.3 (i386)

What is kickstart ?

I had preferred to use an automated installation of CentOS-6.3 on my system. Redhat created kickstart installation method. I had created a kickstart file from system-config-kickstart utility and customized with my requirements to the file. This single file containing the answers to all the questions that would normally be asked during a typical installation.

This file is being kept in a single server and read by individual servers during installations. 

How did I perform kickstart ?

firstly, created a kickstart file.
secondly, I have made kickstart file available over the network.
thirdly, make the installation tree available.
lastly, started the installation.

I would not be describing here about how to create kickstart file with the GUI mode, I would leave it as an exercise for the reader. 
How to create kickstart file in GUI mode ? click here

I have tried using kickstart over network in below ways all of which were successful :-
1. FTP
2. HTTP
3. NFS

Summary on kickstart script :-

- This was an text installation, non-interactive over FTP, NFS. HTTP, in which firewall and SeLinux was disabled. 

- There are two network interfaces one assigned with DHCP and another with static, in which host names are assigned.

- Grub password has been password protected.

- HDD will be erased and partitioned with LVM on which /, /tmp, /var, /usr, /home, and swap formatted with ext4 system. 

- Created user and assigned a password.

- Unnecessary services were been stopped

- %package% section all your required packages will be installed.

- %post% section can be executed with all your post installation scripts.
I have used a script to get all details of the system which is installed, Download

I had placed the script on a folder which was shared with NFS. I had to mount to the client, execute and stored result in a file.

- Once after the installation, CD/DVD will be ejected automatically.

Installation successful.

Kick-start installation 

FTP: 

Download the kickstart file. 
copy kick-start file to /var/ftp/pub. boot with CD/DVD, and with boot prompt, specify the method to be used for kickstart which is read by anaconda installer for installation.

boot: linux ks=ftp://<IPaddress of kickstart file server>/pub/ks.cfg 





HTTP:

Download the kickstart file.
copy to /var/www/html rootDirectory of HTTP server. Boot the CD/DVD and with boot prompt, specify the method to be used for kickstart which is read by anaconda installer for installation.

boot: linux ks=http://<IPaddress of kickstart file server>/ks.cfg

NFS:

Download the kickstart file.
Copy to some of the director and share file to /etc/exports. 
Boot the CD/DVD and with boot prompt, specify the method to be used for kickstart which is read by anaconda installer for installation.

boot: linux ks=nfs:192.XXX.XXX.XXX:/share/ks.cfg

I here by like to stretch this topic to configure PXE so that I will eliminate booting from CD/DVD. 

I will cover PXE - automated kickstart installation for CentOS/Redhat in next post.

No comments:

Post a Comment