Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
47 views

Lecture 02 Introduction To Compute Virtualization - Part 1

Uploaded by

kokomicheal57
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Lecture 02 Introduction To Compute Virtualization - Part 1

Uploaded by

kokomicheal57
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Introduction to Compute

Virtualization – Part 1
Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Foreword

⚫ Cloud computing 1.0 focused on virtualization which today has become


the foundation of cloud computing. This chapter focuses on the
architecture and technologies involved in compute virtualization.

Page 1 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Objectives

⚫ Upon completion of this chapter, you will:


 Be able to describe what virtualization is.

 Understand the differences between virtualization and cloud computing.

 Understand KVM technology.

Page 2 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Contents

1. Introduction to Virtualization
 CPU Virtualization

 Memory Virtualization

 I/O Virtualization

2. Introduction to KVM

Page 3 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
What’s a Virtual Machine (VM)?

How is a virtual
machine
created?

Page 4 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
What’s a Virtual Machine (VM)?

⚫ A virtual machine (VM) is software that runs programs or applications without


being tied to a physical machine. In a VM instance, one or more guest machines
can run on a host computer.

⚫ Each VM has its own operating system, and functions separately from other VMs,
even if they are located on the same physical host.

⚫ Multiple VMs can share resources from a physical host, including CPU cycles,
network bandwidth and memory.

Page 5 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
What’s Virtualization?

Page 6 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
What’s Virtualization?

⚫ Virtualization converts physical servers into logical folders or files. These folders or
files can be divided into two parts: those that store VM configuration information,
and those that store user data.

⚫ Virtualization allows OSs and applications to run on virtual machines (VMs).

Page 7 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
What’s Virtualization?

⚫ Virtualization is a technology that simulates hardware functionalities and creates


multiple VMs on a physical server.

⚫ Virtualization allows VMs that reside on the same physical server to run
independent OSs. This way, multiple OSs can concurrently run on the same
physical server.

Page 8 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Importance of Virtualization

⚫ Without virtualization, running multiple primary application programs in the same


operating system of a physical server may cause runtime conflicts and
performance bottlenecks.

⚫ Running only one application on a dedicated server could solve these problems
but will easily cause low resource utilization.

⚫ With virtualization, multiple VMs can run on a single physical server, and each VM
can run an independent OS. This improves resource utilization.

Page 9 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
A Brief History of Compute Virtualization

2007 2014
HP launched HP-UX Rocket was launched.
1964 Integrity VMs. 2008
IBM began to Microsoft added

explore virtualization 2006 Hyper-V in Windows 2013


on mainframes. Server 2008 R2.
Qumranet first Docker was launched.
1972 announced KVM. 2008
IBM launched VMs Linux Container LXC

running on 2002 was launched. 2011


mainframes. Xen was officially IBM, Red Hat, HP, and
1999 open sourced. 2008 Intel formed the Open

By default, RHEL 6.0 Virtualization Alliance


VMware launched x86-
supported KVM as the to accelerate KVM
based virtualization
only virtualization option. adoption.
products.

Page 11 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Important Concepts in Compute
Virtualization
Guest OS:
Physical Server Virtual Machine
Operating system running in a virtual machine
Application Application (VM)

Guest Machine:
Host OS Guest OS
Virtual machine created through virtualization

Hypervisor:
Guest Machine
Virtualization software layer, or
Virtual Machine Virtual Machine Monitor (VMM)
Monitor
(Hypervisor)
Host OS:

Host Machine Host Machine Operating system running in a physical machine

Host Machine:

Physical machine
Page 12 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Important Concepts in Compute
Virtualization

⚫ A host machine is a physical computer that can run multiple VMs, and an OS
installed and running on the host machine is a host OS.

⚫ VMs running on a host machine are called guest machines.

⚫ The OS installed on VMs is called a guest OS.

⚫ The core of virtualization technology between the host OS and guest OS is a


hypervisor, which is sometimes called Virtual Machine Manager (VMM).

Page 13 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Important Concepts in Compute
Virtualization

⚫ In a physical architecture (Traditional), a host has only two layers from bottom to
top: hardware (host machine) and host OS. Applications are installed in the host
OS.

⚫ In a virtualization architecture, a host has more layers from bottom to top:


hardware (host machine), hypervisor, guest machine, and guest OS. Applications
are installed in the guest OS. Multiple guest machines can be created and run
on a single host machine.

Page 14 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Types of Compute Virtualization

⚫ The hypervisor (VMM) provides the following basic functions:

 Identify, capture, and respond to privileged CPU instructions or protection instructions


sent by VMs.

 Schedule VM queues and return physical hardware processing results to related VMs.

 VMM also provisions VMs for running the guest OS. Therefore, VMM also supports
creation and management of virtual environments.

 In other words, the hypervisor manages all resources and virtual environments. VMM
can be seen as a complete OS born for virtualization to control all resources (CPUs,
memory, and I/O devices).

Page 15 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Types of Compute Virtualization

App App

App App App Guest OS Guest OS

Guest OS Guest OS Guest OS VM VM

VM VM VM App VMM

VMM Host OS

Hardware Hardware

Bare-Metal Virtualization Hosted Virtualization


(Type 1) (Type 2)

Page 16 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Types of Compute Virtualization

⚫ A Type 1 hypervisor is also called a bare-metal hypervisor:

⚫ This type of hypervisor has direct access to hardware resources and does not need to
access the host OS. The hypervisor can be seen as a customized host OS, which
merely functions as VMM and does not run other applications.

⚫ The virtualization products that use Type 1 hypervisors include VMWare ESX Server,
Citrix XenServer, and FusionCompute.

Page 17 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Types of Compute Virtualization

⚫ In Type 1 virtualization, the hypervisor is dedicated to converting host resources


into virtual resources for the guest OS to use. The guest OS runs as a process on
the host. Therefore, such hypervisors are called bare-metal hypervisors.

⚫ Type 1 hypervisors have the following advantages and disadvantages:

 Advantages: VMs can run different types of guest OSs and applications
independent of the host OS.

 Disadvantages: The kernel of the virtualization layer is hard to develop.

Page 18 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Types of Compute Virtualization

⚫ A Type 2 hypervisor is also called a hosted hypervisor:

⚫ Physical resources are managed by the host OS (for example, Windows or Linux).
VMM provides virtualization services and functions as a common application in
the underlying OS (for example, Windows or Linux).

⚫ VMs can be created using VMM to share underlying server resources. VMM
obtains resources by calling the host OS services to virtualize the CPUs, memory,
and I/O devices.

⚫ After a VM is created, VMM usually schedules the VM as a process of the host OS.

Page 19 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Types of Compute Virtualization

⚫ Type 2 hypervisors have the following advantages and disadvantages:

 Advantages: They are easy to implement.

 Disadvantages: Since a Type 2 hypervisor shares CPU, RAM, storage, and


network bandwidth from the underlying physical infrastructure with a host OS,
the amount of resources a Type 2 hypervisor has access to is limited compared
to that of a Type 1. The performance overheads are high.

Page 20 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Types of Compute Virtualization

⚫ Unlike a Type 1 hypervisor, a Type 2 hypervisor is only a program in the host


OS. All hardware resources are managed by the host OS.

⚫ The virtualization products that use Type 2 hypervisors include VMware


Workstation and Virtual PC.

Page 21 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Characteristics of Virtualization

Guest OS Guest OS Guest OS

Host OS

Partitioned Isolated
Encapsulated Independent
VM VM

Page 22 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Characteristics of Virtualization

⚫ Both Type 1 and Type 2 hypervisors possess the partitioning, isolation, encapsulation, and
hardware independence features.

⚫ Partitioning: indicates the VMM capability of allocating server resources to multiple VMs.
Each VM can run an independent OS (same as or different from the OSs running on other
VMs on the same server) so that multiple applications can coexist on one server.

⚫ Each OS gains access only to its own virtual hardware (including the virtual NIC, virtual
CPUs, and virtual memory) provided by VMM. The partitioning feature solves the following
problems:

 Resource quotas are allocated to each partition to prevent resource overuse by


virtualization.

 Each VM has an independent OS.

Page 23 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Characteristics of Virtualization

⚫ Isolation: Multiple VMs created in a partition are logically isolated from each
other. The isolation feature solves the following problems:

 Even if one VM crashes due to an OS failure, application breakdown, or driver


failure, it should not affect the others on the same server.

 It seems that each VM locates at an independent physical machine. If a VM is


infected with worms or viruses, the worms and viruses are isolated from other
VMs.

 You can specify the minimum and maximum resource usages for each VM to
prevent a VM from exclusively occupying all resources in the system.

Page 24 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Characteristics of Virtualization

⚫ Encapsulation: Each VM is saved as a group of hardware-independent files,


including the hardware configuration, BIOS configuration, memory status, disk
status, and CPU status. You can copy, save, and move a VM by copying only a few
files.

⚫ This is because encapsulating a VM as a set of hardware-independent files makes


VM migration possible.

Page 25 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Characteristics of Virtualization

⚫ Hardware independence: After a VM is encapsulated into a group of files, the VM


is completely independent from its underlying hardware. You can migrate the VM
by copying the VM device file, configuration file, or disk file to another host.

Page 26 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Characteristics of Virtualization

⚫ Hardware independence: The migration can be successful as long as the same


VMM running on the target host as that on the source host, regardless of the
underlying hardware specifications and configuration

⚫ This is similar to editing a Word file by using Office 2007 on computer A that runs
a Windows 7 system and then copying the Word file to computer B that runs a
Windows 10 system. You only need to check whether Office 2007 is installed on
computer B and do not need to check the CPU model or memory size of the
underlying hardware.

Page 27 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Compute Virtualization

⚫ Compute virtualization includes

 CPU virtualization,

 memory virtualization,

 and I/O virtualization.

Page 28 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization
Full virtualization Paravirtualization

Application Application
Ring 3 Ring 3

Ring 2 Ring 2

Paravirtualized
Guest OS
Guest OS
Ring 1 Ring 1

Hypervisor Hypervisor
Ring 0 Ring 0

Hardware Hardware

Page 29 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization

⚫ There is hierarchical protection domains of CPUs, often called protection rings.


There are four rings: Ring 0, Ring 1, Ring 2, and Ring 3, which is a hierarchy of
control from the most to least privilege.

⚫ Ring 0 has direct access to the hardware. Generally, only the OS and driver have
this privilege.

⚫ Ring3 has the least privilege. All programs have the privilege of Ring 3.

Page 30 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization

⚫ To protect the computer, some dangerous instructions can only be executed by


the OS, preventing malicious software from randomly calling hardware resources.

⚫ For example, if a program needs to enable a camera, the program must request a
Ring 0 driver to do that on its behalf. Otherwise, the operation will be rejected.

Page 31 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization

⚫ The OS on a common host sends two types of instructions: privileged


instructions and common instructions.

 Privileged instructions are instructions used to manipulate and manage key


system resources. These instructions can be executed by programs of the
highest privilege level, that is, Ring 0.

 Common instructions can be executed by programs of the common privilege


level, that is, Ring 3.

Page 32 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization

⚫ Full virtualization:

⚫ Full virtualization was first proposed and implemented by Vmware.

⚫ All OS requests sent by VMs are forwarded to VMM, and VMM performs binary translation
on the requests. When VMM detects privileged or sensitive instructions, the requests are
trapped into VMM for emulation.

⚫ Then, the requests are scheduled to the CPU privilege level for execution. When VMM
detects program instructions, the instructions are executed at the CPU non-privilege level.

⚫ This technique is called full virtualization because all request instructions sent by VMs
need to be filtered.

Page 33 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization

⚫ Full virtualization has the following disadvantages:

 Modifying the guest OS binary code during running causes large performance
loss and increases the VMM development complexity.

 Xen developed the paravirtualization technique, which compensates for the


disadvantages of full virtualization.

Page 34 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization

⚫ Paravirtualization:

⚫ If the guest OS can be modified to be able to aware that it is virtualized, the VM


OS uses the Hypercall to replace sensitive instructions in the virtualization with the
hypervisor layer to implement virtualization.

⚫ Non-sensitive instructions such as privileged and program instructions are directly


executed at the CPU non-privilege level.

Page 35 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
CPU Virtualization

⚫ Paravirtualization has the following advantages:

⚫ Multiple types of guest OSs can run at the same time. Paravirtualization delivers
performance similar to that of the original non-virtualized system.

⚫ Its disadvantages are as follows:

⚫ The host OS can be modified only for open-source systems, such as Linux. Non-
open-source systems, such as Windows, do not support paravirtualization. In
addition, the modified guest OS has poor portability.

Page 36 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Memory Virtualization

VM1 VM2 VM3 VM4

VM memory
Host
memory

Page 37 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Memory Virtualization

⚫ Memory virtualization is a process of centrally managing the physical memory of a


physical machine and aggregating the physical memory into a virtualized memory
pool available to VMs.

⚫ Memory virtualization creates a new layer of address spaces, that is, the address
spaces of VMs. The VMs are made to believe that they run in a real physical
address space when in fact their access requests are relayed by VMM.

⚫ VMM stores the mapping between guest machine address spaces and physical
machine address spaces.

Page 38 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Memory Virtualization

⚫ Memory virtualization involves the translation of three types of memory addresses: VM


memory address (VA), physical memory address (PA), and machine memory address (MA).

⚫ The following direct address translation path must be supported so that multiple VMs can
run a physical host: VA (virtual memory) → PA (physical memory) → MA (machine memory).

⚫ The VM OS controls the mapping from the virtual address to the physical address of the
customer memory (VA → PA).

⚫ However, the VM OS cannot directly access the machine memory. Therefore, the
hypervisor needs to map the physical memory to the machine memory (PA → MA).

Page 39 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Quiz

1. In compute virtualization, which of the following allocates CPU and memory


resources to VMs? ( )

A. Guest OS
B. VMM

C. Hypervisor

D. Host OS

2. All open-source virtualization technologies are type 1 virtualization, while all


closed-source ones are type 2 virtualization.
A. TRUE

B. FALSE

Page 40 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Recommendations

⚫ Huawei e-Learning website


 http://support.huawei.com/learning/Index!toTrainIndex

⚫ Huawei Support case library


 http://support.huawei.com/enterprise/servicecenter?lang=en

⚫ HCIA-Cloud Computing v4.0 online forum


 https://forum.huawei.com/enterprise/en/Huawei-Official-Communication-
Channel-HCNA-Cloud-Certification-Course/thread/456287-911

Page 41 Copyright © 2019 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com

You might also like