In this lesson, we're going to dive,
into the world of virtualization technologies,
because the cloud relies on virtualization
to allow end-users to run virtual machines
on these cloud-based servers.
This, in turn, allows multiple organizations and customers
to share one physical server
while keeping their own virtualized servers safe
and isolated from the other organizations located
on that same physical server.
Virtualization enables a much more efficient use of hardware
and it can provide us with fault tolerance,
disaster recovery, and scalability.
This also is one of the main reasons why virtualization
has become the foundation of cloud computing.
Cloud providers virtualize all the resources
that they want to make available to their customers
in order to easily manage all of those given resources.
This occurs in every model of cloud computing,
including SaaS, PaaS, and IaaS.
By using virtualization, an administrator can easily build
and then later tear down an entire cluster of systems
with a single action.
Or they can completely automate this process
in response to changes in the environmental conditions,
so that new servers will come online
during periods of high demand,
and those same servers can be remove or shut down
during periods of low demand.
To run virtual machines on a server,
the physical server must have a hypervisor installed.
The hypervisor is a software layer
that provides control between virtual machines
and the physical hardware.
It's going to manage the allocation of hardware,
control all the networking functions
and conduct all the administrative control of the systems.
There are two types of hypervisors
you're going to find out in the field,
type one and type two.
Type one hypervisors are going to run directly on the hardware
in what is known as a bare metal configuration
or deployment.
Type one hypervisors tend to be more resource efficient,
because they don't run an entire operating system
like Linux, Windows, or OS X in order to operate.
And so this frees up more physical resources
such as processing power and memory
to the virtual machines it host on that physical server.
Some good examples of type one hypervisors are VMware's ESXi
and Microsoft's Hyper-V implementations.
Type two hypervisors are going to be run as a service
on top of a locally installed operating system
such as Linux, Windows, or OS X.
These hypervisors require additional resources to operate
because they first have to load up the full operating system
and then the full hypervisor
and then the guest virtual machine
with its operating systems
in order for everything to operate.
Oracle's VirtualBox, VMware Fusion and QEMU
are examples of commonly used type two hypervisors.
Now, on Linux systems,
you'll also find KVM or kernel based virtual machines.
A KVM or kernel based virtual machine
is a Linux based virtualization solution
that can be added to most Linux distributions.
It's going to enable the management of virtual machines
on Linux platforms with attributes of both the type one
and a type two hypervisor.
KVM is really a fairly efficient way
to host virtual machines
if you're already running a Linux server
as the operating system for that physical server.
Now, when you're working with virtual machines,
it's important to create and use virtual machine templates
to make your deployments easier and more efficient.
By using predefined templates,
you can allow your administrators and end-users
to deploy servers themselves in a self-service environment
using those predefined templates
by specifying different processors, memory,
storage, and network configurations
for the virtual machines that are going to be created
and launched by those templates.
There are different template files and formats
that you might come across in the field
as a system administrator.
This includes OVF, JSON, YAML, and container images.
Now, the open virtualization format or OVF is a format
that contains the necessary configuration files, packages,
and settings for virtual machines and network devices.
These files may be used in the deployment
of virtual machines in a virtualized cloud environment
using automation and orchestration.
JSON or JSON is the JavaScript object notation format,
and it's used by most programming languages
to store information.
This makes JSON really easy to interpret
and use inside of your automations and orchestrations
whenever you're interacting with it programmatically.
The next one we have is YAML, or YAML aint markup language.
Now, the YAML format is used
to store configuration information
on newly deployed virtual machines.
YAML is commonly used by cloud service providers like AWS
to install software or create user accounts
during a virtual machine's first boot,
or by orchestration tools like Ansible
during the deployment of virtual machines.
The fourth type we have
is known as a container image template file.
And these are another format
that's used by specialized types of virtual machines
known as containers.
These container files contain everything needed
for that container,
including the applications and supporting configurations.
Now, let's talk for a minute about the boot process
and bootstrapping.
Bootstrapping refers to the adage of pulling yourself up
by the bootstraps,
which means that the operating system starts
with simple layers and then moves upwards
towards more complex functionality
as the boot process progresses.
With virtual machines, the bootstrapping steps are handled
by the virtualization layer,
and it's possible to modify the startup
and the deployment of virtual machines
during the bootstrapping sequences.
There are three ways of managing bootstrapping,
including Cloud-init, Anaconda and Kickstart.
Cloud-init is a cloud-based Linux mechanism
to customize a virtual machine during its first boot up.
This customization might include security settings,
software package installations, user and group creation
and much more.
Anaconda is another method used by many Linux distributions
to manage their deployments.
The Anaconda installer can provide prompts
to an administrator to configure the new Linux server,
or it can reference template files to customize
the installation automatically using automation.
The third type is known as Kickstart.
Now, Kickstart is another method used by Linux
to customize the installation and provide an automated
and unattended installation of new virtual machines.
The Kickstart file is going to provide all the information
about partitions, packages, user accounts,
software deployments and more
that's going to be needed to install, set up
and configure those new virtual machines.
Another area we need to cover in terms of virtual machines
is storage, because all these virtual machines need a method
to store and process their data.
With traditional physical computers,
storage capacity is provided as physical space
on a given hard disk
or partition locate on one or more storage drives.
With virtualization though,
storage capacity itself can also be virtualized
across a large RAID device or storage area networks.
And then smaller portions of that larger storage
can be presented to the virtual machines
as virtual storage devices or virtual storage drives.
The virtual storage drive is simply a file
that resides on the physical drive
like any other data file on that underlying hard drive,
but the virtual machine treats that single file
as if it was an entire physical drive.
It's going to be partitioned and given a file system,
a boot loader is going to be installed,
and an operating system is going to be deployed all inside
this virtual container of this data file.
While the virtual drive is just a file
from our perspective as system administrators,
the virtual machine truly believes
that this is a real physical device
just like any other hard disk drive.
Now, when you're deploying virtual machines,
you may be offered the option of configuring thin storage
or thick storage.
Thin storage refers to a virtual storage device file
that's going to grow on demand up to a maximum file size.
This tends to be a more efficient use of your drive space,
but it does have the drawback of having slower performance
than a thick storage system.
Thin provisioning is most appropriate
in environments where the cost
of maintaining large storage pools is much more of a concern
than the risk of temporarily running out of storage.
For example, if you're running virtual box
on your workstation to install Linux
as your virtual machine, you can choose thin provisioning
since we don't really want to use up a ton
of your hard drive space
when we initially create a virtual machine.
Thick provisioning on the other hand
is going to immediately reserve the allocated space
for use by the virtual device,
regardless of whether or not that much capacity
is actually needed.
So if you've installed a virtual machine
and set up the virtual drive
to have a one terabyte volume size,
it's actually going to create a one terabyte file immediately
during the virtual machine creation,
if you choose to use this thick provisioning.
Now, even if the initial Linux operating system
you're installing in that virtual machine
only needs eight gigabytes to install,
it's still going to go ahead
and reserve the entire one terabytes of file space.
Now, the benefit of thick provisioning
is that the performance is better
and that you're guaranteed to have the space available
whenever you need it.
But its drawback
is that you instantly used up a ton of physical disk space
even if you really didn't need it all.
Thick provisioning is most appropriate in the environments
where disruptions to the continuous storage process
presents a larger risk and you're less concerned
with increasing your storage costs
than you are with mitigating that risk.
Data can also be stored in multiple different ways
when you're interacting in the cloud.
One of these is to use a traditional SQL database
like MariaDB or MySQL.
It's also possible to store data in an unstructured manner,
which is referred to as a blob,
as Microsoft Azure likes to call it,
or a bucket, as AWS likes to call it.
Now, a blob really stands for binary large object,
and it really is the same thing we're talking
about with buckets,
which is just an example of object storage.
If you hear blob or bucket, they mean the exact same thing.
The only difference
is which cloud provider you're referring to.
Blobs are used by Azure.
Buckets are used by AWS.
Blobs and buckets can be used to store audio,
video, multimedia, and text files.
Now, the data that's actually written to the storage device,
whether it's physical or a virtual device,
are actually going to be put there in small chunks.
And we call these blocks.
These blocks are the fundamental storage areas
of your hard drive.
Now, most files are going to be too large
should be stored in a single block.
So the broken down into pieces
that are then written into these blocks.
Later on when you want to read that file,
the hard drive or storage device
is going to grab all those different blocks,
reassemble them into the complete file
and present that to you as a user.
All right, let's talk about networking and virtualization.
The virtualization hypervisor can be configured
to provide access to networking services
in several different ways.
The virtual machine can be configured
with one or more virtual NICs or network interface cards.
These virtual NICs can then be connected
to virtual switches within that hypervisor as well.
Those virtual switches can then be given access
to the host computers physical network interface card
and there's some different configuration options
that you can use.
Things like no networking.
This is an option that simulates a computer
that does not have a NIC cart at all,
and therefore, there's no network connectivity
for that virtual machine.
The internal option is where the VM is going to be connected
to a virtual switch that permits network communication
with other virtual machines connected
to that same virtual switch.
This will not allow them to have network communication
with the host operating system
or the physical network interface card,
only other virtual machines connected
to that virtual switch.
The private option allows the virtual machine
to be connected to a virtual switch
that permits network communication
with other virtual machines
and the host operating system too.
But there is no network connectivity
out to the physical NIC,
and therefore, not to the public internet.
Finally, we have the public option.
The public option is where the virtual machine is connected
to a virtual switch that permits network communication
with other virtual machines,
the host operating system and the physical NIC.
This configuration will expose the virtual machine
to the business network and to the internet
where it can then participate
as if it was a regular physical client or server.
Now, networking and virtual environments
is as flexible as it is in physical environments.
Services like network address translation, or NAT,
can still provide the same functionality in virtual networks
as they do in physical networks.
When you use NTA, it's going to be used to translate
between the reserved private IP address ranges
and the public internet accessible IP address ranges.
These virtualized networks can also be thought of
as overlay networks, especially when they're deployed inside
of a cloud environment.
The term overlay network simply means
that one network is built on top of another.
Virtualized network environments also support bridging,
which connects two networks together
into a single managed unit,
whether those are two virtual networks
or a virtual and physical network.
Now, most virtual host servers are going to run Linux
without a graphical user interface
in order to save on memory and processing resources.
Now, this is often referred to as a headless mode
because there is no graphical user interface.
Management of these virtual machines then
has to occur using a command line interface
usually by remotely accessing the virtual machines
over an SSH connection.
Alternatively though, you can use the virsh command
as an interactive shell to control the virtual machines.
This stands for virtual shell.
Now, there are various subcommands you can use
with virsh.
The help subcommand is going to be used to get help
with the virsh command.
The list subcommand is going to be used to get a list
of recognized virtual machines by the virsh command.
The shutdown VM subcommand is going to be used
to gracefully shut down a virtual machine
using this utility.
The start virtual machine subcommand
is going to be used to start a virtual machine.
The reboot virtual machine subcommand
is going to be used to reboot a virtual machine.
The create and then an XML file name subcommand
is going to create a virtual machine from an XML file
that contains all the parameters you need.
The save virtual machine file name subcommand
is going to save the current state of that virtual machine
with the given file name that you specified.
And the console virtual machine subcommand
is going to open up a console to that virtual machine,
so you can interact with it directly.
Now, Linux virtualization solutions are usually built
on top of libvirt, or libvirt,
which is an application programming interface or API
that provides the software building blocks
for developers to write their own virtualization solutions.
These solutions can also be composed of a DAMON
and a management interface
to have more of a client server model here.
There are several hypervisors, including VMware's ESXi,
KVM, and QEMU, that are all built using the libvirt
as it provides a solid foundation
for Linux based virtualization.
For example, the virsh tool that we just talked about
is actually part of the libvirt API tool set.
Now, if you're using
a graphical user based Linux distribution
that has the known desktop environment,
you can also use a graphical user interface based way
to manage your virtual machines
known as Gnome virtual machine manager or VMM.
The Gnome virtual machine manager utility
can be used from managing connectivity to virtual machines
and enable the deployment, management and removal
of those virtual machines
using a more intuitive graphical interface.
You can download and install the virt-manager package
if you want to be able to use VMM
or the virtual machine manager.
Wow.
Now, I know that was a lot of information
but the good news is that most of that
should have been reviewed
from your A+, Network+ and Security+ studies.
The only really new things we discussed here
are the different tools used in Linux
to be able to create, install, setup
and configure virtual machines, such as the file formats
of OVF, JSON, YAML, and container images,
the bootstrapping concepts that included things
like Cloud-init, Anaconda and Kickstart
as well as the Linux utilities that are used
with virtual machines such as the virsh, libvirt,
and VMM utilities.