Virtualization Concepts and Applications: Yash Jain Da-Iict (DCOM Research Group)
Virtualization Concepts and Applications: Yash Jain Da-Iict (DCOM Research Group)
Yash Jain
DA-IICT
(DCOM Research Group)
Virtualization
Multi-tasking, Multi-threading
And Virtualization
Multi-tasking
HyperThreading
Virtualization
Definitions
Virtual Machines
that
provides
an
operating
Definitions (cont..)
Hypervisor
Definitions (cont<)
Virtual Machine Monitor
Recent articles use the terms like hypervisor and virtual machine
monitor interchangeably, but they are separated two in conceptual
model.
Software that runs in a layer between host operating system and one
or more virtual machines that provides the virtual machine
abstraction to the guest operating systems.
hardware.
Virtualization
availability
through
dynamic
Virtualization
VM
Ap
p
Ap
p
OS
App
App
VMM
VM1
VM2
VM3
Ap
p
Ap
p
Ap
p
OS
OS
OS
Operating System
Hypervisor / VMM
Hardware
Hardware
Concept 1
Concept 2
Web Server
App Server
DB Server
Windows
Linux
Linux
Windows
IIS
Glassfish
MySQL
Exchange
10
Web Server
App Server
DB Server
Windows
DOWN!
Linux
Windows
MySQL
Exchange
IIS
11
unit that includes the hardware, the OS, the storage, and the
applications.
12
13
Pros
Easy to conceptualize
Fairly easy to deploy
Easy to backup
Virtually any
application/service can
be run from this type of
setup
14
between
Guest OS and hardware
15
16
17
Cons
Resource pooling
Slightly harder to
Highly redundant
conceptualize
Highly available
Reconfigurable while
services are running
Optimizes physical
resources by doing more
with less
19
Why to virtualize?
Types of Virtualization
physical form
Native virtualization.
Types of Virtualization
Hardware Support
Much of the virtualization overhead today are due to processors not being
designed with virtualization in mind
E.g. Intel x86: 17 problematic instructions, E.g.: POPF instruction for setting
interrupt flag.
which code can execute. Ring 0 has the highest level privilege and is
where the operating system kernel normally runs. Code executing in
Ring 0 is said to be running in system space, kernel mode or
supervisor mode. All other code such as applications running on the
operating system operate in less privileged rings, typically Ring 3.
Rings in virtualization
Traditional systems
Operating system runs in privileged mode in Ring 0 and
owns the hardware
Applications run in Ring 3 with less privileges runs in
privileged mode in Ring 0
Virtualized systems
VMM Guest OS inside VMs are fooled into thinking they
are running in Ring 0, privileged instructions are trapped
and emulated by the VMM
Newer CPUs (AMD-V/Intel-VT) use a new privilege level
called Ring -1 for the VMM to reside allowing for better
performance as the VMM no longer needs to fool the
Instructions do not satisfy this, E.g.: POPF instruction for setting interrupt
flag.
SGDT, SIDT, PUSHF, POPF........
Binary Translator
Guest
Code
Translator
TC
Index
Translatio
n
Cache
Callouts
CPU
Emulation
Routines
Basic Blocks
Guest Code
vPC
mov
ebx, eax
cli
and
ebx, ~0xfff
mov
ebx, cr3
Straight-line code
sti
ret
Control flow
Basic Block
Binary Translation
Guest Code
vPC
mov
ebx, eax
cli
Translation Cache
mov
ebx, eax
call
HANDLE_CLI
and
ebx, ~0xfff
and
ebx, ~0xfff
mov
ebx, cr3
mov
[CO_ARG], ebx
sti
call
HANDLE_CR3
ret
call
HANDLE_STI
jmp
HANDLE_RET
start
Binary Translation
Guest Code
vPC
mov
ebx, eax
cli
Translation Cache
mov
ebx, eax
mov
[CPU_IE], 0
and
ebx, ~0xfff
and
ebx, ~0xfff
mov
ebx, cr3
mov
[CO_ARG], ebx
sti
call
HANDLE_CR3
ret
mov
[CPU_IE], 1
test
[CPU_IRQ], 1
jne
call
HANDLE_INTS
jmp
HANDLE_RET
start
test
eax, 1
jeq
Translation Cache
test
eax, 1
jeq
add
ebx, 18
call
END_BB
mov
ecx, [ebx]
call
END_BB
mov
[ecx], eax
ret
start
eax, 1
jeq
vEP
C
Translation Cache
test
eax, 1
jeq
add
ebx, 18
call
END_BB
mov
ecx, [ebx]
call
END_BB
mov
[ecx], eax
add
ebx, 18
mov
ecx, [ebx]
mov
[ecx], eax
call
HANDLE_RET
ret
eax == 0
find
next
eax, 1
jeq
vEP
C
Translation Cache
test
eax, 1
jeq
add
ebx, 18
jmp
mov
ecx, [ebx]
call
END_BB
mov
[ecx], eax
add
ebx, 18
mov
ecx, [ebx]
mov
[ecx], eax
call
HANDLE_RET
ret
eax == 0
eax, 1
jeq
vEP
C
Translation Cache
test
eax, 1
jeq
add
ebx, 18
jmp
mov
ecx, [ebx]
call
END_BB
mov
[ecx], eax
add
ebx, 18
mov
ecx, [ebx]
mov
[ecx], eax
call
HANDLE_RET
mov
[ecx], eax
call
HANDLE_RET
ret
eax == 1
find
next
eax, 1
jeq
vEP
C
Translation Cache
test
eax, 1
jeq
add
ebx, 18
jmp
mov
ecx, [ebx]
jmp
mov
[ecx], eax
add
ebx, 18
mov
ecx, [ebx]
mov
[ecx], eax
call
HANDLE_RET
mov
[ecx], eax
call
HANDLE_RET
ret
eax == 1
PC Synchronization on interrupts
Performance Overheads.
Improved performance.
How It Works..?
There are two modes to run under virtualization: root operation and nonroot operation. Usually only the virtualization controlling software, called
Virtual Machine Monitor (VMM), runs under root operation, while operating
Memory Virtualization
Second-level mapping:
Memory Virtualization
46
Memory Virtualization
I/O Virtualization
I/O Virtualization architecture consists of
Guest driver
Virtual device
Real device
I/O Virtualization(Contd..)
Virtualization I/O stack
I/O Virtualization(Contd..)
Scheduling
The OVF could also help IT managers understand how virtual machines have
been changed throughout their lifecycle. For instance, if a VM template is cloned
and that clone has changed from the master template, IT managers need to
know what has changed to be able to troubleshoot performance problems on the
VM.
Case Study
Qualcomm started a Server Consolidation Project in the first half of 2003. Today, 60% of
Qualcomms x86 environment is virtualized (1900 total servers/1150 are virtualized).
The number of physical servers has grown from 950 to 1900 over the past 2.5 years, and
because of the much simplified provisioning with virtualization, they have been able to
maintain the same number of server admin's today. They provision 68 new
VM's/month. This would be impossible in the physical world without dramatic staffing
increases. Which means that the number of physical servers a single sys admin can
manage has more than doubled. This translates into substantial operational savings for
the company.
In aggregate, they've saved $4.5M over 3 yrs with VMware. This calculation doesn't
include the additional cost for storage in the virtual world (all VM's are SAN connected
now), but it also doesn't include the cost savings from power, cooling etc.
Virtualization in cloud
A Cloud is a type of parallel and
distributed system consisting of a
collection
of
interconnected
and
virtualized
computers
that
are
dynamically provisioned and presented
as one or more unified computing
resources
based
on
service-level
agreements (SLA) established through
negotiation between the service provider
and consumers.
control a VMs lifecycle. It manages the VM image and storage, the network
fabric (such as DHCP) services to tie in VMs with the environment, and
hypervisors which create and control the VM. It can deploy groups of virtual
machines to be treated as a single unit.
References
1.
2.
3.
4.
5.
6.
References (Cont<)
I/O Architectures for Virtualization, Mallik
Mahalingam, VMWare Inc.
8.
Virtual Machines : Memory Virtualization, Scott
Devine, VMWare Inc.
9.
Resource Management for Virtualized Systems , Carl
Waldspurger, VMWare Inc.
10. Cloud Computing: Concepts And Applications, Prof
Sanjay Chaudhary, DA-IICT
11. Intel Virtualization Technology (VT) Explained,
available at
http://www.hardwaresecrets.com/printpage/263
12. Open Virtualization Format for Virtual Machines,
available at
http://www.vmware.com/appliances/gettingstarted/learn/ovf.html
7.