0:00 in this lecture we're going to learn
0:02 about a very important concept in the it
0:04 world
0:05 which is virtualization and virtual
0:07 machines
0:08 we're going to see what virtual machines
0:10 are and why are they so useful
0:13 and learn all the main concepts of
0:15 virtualization
0:16 once we learn the concept of how virtual
0:18 machines work
0:19 we're going to see it in action in the
0:21 demo part by
0:23 creating a linux virtual machine on our
0:25 computer
0:26 using a popular open source software
0:29 called virtualbox
0:31 i am nana and i have taught hundreds of
0:33 thousands of people around the world
0:35 how to advance their devops skills
0:38 through my youtube videos
0:39 online courses in the six month devops
0:42 bootcamp
0:43 if you're new here be sure to subscribe
0:45 as i upload new videos
0:47 all the time now let's see what a
0:50 virtual
0:51 machine is imagine you have a windows
0:54 computer
0:55 and as we learned a computer has
0:57 hardware like cpu
0:59 ram and storage so we would have windows
1:01 operating system
1:03 on top of that that controls how
1:06 applications
1:06 use these hardware resources and on top
1:09 of the windows operating system you
1:11 would have applications
1:12 that talk to windows so everything's
1:15 cool here
1:16 now what if you wanted to use linux
1:19 instead
1:20 maybe for your work or maybe you just
1:22 want to learn a
1:23 new operating system for that you will
1:25 need a machine
1:27 with hardware resources and linux
1:30 operating system
1:31 on top of that and then you could run
1:33 applications
1:34 on that linux operating system so
1:37 basically you would need another
1:38 computer another laptop
1:40 where you would install that linux
1:42 operating system
1:44 now what virtualization is is that
1:47 you don't need a separate physical
1:50 hardware or physical computer
1:52 to install an operating system you can
1:55 install linux operating system on top of
1:57 the windows os or vice versa
2:01 you can install windows on linux or
2:03 windows and linux on mac os
2:06 you can do any combination basically you
2:08 can even do windows
2:09 on windows or linux on linux and you can
2:12 achieve that
2:13 using something called a hypervisor
2:16 hypervisor is a technology that allows
2:19 hosting multiple virtual computers on a
2:22 physical
2:23 computer on top of the operating system
2:25 that you already have
2:27 installed and one of the most popular
2:29 hypervisors out there
2:30 is virtualbox from oracle
2:34 and one of the main reasons for its
2:36 popularity is because it's
2:37 open source and virtualbox actually
2:40 works on
2:40 all operating systems and it's pretty
2:42 easy to use so virtualbox will
2:45 let you create a virtual computer on
2:48 your windows computer
2:49 by telling the windows operating system
2:52 hey can i have some of your hardware
2:54 resources
2:55 that you manage to create a virtual cpu
3:00 virtual ram virtual storage for my
3:02 virtual computer
3:04 and as i said you can have multiple
3:07 virtual machines that are running on
3:10 your
3:10 computer through a hypervisor
3:14 now note here that you can only give the
3:16 virtual computer the hardware resources
3:18 you actually
3:19 have available on that computer if you
3:22 have
3:22 eight gigabytes of ram and your windows
3:25 is using
3:26 four gigabytes and you give your virtual
3:28 machine
3:29 another four gigabytes then you have no
3:32 ram
3:32 left to be used for another virtual
3:34 machine so you can't create another one
3:36 so basically now you are sharing the
3:38 hardware resources of
3:40 one machine to run multiple
3:43 virtual machines so this means that as
3:45 long as you have one computer with one
3:48 operating system
3:49 using the hypervisor like virtualbox you
3:52 can install
3:53 other operating systems on top of it but
3:56 these virtual machines
3:58 actually don't see each other and
3:59 they're completely isolated
4:01 so the virtual machine itself thinks
4:05 that it is an independent computer it's
4:08 the only one
4:09 running on that computer it doesn't even
4:11 know that it's a virtual machine
4:13 and it doesn't know that it's hosted on
4:15 top of another operating system
4:17 and that separation is actually great
4:20 because
4:20 if something happens to that virtual
4:23 machine
4:24 something breaks inside or someone hex
4:27 inside that virtual machine
4:29 it won't affect the main operating
4:31 system
4:32 the main os probably won't even know
4:34 that the vm has
4:35 some issues and it doesn't care so
4:38 when this happens you can just delete
4:40 that vm and create a fresh new one
4:43 super easily now you're probably asking
4:46 what is it actually good for
4:48 what is the usage or benefits of having
4:51 a hypervisor and having virtual machines
4:53 on your computer first of all it's
4:56 really great for learning new operating
4:58 systems so now you don't have to go and
5:00 buy a new computer and install
5:02 and linux on it you can basically just
5:05 host it
5:05 on your windows machine if you want to
5:08 maybe you want to
5:09 just experiment and play around with an
5:11 operating system but you don't want to
5:13 actually
5:14 destroy or endanger your main operating
5:16 system
5:17 so you can quickly spin up a virtual
5:20 machine
5:20 you can play around with it and do all
5:22 the stuff that you want
5:24 and then once you're done with it you
5:25 can just basically remove it
5:27 another great use case for virtual
5:29 machines
5:31 is if you want to test an application
5:33 like a web application that you're
5:35 developing
5:36 maybe you want to see how that works and
5:38 how it looks like
5:39 in different operating systems in
5:41 different browsers so you may be
5:43 developing on a mac os laptop
5:47 and you want to see how your application
5:48 performs on linux machine in a firefox
5:50 browser and you may
5:52 also want to see how your application
5:55 runs on windows
5:56 in internet explorer browser so you can
5:58 create virtual machines
6:00 for both of these combinations and test
6:03 your application
6:04 there and when you're done you can just
6:06 delete them
6:07 before moving on i want to give a shout
6:09 out to kesten who made this video
6:12 possible
6:13 castings k10 is the data management
6:16 platform for kubernetes
6:18 k10 basically takes off most of the load
6:21 of doing backup and restore in
6:23 kubernetes
6:24 from the cluster administrators it has a
6:27 very simple ui so it's super
6:29 easy to work with and has an intelligent
6:32 logic which does
6:33 all the heavy lifting for you for my
6:36 viewers
6:36 casting provided an ebook kubernetes
6:39 backup and recovery for dummies
6:42 which you can download for free so be
6:44 sure to check out the link in the video
6:46 description
6:47 and now let's see what's the difference
6:49 between type 1
6:50 and type 2 hypervisors and this type of
6:54 hypervisor
6:55 that i just described which is basically
6:59 creating virtual machines on top of an
7:02 existing operating system
7:05 is called a type 2 hypervisor
7:08 so you have the host operating system or
7:10 the main operating system which is
7:12 already installed on the hardware on
7:14 your machine
7:15 on that operating system you install a
7:17 hypervisor like virtualbox
7:19 right so on windows you install your
7:21 virtualbox and then
7:23 using the virtualbox you can now install
7:26 guest operating systems and the guest
7:29 operating systems as i said
7:31 will borrow the hardware resources from
7:34 the host operating system
7:36 and the type 2 hypervisors are typically
7:40 used for personal computers
7:42 for the use cases that i just described
7:45 however for big servers that companies
7:48 are using
7:49 you have the second type of hypervisor
7:52 which is
7:52 type 1 hypervisor which actually works
7:56 in
7:56 exactly the same way however the main
7:58 difference here is that
8:00 instead of installing a hypervisor on a
8:02 host
8:03 operating system you basically install
8:05 it directly
8:07 on the hardware and that's why the type
8:09 1 hypervisors are also called
8:12 bare metal hypervisors so the hypervisor
8:14 actually controls the hardware resources
8:17 instead of
8:17 talking to the host operating system
8:20 whether it can borrow the resources for
8:22 its virtual machines
8:23 so it sits directly on top of that
8:26 hardware
8:26 and controls everything and some of the
8:29 popular examples of
8:30 type 1 hypervisors are vmware
8:34 esxi or microsoft's hyper-v
8:38 and once installed basically the concept
8:41 is the same
8:42 as with type 2 hypervisors you basically
8:46 just install
8:46 any operating system on top of it so for
8:49 big servers you'll have
8:51 one physical server with a bare metal
8:53 hypervisor
8:54 installed on it and then you would have
8:56 multiple
8:57 virtual machines that are running on
8:59 that hypervisor
9:00 all sharing the same hardware resources
9:03 and type one hypervisor
9:04 is mostly what those big companies
9:08 and big cloud platforms actually use to
9:11 create and run their whole
9:14 infrastructure
9:15 so when you create a server instance on
9:17 a cloud platform like aws
9:19 or digitalocean or google cloud or
9:21 whatever platform
9:22 you're creating these virtual machines
9:25 on a physical server
9:26 and other users who create an instance
9:29 may get a virtual machine on the same
9:31 exact physical server
9:33 as your virtual machine but as i said
9:35 these vms are completely isolated they
9:38 don't know anything about each other
9:39 so if something happens in one virtual
9:41 machine if someone gets
9:43 hacked whose vm is on the same physical
9:45 server
9:46 you won't even know it because each vm
9:49 is running in its own isolated
9:51 environment right
9:52 they don't share network they don't
9:54 share any resources they don't share
9:56 anything they're completely independent
9:58 from each other
9:59 now i give you some examples of why type
10:02 2
10:02 or also called hosted hypervisors are
10:06 useful right
10:07 for using them on personal computer but
10:10 what are the use cases
10:11 of the type one hypervisors so what is
10:15 basically the big advantage of companies
10:17 going out there
10:18 and using this virtualization
10:22 on their server infrastructure one big
10:25 advantage
10:26 of using virtualization and hosting
10:29 multiple virtual machines
10:31 on one physical machine is efficient
10:34 usage of hardware resources
10:36 because now you may have these
10:40 performant big servers on a cloud
10:43 but you can actually or cloud provider
10:45 can actually let the users
10:47 put together any combination of
10:49 resources
10:51 they want in their instance by picking
10:54 and choosing
10:55 how much cpu how much ram how much
10:57 storage they want
10:59 so they have this flexibility of
11:01 choosing the size of their instances
11:04 because everything is virtualized right
11:06 the ram
11:07 and cpu and storage so all of these
11:09 resources are virtualized
11:11 so that's one big flexibility so now the
11:14 cloud providers they can actually use up
11:16 all their server
11:17 physical server resources by actually
11:20 dividing them
11:21 into small pieces that are then used
11:24 by virtual machines now there is one
11:27 more
11:28 very important benefit and basically
11:31 transformation that happened
11:33 in it industry because of virtualization
11:36 and that is basically abstracting away
11:40 the operating system that is running on
11:42 the hardware
11:43 from the hardware itself and that
11:46 abstraction actually is a really big
11:48 deal and let's see
11:49 why so before virtualization when a
11:52 company had a server like
11:54 their own database server or a server
11:57 where jenkins was running
11:58 they would manage it themselves like
12:00 install an operating system directly on
12:02 it and then start
12:03 installing applications on that
12:05 operating system like installing and
12:07 configuring jenkins
12:08 or installing database application etc
12:12 and when the operating system is
12:14 installed directly on a hardware without
12:16 that
12:16 hypervisor layer in between that
12:19 operating system is then tightly
12:22 coupled to the hardware that means
12:25 if the hardware component of the
12:26 computer failed
12:28 like the hard disk exploded or the
12:30 motherboard failed whatever
12:32 and you couldn't replace that component
12:34 because maybe it was an
12:35 old server and you couldn't find that
12:37 component anymore or maybe it was just
12:39 not
12:40 repairable anymore for whatever reasons
12:42 it meant your whole computer would be
12:44 useless
12:45 and the operating system and the
12:46 applications you installed and
12:48 configured on it
12:49 and all the data would be gone so
12:51 relying on that one physical box
12:54 meant one point of failure and therefore
12:57 high risk of losing all the services
12:59 running on that machine with
13:02 virtualization however
13:03 you have your operating system as a
13:06 portable
13:07 file that you can move around and these
13:09 files are
13:10 virtual machine images so that portable
13:13 file
13:13 that image will have the operating
13:15 system all the applications
13:18 the browser applications the editors
13:21 jenkins whatever applications you would
13:23 usually install on an operating system
13:26 all the configuration
13:27 files pictures documents basically
13:29 everything
13:31 would be inside that portable file
13:34 and since it's a file just like a
13:37 picture or a text document
13:39 you can make copies of it and you can
13:41 have backups of it
13:42 which is amazing and really useful
13:45 especially for companies
13:46 that means you could take your whole
13:48 jenkins
13:50 server operating system and pack it into
13:54 this portable image where all your
13:56 jenkins configuration
13:58 all your plugins all your data basically
13:59 would be inside
14:01 exactly as you configured it and you can
14:03 make backups of that
14:06 image which are called snapshots right
14:09 so you'd have
14:10 operating system image snapshots so now
14:13 if something happens
14:14 to that virtual image where jenkins is
14:17 running
14:18 like you mess up jenkins configuration
14:20 or someone hacked into it or
14:22 the hardware breaks you can simply take
14:24 that snapshot that operating system
14:27 image and simply run it on a different
14:30 computer
14:30 with hypervisor on it so by containing
14:34 the operating system and the application
14:36 layer of it in a portable file
14:38 you can secure your application and your
14:40 work
14:41 very easily and you can move it around
14:44 machines
14:44 without being dependent on any
14:48 physical server so the virtual machines
14:50 and the virtualization concept
14:52 generally is very powerful and that's
14:55 why you see it
14:55 everywhere in it it has completely
14:58 changed the way we work
14:59 so whether you want to become a cloud
15:01 engineer a system administrator software
15:04 developer
15:04 or devops engineer you need to
15:07 understand the virtualization because
15:09 you will be working with
15:10 virtual machines this video is actually
15:13 a small part of a linux module in the
15:15 complete
15:16 devops educational program linux is an
15:19 important
15:20 prerequisite for devops engineers so in
15:23 the linux module you learn everything
15:25 you need to know about
15:26 operating systems and linux as a devops
15:29 engineer
15:30 so if you want to become a devops
15:32 engineer or build up your devops skills
15:35 from xero to knowing all the required
15:37 devops concepts and tools
15:39 be sure to check out our bootcamp and
15:42 learn
15:43 from a docker captain aws container hero
15:46 and cncf ambassador with that
15:49 thank you for watching i hope you
15:51 learned a lot