0% found this document useful (0 votes)
18 views49 pages

Understanding Server Virtualization

Uploaded by

Ral Ralte
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views49 pages

Understanding Server Virtualization

Uploaded by

Ral Ralte
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Server Virtualization

Types of Virtualization

• Server Virtualization
• Storage Virtualization
• Network Virtualization
• Desktop Virtualization
• Application Virtualization
• OS-level Virtualization

2
Server Virtualization

Wikipedia Definition
Partitioning of physical server
into number of small virtual
servers

Uses Virtualization Software and


hardware virtualization
techniques

In most cases the servers are


not utilized fully which results
in inefficient usage
Why Server Virtualization

Less Resource Utilization

High Cost Power

Consumption Server

Downtime of server

High Infrastructure
History of Server Virtualization
1970s 1990s 2000s

Back to
Evolution
IBM virtualization to
of
Mainframes reduce Capex
Personal
with and Opex
Computers
Virtualization (2000s)
(1990s)
IBM Mainframes
Personal Computer Evolution
Server Virtualization
Physical Server vs Virtual Server
Components of Server Virtualization

• Virtual Machine
 Software Implementation of
a machine that executes
program like a physical
machine.
APP APP APP APP
Guest Operating Guest Operating
• Host Operating System System System

 Operating System actually Virtual Virtual


running in the server / Machine Machine
hardware
Hypervisor / VMM

Host Operating System


• Guest Operating System
 The Operating System
running in the simulated Hardware -- “real machine”
virtual machine

• HyperVisor or VMM
 The Operating System running
in the simulated virtual machine
Virtual Machine
APP APP APP APP

System Virtual Machine Operating


System
Operating
System
Full Virtualization VMs run Simulated Simulated
directly on the server Machine Machine
infrastructure without any
general purpose OS Virtual Machine Monitor (VMM)

Hardware -- “real machine”

APP APP APP APP


Operating Operating Process Virtual Machine?
System System Needs host operating system
Simulated Simulated Virtual Machine running as a
Machine Machine process in the host OS
Host Operating System

Hardware -- “real machine”


Server Virtualization Components

Server
Virtualization

CPU Memory I/O Device


Virtualization Virtualization Virtualization
CPU Virtualization
CPU Virtualization
What is CPU Virtualization?
• Single CPU acting as if there are more than 1 CPU in the
system
• Most instructions are executed directly on the physical CPU
• The Hypervisor / VMM safely performs privileged instructions

14
CPU Virtualization Components

CPU
Virtualization

Hardware
Full Para
Assisted
Virtualization Virtualization Virtualization

Bare Metal Bare Metal /


Type 2 Type 1 Type 2
/ Type1 Type1
Hypervisor Hypervisor Hypervisor Hypervisor Hypervisor
Full Virtualization

• In full virtualization, the guest


OS is completely abstracted
from the underlying
infrastructure
• The guest OS is not aware that
it is virtualized and thinks it is
running on the real hardware
• This approach uses binary
translation and direct
execution techniques
• VMWare ESXi and Microsoft
Virtual Server are examples of
full virtualization solution.

16
Pros
 This approach provides the best isolation and security for
the VMs.
 Different OSs can run simultaneously.
 It is easy to install and use and does not require any
change in the guest OS.

Cons
 Binary translation is an additional overhead, and it
reduces the overall system performance.
 There is a need for correct combination of hardware and
software

17
Para Virtualization
• This approach is also known as
partial virtualization or OS-assisted
virtualization
• Hyper calls to virtualization layer
replaces non virtualized OS
requests
• The main difference between the
full virtualization and para
virtualization is the guest OS knows
that it is running in virtualized
environment
• In full virtualization, guest OS does
not know that it is in virtual
environment.
• Citrix Xen hypervisor is the best
Example of para- virtualization
18
Pros
 It eliminates the additional overhead of binary
translation and hence improves the overall system
efficiency and performance.
 It is easier to implement than full virtualization as there is
no need for special hardware.
• Cons
 There is an overhead of guest OS kernel modification.
 The modified guest OS cannot be migrated to run on
physical hardware.
 VMs suffer from lack of backward compatibility and are
difficult to migrate to other hosts

19
Hardware-Assisted Virtualization

• In the two previous approaches,


there is an additional overhead of
binary translation or modification
of guest OS to achieve
virtualization.
• But in this approach, hardware
vendors itself, like Intel and AMD,
offer the support for virtualization,
which eliminates much overhead
involved in the binary translation
and guest OS modification
• Microsoft’s Hyper-V is example for
this approach

20
Pros
 It reduces the additional overhead of binary
translation in full virtualization.
 It eliminates the guest OS modification in para
virtualization.
Cons
 Only new-generation processors have these capabilities.
All x86/x86_64 processors do not support hardware-
assisted virtualization features.
 More number of VM traps result in high CPU overhead,
limited scalability, and less efficiency in server
consolidation.

21
Comparisons of CPU Virtualization

22
Multithread Vs Multicore Vs CPU Virtualization

Multithread Multicore

CPU Virtualization
Memory(RAM) Virtualization
• Virtual memory virtualization is similar to the virtual memory support provided by modern
operating systems
• In a traditional execution environment, the operating system maintains mappings of virtual
memory to machine memory using page tables, which is a one-stage mapping from
virtual memory to machine memory
• All modern x86 CPUs include a memory management unit (MMU) and a translation
lookaside buffer (TLB) to optimize virtual memory performance
• However, in a virtual execution environment, virtual memory virtualization involves sharing
the physical system memory in RAM and dynamically allocating it to the physical
memory of the VMs.

24
Memory Virtualization
What is Memory Virtualization?
• Abstracts the physical memory resources in a virtualized server.
• Handles the physical memory, virtual memory of both guest and host OS and
maintains mapping between these entities.
• Two stage mapping: virtual memory virtualization involves mapping between virtual
memory of guest operating system to physical memory of guest operating system
along with the mapping of physical memory of guest operating system to the machine
memory
• The first mapping will be maintained by guest OS and the second mapping will
be maintained by the hypervisor
• Memory virtualization architecture

26
• Each page table of the guest OSes has a separate
page table in the VMM corresponding to it, the
VMM page table is called the shadow page table
• MMU already handles virtual-to-physical
translations as defined by the OS
• VMware uses shadow page tables to perform
virtual-memory-to-machine-memory address
translation.
• Processors use TLB hardware to map the virtual
memory directly to the machine memory to avoid
the two levels of translation on every
VMM maintains shadow page tables :
Direct virtual-to-physical address mapping
Use hardware TLB for address translation

Memory
Virtualiz
ation

28
Map guest virtual address to host physical address
Shadow page table
• Guest OS will maintain its own virtual memory page table in the
guest physical memory frames.
• For each guest physical memory frame, VMM should map it to
host physical memory frame.
Shadow
• Shadow page table maintains the mapping from guest virtual
address to host physical address.
Page table protection Page
• VMM will apply write protection to all the physical frames of
Table
guest page tables, which lead the guest page table write
exception and trap to VMM.
I/O Virtualization

 involves managing the routing of I/O requests


between virtual devices and the shared
physical hardware
 three ways to implement I/O virtualization:
full device emulation
para-virtualization
direct I/O
 Full device emulation: All the functions of a
device or bus infrastructure, such as device
enumeration, identification, interrupts, and
DMA, are replicated in software
I/O Virtualization

I/O
Virtualization

Para-
Emulated I/O virtualized Direct I/O
I/O
Emulated I/O
I/O
operation
QEM Guest
Host U VM MMIO or
OS I/O PIO
emulatio
Guest OS
(Linux n

) vCPU vCPU
User Interrupt Tra
space p
Kernel KVM (kernel module)
space
Native
drivers

• Software emulates real hardware device


• VMs run same driver for the emulated hardware device
• Trap  hypervisor  I/O emulator (e.g., QEMU)
• Every I/O operation generates trap and emulation
• Poor performance
new Ready Runni
ng

block Waiti
ed ng or
I/O
Para-Virtualized I/O
QEM I/O
Guest
Host U VM
operation
Shared descriptor
OS VirtIO
ring: Optimization by
Backen
(Linux d
VirtIO
Fronten Guest batching I/O requests
) d OS  Reducing
User vCPU vCPU VMM
space intervention cost
Kernel KVM (kernel module)
space
Native
drivers

• Split driver model


• Front-end driver in a guest VM
• Virtual driver to forward an I/O request to its back-end driver
• Back-end driver in a host OS
• Request a forwarded I/O to HW via native driver
Direct I/O
I/O
operation
QEM Guest
Host U VM MMIO or
OS I/O PIO
emulatio
Guest OS
(Linux n

) vCPU vCPU
User
space
Kernel KVM (kernel module)
space
Native
drivers

• Directly assign device to Guest

• High performance and low CPU utilization

33/32
Server Virtualization

CPU virtualization
Memory Virtualization
Storage or I/O Virtualization
Server virtualization venders
Xen
First developed in University of Cambridge Computer Laboratory.
As of 2010 the Xen community develops and maintains Xen as free
software, licensed under the GNU General Public License (GPLv2).
Implement para-virtualization.

KVM ( Kernel-based Virtual Machine )


A Linux kernel virtualization infrastructure.
Vender
As of 2010, KVM supports native virtualization using Intel VT-x or
AMD-V
ESXi
s and
Projects
The company was founded in 1998 and is based in Palo Alto,
California. The company is majority owned by EMC Corporation.
Implement both type-1 and type-2 VM.
Xen

Basic properties :
Para-virtualization
Achieve high performance even on its host architecture (x86) which has a
reputation for non-cooperation with traditional virtualization techniques.
Hardware assisted virtualization
Both Intel and AMD have contributed modifications to Xen to support their
respective Intel VT-x and AMD-V architecture extensions.
Live migration
Xen
The LAN iteratively copies the memory of the virtual machine to the
destination without stopping its execution.

Implement system:
Ubuntu
Novell's SUSE Linux Enterprise 10
Red Hat's RHEL 5
Sun Microsystems' Solaris
Para-virtualization in Xen

Xen extensions to x86 arch


Like x86, but Xen invoked for privileged instructions
Avoids binary rewriting
Minimize number of privilege transitions into Xen
Modifications relatively simple and self-contained

Modify kernel to understand virtualized environment


Wall-clock time vs. virtual processor time
Desire both types of alarm timer
Expose real resource availability
Enables OS to optimize its own behaviour
Original Xen Architecture

Original
Xen
Architec
ture
Hardware Assistance in Xen

Hardware assistance :
• CPU provides VMExit for certain privileged instructions
• Extend page tables used to virtualize memory

Xen features :
• Enable Guest OS to be run without modification
Hardwa
For example, legacy Linux and Windows
• Provide simple platform emulation
re
BIOS, apic, iopaic, rtc, Net (pcnet32), IDE emulation
• Install para-virtualized drivers after booting for high-performance IO
Assista
• Possibility for CPU and memory para-virtualization
Non-invasive hypervisor hints from OS
nce in
Xen
New
Xen
Architec
ture
KVM( Kernel-based Virtual Machine)

 Linux host OS
 The kernel component of KVM is included in mainline Linux, as of
2.6.20.
 Full-virtualization
 KVM is a full virtualization solution for Linux on x86 hardware
KVM
containing virtualization extensions (Intel VT or AMD-V).
 Using KVM, one can run multiple virtual machines running
unmodified Linux or Windows images.
 IO device model in KVM :
 KVM requires a modified QEMU for IO virtualization framework.
 Improve IO performance by virtio para-virtualization framework.
KVM (Kernel Virtual Machine)

KVM (Kernel VM)


Hardware Assisted Virtualization
infra for linux on X86

Requires hardware containing


virtualization extensions (Intel
VT or AMD-V)

Open Source Software under


GPL license

Two Components: Kernel


Component part of mainline
linux for 2.6.20. User
Component (part of Qemu)

By itself, KVM does not perform any emulation. It exposes


/dev/kvm interface for virtualization
KVM
KVM Installation

 Check your CPU has hardware virtualization


support – either Intel VT-x or AMD-V.
 egrep -c ‘(svm|vmx)’ /proc/cpuinfo should return a value 1 or more

 Install KVM, lib-virt, linux bridge utilities and GUI


based virt-manager
 sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager

 Run the command to add your user account to


the libvirt group
 sudo adduser name libvirtd
Basic QEMU-KVM CLI Commands

 qemu-kvm options disk_img


 qemu-kvm -name “Telsites" -M pc-0.12 -m 512 -cpu kvm64 -smp
2
/images/[Link]

 qemu-kvm -hda /images/[Link] -net nic -net user

 qemu-kvm -hda /images/[Link] -hdb /images/[Link] -


hdc \
/images/[Link] -hdd /images/[Link]
VMware ESX Server Architecture

VMware
ESX
Server
Architec
ture
Thank you

You might also like