Instructor: Hello.
In this video, we are going to learn Kickstart.
Kickstart is an automated way
of installing a Linux operating system.
So Kickstart is a method
to automate the Linux installation
without the need for any intervention from the user.
With the help of Kickstart, you can automate questions
that are asked during the installation,
and those questions are like language and time zone,
how the disc drives should be partitioned,
which packages should be installed or removed.
And if you go back to the installation wizard,
you remember while going through the installation,
the very first screen that comes up is the welcome
to CentOS Linux.
And here, you select the language
and the region of the language.
Then on the next screen, you go through the localization,
like which keyboard, language support
and time that you have to select based on where you are,
the software that you will be installing, the source media,
and then the system, the installation destination,
the network, host, name, security policy,
all that information has to be provided
while you are going through
the operating system installation.
Now, to eliminate all that
where you have to answer every single questions,
that's when the Kickstart comes.
The Kickstart provides you an automated way
of answering these questions
based on your predefined parameters.
Now, the purpose, you're probably thinking,
okay, so that's good, we have defined the parameters
of Kickstart during the installation,
all right, save me a couple of minutes.
That's not really too much saving.
Okay, well let's suppose if you have a computer
or a server of course,
and you need to install an operating system on it.
In our case we are talking about Linux operating system.
What do you do?
You attach the ISO image or insert the disc
and you go through the installation
and at the end of the installation
and you complete it, reboot it,
and your operating system is ready, beautiful.
Now what if you have to do the same procedure
for maybe another 10 servers or 20 or 30
or in some cases, in bigger corporate companies,
there are thousands of thousands servers
where you have to install operating systems
on almost monthly or quarterly basis,
then what do you do?
Do you really have to go through each one of the computer
and attach the ISO image file
and go through the installation one by one?
No, that's when the Kickstart comes.
This will allow you
to have those predefined questionnaire answered in a
configuration file, attach the ISO image
to all these servers
and let the installation run on its own.
Everything is completely automated.
All right, so to use the Kickstart,
here are a few things that you need to keep in mind.
Very first thing is you need to choose a Kickstart server
and create or edit a Kickstart file.
Now what is a file?
That is something we will go
and drill down more in detail
as to how the Kickstart file or config file works.
But for now, you need to understand
that you've gotta dedicate one computer
or one server which holds or has that Kickstart file.
Then make the Kickstart file
available on the network location.
Make the installation source available,
make boot media available for client,
which will be used to begin the installation.
And the last, start the Kickstart installation.
Now if you still haven't gotten a complete picture
of how a Kickstart server should set up, let's visualize it.
Here, we have a computer or a server.
We actually are dedicating this computer
or a server as a Kickstart server,
very small server
with the Linux operating system running on it,
and we will create a Kickstart file
and we have dedicated, beautiful,
we are here up to this point.
On the second step,
make the Kickstart file available on the network.
So once we create the Kickstart configuration file,
which has answers to all the questions
that are being asked during the installation,
that file has to be available on the network
and that network could be either on the NFS share,
FTP server, HTTP, or HTTPS.
Okay, so in our example, we will go through HTTP,
you could go with any of these network share,
doesn't really matter
as long as you are sharing that configuration file
with other clients who needs to have
the operating system installed
can have access to the network share.
All right, so as up to number two,
this is where we create the Kickstart server
and we create a Kickstart file
and make it available on the network.
Now number three is make the installation source available.
The source is the ISO image, your file,
which has all the packages,
which has all the operating system
that is actually saved on somewhere, a source.
That source has to be available
either on the Kickstart server or you could attach that
to your client right here, this is the number four.
So you could combine step three and step four as one,
or you could separate them
by making the installation source available
only on the Kickstart server
and the client can read from the Kickstart server
or you could directly attach that ISO image
to the client where you want
to have the operating system installed.
All right, up to this point,
if you have everything is ready, beautiful.
Now the next step is to start the Kickstart installation,
it's just that easy.
All right, moving on, a few things we need to clarify.
CentOS or Redhat 7,
the Kickstart program can be downloaded,
which allows you to define parameters through the GUI,
meaning that program, once you install it on your computer,
you could use
a yum install system dash config dash Kickstart,
this is a program which allows you to bring up a GUI
and you could define all the different parameters
that are needed to answer the questions
if you're not familiar with the format
of the Kickstart file.
A lot easier and you could define it there
or you could use the installation Kickstart file
which was created during the first installation.
Yes, what that means is every time you install
the Linux operating system,
more specifically Fedora, CentOS
or Redhat, it creates a file on your computer in slash root
and the file name is anaconda-ks.cfg
and it has all the answers to your question
that you have typed in during the installation.
So it's already there for you,
all you have to do is take that same config file
and make that available on the network for a second or third
or fourth server to have the installation exactly the same.
All right, in CentOS8 or Redhat 8,
this there, this program,
that system config Kickstart program,
which starts up the GUI, that is not available.
You could simply use the Anaconda-ks.cfg file,
which is created
while you're going through the first installation
and you could modify it based on your preference.
Okay, why changed?
Why did they not include that system config
Kickstart program in 8 now, they had it in 7?
Well the reason is that
most of the systems nowadays are virtual
and you could in virtualization,
you could create templates that can be used
to have mass installation
of operating systems on thousands of virtual machines.
Or you could use automation software such as Ansible
to do the same type of installation on multiple server.
But I would still say Kickstart is still used
in a many of the corporate world
because it's a lot easier to use
and it's a good tool to have
for our physical system installation.
All right, now let's get our hands dirty
and we'll go through step-by-step procedure
for Kickstart configuration set up
and do the actual installation.
So very first thing we have to do is to identify the server
that will be used as a Kickstart server, all right?
For that, what I did is I have already picked
my server and I have picked, for example, CentOS 7.
It doesn't really matter if you could pick
CentOS 8 or Redhat 8,
the instructions is exactly the same except the 8,
you cannot install the program that allows you
to edit the config file through a GUI.
All right, so this is our server.
Now the next step is take a snapshot of the server.
Very good idea.
Every time we need to make any changes to the server,
it's always good to take a snapshot.
So for that I have to go to my
Oracle VirtualBox snapshot manager,
this is my VM that I'm gonna be using.
And if I go right here on these three dot and snapshots
and click on take.
I would say anything that would let me identify the state,
that would be before Kickstart.
All right, because at this point on, I am going to
work or install Kickstart, so click okay.
All right, there you go, it is done.
Literally takes a few seconds and it has taken the snapshot.
If you go wrong or if you make a mistake,
then you could always restore it back to its original state,
which is right now what state it is in.
All right, so that is done, let's minimize this.
Moving on, install Kickstart Configurator,
and that is again for only version 7.
And to do that, we could go back to our machine
and simply do yum install system config dash Kickstart.
All right, it is asking us to confirm.
Click yes, hit enter.
All right, the installation
of system config Kickstart program is completed,
you could verify by running the command,
rpm qa and grep for Kickstart.
And you'll see right here, this is our Kickstart file.
Now if you do the same thing
or if you try to install the same program in our
version 8 CentOS or version 8 Redhat.
All right, let's see what happens,
this is the terminal.
All right, we do yum or dnf install
system dash config dash Kickstart.
Okay, so right here you see no match for argument this,
unable to find a match, okay?
It's because this configuration file program
is not available on 8.
All right, so we just confirmed that.
Moving on, start the Kickstart file configurator
and define parameters or use the root Anaconda-ks.cfg.
All right, let's go back to our Linux 7.
And to start, all you have to do is run system
config Kickstart
and this is going to open up a GUI
that lets you define the parameters,
whatever that you want to make changes to.
So if you notice right here it says Kickstart configurator,
you could define any of this parameters that
or any of these questions
that are asked to you during the installation.
Basic configuration, installation method,
how you want to install, CD ROM, NFS, FTP, HTTP, hard disk,
see these are the all the things that I have covered
that you should have the configuration file,
the Kickstart configuration file onto this network share.
Boot loader, partition information,
network and all those information
if you want to change it during the installation,
you could come here and do it.
Now, as I said, of course this system config,
Kickstart configurator is no longer in use in 8.
The best way to do it
is that you simply use the file that is created for you
when you did the first time installation.
And that is, let's clear the screen,
so let's go to root and do ls minus ltr,
and you'll see there's this file, anaconda-ks.cfg.
If you do more on this,
and this one tells you exactly all the parameters
that you picked when the first time you installed this,
see this operating system.
So it created, see it picked my host name that I defined,
it picked the language that I defined,
I wanted to use graphical interface system with GUI.
I wanted to use a CD ROM where the source
of the ISO image is there, I defined the password,
it took the root password, encrypted it,
put it it into this file
and it has all the information,
predefined information into that file.
So it's best to take this configurator file.
All right, as I said, start the Kickstart file configurator,
which we did and this is for those
who want to use that, okay?
And define the parameters
or use their root anaconda ks.cfg file.
Now, for those of you who are thinking what is Anaconda?
Anaconda is the name of the wizard,
the installation wizard that are given to you
when you go through the Linux installation,
that installation wizard is called Anaconda.
So by the way, once that is done,
that's what it creates a file with the same name,
dash Ks for Kickstart dot cfg for configuration.
All right, now to start the configurator system,
dash config dash Kickstart, we already went through it.
Perfect, we will use
the Anaconda installation Kickstart file
and change the host name only.
All right, so it means when we create a new server
with this Kickstart file,
we don't want to have the same host name, right?
That's why we need to change this, my first Linux OS
to change it to different ones.
So for that what we will do is we
vi slash root slash anaconda ks.cfg file.
Excellent.
Let's go down
and right here I will, what I will do is I will put simply
Kickstart Linux, it is that simple.
Save it, perfect.
Next thing is make sure HTTP package installed.
If not, then install the package
and start the HTTPD service.
Let's go to our server
and let's see if we have HTT package installed,
rpm dash QA and grep for HTTP.
Nope, it's not installed.
If it's not installed, then what do we do?
We yum install HTTPD.
Okay, yum install httpd.
While it's going in and installing it,
let's come back to our Redhat or CentOS 8.
And you will see in this server,
we do have the same file slash root ls minus ltr.
And right here is your Anaconda file.
This is the one that is created automatically for you
when you are installing the Linux on this virtual machine.
So if you do more Anaconda,
and you will find the same parameters and you could go in
and change the host name the same way we did it in R7.
Right here it says my first Linux VM, you could change it,
so this way the newly created virtual machine
does not have the same host name.
All right, anyway, let's go back to our 7
and here it's going to install HTTP.
It's asking us to confirm, yes.
All right, the HTTP has been installed, beautiful.
And if you have already HTTP server installed,
then you are good at this time,
then you need to make sure your HTTP server
is up and running.
So for that you have to do systemctl status httpd.
And right here my service is loaded
but it's disabled so I have to start it.
If yours is not started,
then you have to come here and start.
For that, you have to do systemctl start httpd, excellent.
To verify the status,
you can run it and you'll see right here says active.
Now you need to enable it, what it enable means
that you want this service to start at boot time.
All right, for that systemctl enable htpd, excellent.
All right, that part is done,
moving on to sixth step, copy Kickstart file
to httpd directory and change the permission.
All right, so let's move on to our
copying direction.
So for that you have to do
is copy slash route slash anaconda and where are you,
where do you want to copy it?
To var www/html and this is the default directory
for our HTTPD server.
So you have to copy it here
so it could be accessible over network.
All right, copied over, let's verify it,
var www slash html, beautiful.
All right, it's there
but it doesn't have all the read permission.
So for that, the next step should be to define
or to give the read permission.
Let's go back and let's give the read permission, change mod
A for all read permission to Anaconda file,
verified, and there you have it,
everyone can read this file now.
Moving on now, make sure your firewall
is stopped on the server.
If you do not want to stop the firewall,
then you have to allow HTTP port 80 to go
or accessible through the firewall.
For now, since we are doing this only for the lab,
that's why I'm going to disable the firewall.
But of course, check with your security administrator
before you disable the firewall
on your production server.
Systemctl stop firewalld.
It has stopped, now I want it to disable
because I want it, I don't want it to start at boot time.
Okay, it's removed.
Also, another thing is check sc Linux status.
For me, I have the SC status right here enabled,
but I don't think it should have any problem
for us to access that Anaconda file.
Right, so now in order to make sure
we could access that file
check file through the browser on another PC,
meaning I could go to my PC browser right here.
Oops, not browser like Firefox
and I could check that server
and a file is available.
What is the IP address of the server?
If config IP is 10.251.1.61.
Announcer: Please use IPA command
if you are on a newer version of Redhat or CentOS system.
Instructor: All right, so let's go here.
10.253.1.61/Anaconda-Ks.cfg.
Once I hit enter
and I would be able to see the content of the Anaconda file,
then it means, ah, there you go.
It means I could access that configuration file
over the network and it is available, beautiful.
Make sure your Anaconda file is also accessible
over your HTTP and we have just confirmed it.
Excellent, now you could minimize this or close it.
Next step, create a new virtual machine
and attach the OS ISO image.
All right, so we are creating a new virtual machine
where we want to have the Kickstart
install the automated operating system.
And for that we'll go to Oracle VirtualBox
and we will pretty much
create the same setting for the virtual machine.
Meaning if I go to right here, details,
go to settings, and this machine has
system of one gig memory,
processor, one processor storage, we have 20 gig,
so we'll keep it the same, consistent.
Let's go in here.
Oracle Virtual Box, create a new machine
and we'll call it KsLinux, Kickstart Linux.
All right, next memory one,
create a virtual disc, create,
leave a default, default,
here change the 8 gig to 20 gig to be consistent.
Create and it is done.
Now what you need to do is start.
While it is starting up,
okay, it already started,
so now go ahead and attach the ISO image.
So click on this folder,
I have already attached my image earlier,
so it is showing up right here,
this is it: CentOS7 DVDs 4.6 gig.
Perfect, you might have a different size depending on
if you're installing 8 or 7, click choose and start.
Okay, as soon as it comes up on this screen,
you see right here, automatic boot in 55 seconds?
It will give you one minute
to choose what you want it to do.
You do not want to choose any of these option,
click inside of this window and hit escape.
Once you get this boot option, then let's go back.
What do we want it to do?
Minimize this and change the network adapter
to bridge adapter.
Oh yeah, that's another thing we have to do.
So let's go to our KsLinux and let's go to setting
and go to network.
And right here is Nat, let's click bridge adapter,
excellent, click okay, that is done.
Next, hit escape, which we just did.
And now type this;
this is the path we have to type, right here is a boot.
Let's move this up.
And type Linux Kickstart equal,
which network are we using?
We are using http server right?
Colon slash slash,
now the IP address of our Kickstart server,
that is 10.253.1.61,
that is the IP in my case.
You might have it different,
so check by running the if config command.
So 10.253.1.61/anaconda-Kickstart.cfg.
Hit enter, and what's the next step?
For NFS, you have to run this command
and the next step is wait
and enjoy the automated installation.
All right, so let's see where we are right here.
Okay, this could take anywhere between a minute
to five minutes until you actually
see the automated installation.
So I'm gonna fast forward it.
Okay, so right here, it is at the installation summary,
pay close attention,
you see it has already defined the date and time for you.
It has already selected the keyboard, the language support.
It is already checking the installation source for you.
The dependency, where is it getting the ISO image?
That ISO image is attached
to this Linux virtual machine.
We attached it when we started on.
Then it's actually going through the software selection
based on our predefined
settings and parameters into our configuration file,
that's how it's going in and checking it then coming down.
Oops, but anyway, when we go, if you had gone down,
you probably have seen more settings
that's going through,
it already picked the root password for us,
which we had created
for our very first Linux virtual machine.
Then user creation, user Afzal,
yes, because it already has that user
that I created when at first time I did the installation
and now it's going through
starting the package installation process.
This is going through the packages is gonna count
probably like 13, 1400 packages
and it's gonna go through the installation.
Isn't it so beautiful when you automate things?
Yes it is.
You don't have to sit here and wait
and answer every questions of the installation,
you could just define all your parameters
into the configuration file and let it run.
Now if you want to change
any of the other configuration parameters,
you could go in and change on to the file,
which is sitting on your HTTP server.
And right here, it is sitting right here on our HTTP server.
You go to Anaconda file, VI it, modify it,
and change any of the parameters based on your requirement.
All right, excellent, now you're probably thinking
one more thing and I do want to clarify that.
All right, so we did automate one Linux machine
and it's going through the installation right now,
you see it's 1300 packages that it has to install.
Now what if I have to do or install another Linux machine?
Now do I have to wait for this to finish?
Very good question if that's what you're thinking.
No, the reason behind this is because
the ISO image that you attach to this
can be read by as many virtual machines
or as many physical servers as you can
because once it's reading the file,
it doesn't matter how many servers reading that file.
Same way, it doesn't matter how many configuration
or how many servers are reading this configuration file.
So you could actually run this one time on one server,
move on to the second, third, fourth, fifth,
as many as you can.
And you probably notice by the end of the day,
you probably have installed hundreds of server
and that is great for your productivity.
Anyway, I'm not gonna go through the entire installation
to complete, but I'm sure at this point,
you have a good grip of how the Kickstart server works
and how you could automate
your installation of your Linux machines.
All right, so for those of you
who actually are in corporate environment
and you assign IPs to your Linux machines
or your clients with static IP,
then how you can manage the Kickstart
because so far we learned that Kickstart,
you have to have a DHCP server.
What if you do not have a DHCP server?
Then how your client
is going to communicate to the Kickstart?
For that, you will run the command
same as you will run for DHCP server,
which is boot Linux Kickstart the path
and the Kickstart, which is right here, ks.cfg.
Now after that, after you put a space
and then you have to define these extra parameters,
which is ksdevice equal eth0, IP address,
net mask and gateway.
Whereas the ks device
is the network adapter of your client.
You have to know the name of the network adapter.
So if you are installing your operating system
through Kickstart to a physical machine,
then most likely you will have eth0.
Of course, it depends on
the computer hardware manufacturers as well,
but most of the time it will be eth0.
If you are doing it for your virtual machine
on Oracle VirtualBox,
then it will most likely enp0s3.
So you define that,
then a next thing you do is you define the IP address.
This is the IP address
that you are going to assign to your client.
So it could be on the network
and read configuration file from Kickstart.
Pick the IP address, you have to get that IP address
from your network administrator
or wherever you get that IP, which is not in use.
Then you enter the net mask,
net mask is a subnet mask for the client
and most of the time based on slash 24 subnet,
it's 255.255.255.0,
and then you have to define the gateway of that network.
Once you put that information in, then you hit the command,
then your client will be assigned that IP address,
then your client will wake up
and it will be able to communicate to the Kickstart server.
So this is the instruction for those people
who do not have a DHCP server in their environment.