Introduction to virtualization

  • Motivation - What virtualization allows us.
  • Basic concepts - What is virtualization
  • How virtualization works
  • What is Docker

Why virtualization?

Virtualization serves as a catalyst for enhancing various aspects of the IT landscape:

  • Facilitation of Infrastructure Management: Simplifies the management of hardware resources, making it more efficient and flexible.
  • Facilitating Development: Streamlines the development process by providing isolated environments for testing and debugging.
  • Facilitating Application Deployment: Eases the deployment process by encapsulating applications and their dependencies.

Virtualization erases the differences between systems.

  • The application can be "downloaded" between systems on the fly.
  • The application can run on several systems at the same time.
  • One system can serve several applications at once.

It is possible to rent only part of the machine resources.

Virtual infrastructure can be completely different from physical infrastructure.

Portability

Application dependency management

The same or almost the same application runs in different conditions.

  • If I change the HW, I don't have to change the SW
  • If I change the OS, I don't have to change the SW

Ensuring portability increases the cost of product development and maintenance.

Customers demand portability.

The virtualization layer is programmable

The virtualization layer is programmable

It allows you to easily:

  • create a machine (allocate resources),
  • cancel the machine,
  • start or stop the machine,
  • clone or move machine.

What is virtualization

Virtualization

is the layer separating the guest operating system and physical hardware.

+----------------+
| HOST HW and OS |
+----------------+
        ^
        |
+----------------+
| Virtualization |
+----------------+
        ^
        |
+------------------+
| GUEST OS and APP |
+------------------+

Virtual computer

Creates a separate "world" for the application:

  • Virtual memory,
  • Virtual processor,
  • Virtual network and graphics card, etc.

Where does virtualization run?

Hardware Virtualization: Runs on a virtual processor, allowing the execution of programs for any architecture and OS, albeit slower.

Paravirtualization: Runs on a physical processor with faster performance but limited to programs for the same architecture, requiring BIOS support.

Virtualization at the Operating System Level: Runs in a dedicated space, utilizing host OS services, limiting compatibility to the same operating system.

How to start a virtual machine?

  • hypervisor
  • virtual machine monitor
  • container manager

Hypervisor

The virtualization layer is part of the Host OS, e.g. VM Ware ESX, Xen, Qemu / KVM, ProxMox

    +----------+
    | HW HOST  |--------+
    +----------+        |
          ^             |
          |             |
   +------------+ +---------+
   | Hypervisor | | Host OS |
   +------------+ +---------+
          ^
          |
+------------------+
| GUEST OS and APP |
+------------------+

Virtual machine monitor

Monitor is one of the Host OS applications, e.g. Virtual Box

   +------------+ +----------+
   | HOST OS    |-| Guest HW |
   +------------+ +----------+
          ^
          |
+------------+
| VM Monitor |
+------------+
          ^
          |
+------------------+
| GUEST OS and APP |
+------------------+

Container manager

A layer of the host operating system that creates a "cage" in which one or more processes run.

  • The application in the container uses only the Host OS kernel.
  • Everything else is virtualized with a thin layer.

Container manager

   +------------+ +----------+
   | HOST OS    |-| Guest HW |
   +------------+ +----------+
        ^
        |
+-------------------+
| Container Manager |
+-------------------+
        ^
        |
     +-----+
     | APP |
     +-----+

Docker

Docker is a set of platform as a service (PaaS) products
that use OS-level virtualization to deliver software in packages called containers.

Docker Components

  • docker client
  • docker daemon
  • image registry

Each component can run on a different machine. Components communicate with each other using an application protocol.

Docker Components

   +------------+
   | registries | Docker Hub
   +------------+
        || (image)
   +----------+
   | daemon   | Host machine
   +----------+
        || (protocol)
   +------------+
   | cli client | Host or manager machine
   +------------+

Docker client

The 'docker' command in the command line.

  • runs on any OS.
  • communicates with the docker daemon using its own protocol.
  • we can control the daemon with it - control and manage containers.

Primarily running on Linux OS or Docker Machine, the daemon is responsible for executing containers based on instructions.

Docker daemon

  • (mostly) run on Linux OS or Docker Machine.
  • takes care of running containers, starts or stops them according to instructions.

Virtualization vs. containerization.

Comparing virtualization and containerization, virtualization has certain disadvantages:

  • Lower efficiency compared to containerization.
  • More challenging resource management, as the operating system struggles to dynamically allocate resources to multiple virtual machines.
  • Data and application separation challenges.

Even the browser is a virtual machine

How do I start a virtual machine?

on your PC

  1. I will install a virtual machine monitor.
  2. I get a disk image of the virtual machine.
  3. Configure the virtual machine (allocate resources).
  4. I will start the virtual machine.

Cloud virtualization

  • cloud.tuke.sk.
  • Azure Virtual Machines.
  • Google Compute Engine.
  • Amazon Elastic Compute Cloud.

Resources

Reload?