Title : Are Containers VMs? ===========================
Hello and welcome to the Podman on Oracle Linux 8 series.
A previous video provided a high-level description of what a container is, this video will briefly
outline the following:
Why use Virtualisation?
An overview of how Virtual Machines work
An overview of how Containers work.
So with that in mind lets's dive in...
Prior to using virtualisation, business applications ran on physical hardware which required large
centrally located servers that multiple users could interact with.
Over time, more servers often need to be added as the number of users increases.
This caused the business to invest more time, pressure and expense in both the IT, and the
end-user, departments.
So as virtualisation became more popular, many IT departments invested in Virtual Management
(VM) technology such as Oracle Linux VM on the server, or VirtualBox on the desktop/department.
Virtual Machines (VMs) work by emulating the hardware required to run the Operating System
and software, however the user's are unaware that they are not actually connecting to a
physical machine.
Because businesses can install several VM-based applications, even using different Operating
Systems, on the same physical hardware they save costs, time and effort within the IT
department.
However VM's are not very portable - should the need arise to move them, that is.
So when Docker burst on the scene back in 2013 and made the packaging and configuring
of applications running on Linux far easier than ever before, using Containers really
took off.
The huge benefit provided by Containers, is that they virtualise just the Operating System
environment, and not the hardware as well - unlike VMs.
Each Container ships together with everything it needs in order to run properly once deployed.
So let's look first at how Virtual Machines work.
Well, the first thing to know is there are two types of Virtual Machine software available;
Type 1 & Type 2.
First up - the Type 1 virtualisation stack which is usually deployed on to the central
IT servers (e.g. Oracle Linux VM).
This comprises of the hardware
Followed by the Hypervisor; which is highly specialised software responsible for emulating
the hardware (CPU, RAM, Disk & NICs).
Which then builds, and runs, the Virtual Machine deployed on to it.
This Virtual Machine is comprised of the following: Operating System, Dependencies, Application
Next up is the Type 2 virtualisation stack, this is what you may have installed on your
laptop (e.g: Virtual Box).
It is almost identical to Type 1, except this time the Hypervisor software (e.g. VirtualBox),
is installed on top of an Operating System rather than directly on to the hardware.
Now let's consider how Containers differ from Virtual Machines.
Just like Virtual Machines, Containers require some physical hardware, followed by a Linux
install (to utilise the functionality Linux provides to run Containers) followed by the
Container, or Containers, that are to be deployed.
So let's compare the requirements to run Containers directly with those required for Type 2 Virtual
Machines.
Do you notice the difference between the actual contents of a Container and Virtual Machine
shown inside the red boxes? The Virtual Machine packages more than a container - why is that?
Let me go into a little more detail (but not too much I promise).
First up all Operating Systems comprise of two 'layers' - Layer 1 & Layer 2
Layer 1 is the 'Operating System Kernel' - on Linux, if you keep it fully updated, this
is often the same version whatever distribution you are using.
Layer 2 is the 'Application Layer' - again on Linux this comprises what makes Oracle
Linux into Oracle Linux, and other variants what they are. In other words this can be
different.
Microsoft Windows also has the same architecture, however the Kernel Layer is not available
for vendors to package their own versions of Windows by altering what ships in the Application
Layer.
So a Virtual Machine is much larger than a Container, because it has to package both
Layer 1 & Layer 2 together with any Dependencies, and the Application.
Unlike a Container, which only requires Layer 2 to be packaged along with the Application.
This difference, means that Containers start up much faster than Virtual Machines because
there is no need to start an underlying Operating System.
On the other hand with Virtual Machines it is possible to run any Operating System on
top of any other Operating System.
So why are Containers so popular these days?
Well on the plus side, their portability and ease of updating, or scaling, make using them
much easier for businesses to deploy & manage.
However, as their deployment footprint grows, it can become harder to retain control over
important aspects such as security and compliance.
This where software such as Kubernetes has become popular as it helps to address problems
with deploying, scaling and managing containers in large environments.
But covering that is out of scope for this video.
For now though, I hope this overview of how a container differs from a virtual machine
has helped.
Please stay tuned for future videos in this Podman series as there is plenty more that
can be covered in future episodes (videos in this series)
So many thanks for watching.
For additional information on Oracle Podman please access the Oracle Linux documentation,
or Oracle Linux learning library.