1
00:00:00,050 --> 00:00:01,050
- [Instructor] For this exercise,

2
00:00:01,050 --> 00:00:03,000
we'll be doing a non-interactive

3
00:00:03,000 --> 00:00:04,080
automated install of CentOS 7

4
00:00:04,080 --> 00:00:07,080
into a guest VM using our FTP repository

5
00:00:07,080 --> 00:00:09,040
in a remote kickstart file

6
00:00:09,040 --> 00:00:13,000
from the exercisefiles.zip archive we extracted.

7
00:00:13,000 --> 00:00:15,040
Because we're using the kickstart file from the FTP server

8
00:00:15,040 --> 00:00:17,040
we need to copy it there first.

9
00:00:17,040 --> 00:00:20,010
Go to where you extracted the exercise files zip archive,

10
00:00:20,010 --> 00:00:22,020
in my case this is my user's home directory,

11
00:00:22,020 --> 00:00:24,090
so I'm going to type in cd ~ and hit enter

12
00:00:24,090 --> 00:00:26,060
and then type in ls.

13
00:00:26,060 --> 00:00:31,030
You should see the Ex_Files_RHCE_CertPrep_Routing directory.

14
00:00:31,030 --> 00:00:33,020
Cd into it by typing in cd space

15
00:00:33,020 --> 00:00:38,080
capital e tab, capital e tab, capital c tab.

16
00:00:38,080 --> 00:00:40,060
This took me into /home/grant/

17
00:00:40,060 --> 00:00:43,030
Ex_Files_RHCE_CertPrep_Routing

18
00:00:43,030 --> 00:00:47,050
/Exercise Files/Ch 02 and then type in ls

19
00:00:47,050 --> 00:00:50,030
and you should see the kickstart files.

20
00:00:50,030 --> 00:00:55,010
We're going to copy the centos-ftp-ks.cfg file

21
00:00:55,010 --> 00:00:57,010
to our FTP repository.

22
00:00:57,010 --> 00:01:04,010
Type in sudo cp centos7-ks.cfg

23
00:01:04,010 --> 00:01:09,090
/var/ftp/pub/el7 and hit enter.

24
00:01:09,090 --> 00:01:11,090
The complete command line for installing CentOS 7

25
00:01:11,090 --> 00:01:14,030
via kickstart file from an FTP repository

26
00:01:14,030 --> 00:01:17,000
is quite long so let's discuss it.

27
00:01:17,000 --> 00:01:18,080
We have to elevate privileges to create a VM,

28
00:01:18,080 --> 00:01:20,090
so we prefix the line with sudo.

29
00:01:20,090 --> 00:01:22,000
The second highlighted section

30
00:01:22,000 --> 00:01:26,020
sets the name of the VM to centos7-ftp-ks

31
00:01:26,020 --> 00:01:27,030
to remind us that we installed

32
00:01:27,030 --> 00:01:30,080
to the kickstart file from our FTP repository.

33
00:01:30,080 --> 00:01:32,070
This is the amount of RAM for our VM guest

34
00:01:32,070 --> 00:01:35,020
and this is the disk image you will install into.

35
00:01:35,020 --> 00:01:37,070
Virt-install creates this for us.

36
00:01:37,070 --> 00:01:41,070
The --location option is the location of the package files,

37
00:01:41,070 --> 00:01:43,030
make sure the path you use matches

38
00:01:43,030 --> 00:01:45,030
where you created the FTP server.

39
00:01:45,030 --> 00:01:46,080
In my case, the path would be

40
00:01:46,080 --> 00:01:57,070
- -location="ftp://192.168.122.1/pub/el7".

41
00:01:57,070 --> 00:02:02,020
The --nographics option specifies a non-graphical install.

42
00:02:02,020 --> 00:02:04,010
These are the extra arguments that will get passed

43
00:02:04,010 --> 00:02:05,090
to the Linux kernel during install.

44
00:02:05,090 --> 00:02:08,040
The ks= section tells the Linux guest kernel

45
00:02:08,040 --> 00:02:11,040
to use the kickstart file from the FTP server.

46
00:02:11,040 --> 00:02:13,020
The ip= section tells the guest

47
00:02:13,020 --> 00:02:16,030
to get its IP address from a DHCP server.

48
00:02:16,030 --> 00:02:19,050
The console option set up ways for us to see the output.

49
00:02:19,050 --> 00:02:21,080
The latter console line configures a serial console

50
00:02:21,080 --> 00:02:27,030
using the /dev/ttys0 device at 115,200 bits per second,

51
00:02:27,030 --> 00:02:30,010
no parity and eight databits.

52
00:02:30,010 --> 00:02:31,080
The last argument is the os variant

53
00:02:31,080 --> 00:02:35,010
which allows installation time optimization by KVM.

54
00:02:35,010 --> 00:02:38,000
You can use the os-query info command

55
00:02:38,000 --> 00:02:41,060
to get a list of possible os variants.

56
00:02:41,060 --> 00:02:42,080
Now, let's type it all in.

57
00:02:42,080 --> 00:02:47,010
Type in clear and then type in the entire line.

58
00:02:47,010 --> 00:02:48,070
Considering the length of this command line,

59
00:02:48,070 --> 00:02:51,000
there's a high chance of having a typo or two.

60
00:02:51,000 --> 00:02:53,000
Just fix the typos, delete the VM

61
00:02:53,000 --> 00:02:55,070
and run it again until the install is successful.

62
00:02:55,070 --> 00:02:57,050
If you have to run the command line more than once,

63
00:02:57,050 --> 00:02:59,000
virt-install will probably complain

64
00:02:59,000 --> 00:03:02,010
because the VM or disk image may already exist.

65
00:03:02,010 --> 00:03:04,010
In this case you may have to shut down the guest VM

66
00:03:04,010 --> 00:03:06,050
and delete it before running the install again.

67
00:03:06,050 --> 00:03:07,060
If so, just flip over to the

68
00:03:07,060 --> 00:03:10,050
Virtual Machine Manager GUI window and do it there.

69
00:03:10,050 --> 00:03:12,010
Using Virtual Machine Manager you can

70
00:03:12,010 --> 00:03:14,070
right click on the VM and force it to shut down.

71
00:03:14,070 --> 00:03:16,060
Once it's shut down you can delete the guest VM

72
00:03:16,060 --> 00:03:19,010
before trying to install again from the command line.

73
00:03:19,010 --> 00:03:21,070
Now hit enter to start the install.

74
00:03:21,070 --> 00:03:23,090
The install should complete in 15 to 45 minutes

75
00:03:23,090 --> 00:03:27,070
depending on your hardware and your network speed.

76
00:03:27,070 --> 00:03:30,050
Using movie magic we will speed up

77
00:03:30,050 --> 00:03:31,040
the installation process in the video,

78
00:03:31,040 --> 00:03:32,080
so you'll want to pause the video

79
00:03:32,080 --> 00:03:40,060
until your installation catches up.

80
00:03:40,060 --> 00:03:43,000
Once the install is done, the VM will reboot.


