Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
By Dor Laor
Agenda
A hypervisor needs
Ordinar
Ordinar
y
Ordinar
y
Linux
y
Linux
Process
Linux
Process
Process
User
VM
User
VM
User
VM
KVM
Modules
Driver
Linux
Driver
Driver
Hardware
KVM's bible:
Control flow
Userspace
Kernel
Guest
ioctl()
Switch to
Guest
Mode
Native Guest
Execution
Kernel
exit
handler
Userspace
exit handler
User
Address
Space
VMM userspace
code and data
phys_ram = mmap()
OR
phys_ram = malloc()
Guest physical
address space
Kernel
Address
Space
Guest VM
r
x
t
x
QEMU
tap
kernel/HV
bridge
NIC
Best throughput
Best Latency
Guest VM
t
x
r
x
QEMU
VF NIC #2
kernel/HV
VF NIC #1
Physical NIC
Guest VM
QEMU
t
x
r
x
kernel/HV
vhost
tap
bridge
NIC
Guest VM
QEMU
t
x
r
x
kernel/HV
vhost
macvtap
VF NIC #1
VF NIC #2
Physical NIC
10
Memory management
Sharing
Swapping
Page Migration: move page to closer location on NUMA node
Live Migration: move entire guest to another host
Ballooning
Backed by large pages
Transparent huge pages by the host/guest kernels
11
Page sharing
G1
G2
Kernel
12
13
pte
va1
pte
va2
0xaabbccdd...
writable
0xaabbccdd...
writable
pte
va2
0xaabbccdd...
wrprotect
14
250000
19
18
17
200000
16
15
14
150000
13
12
11
100000
Op Per Sec
10
9
8
50000
7
6
5
0
1VM-4GB
5VM-20GB
10VM-40GB
15VM-60GB
20VM-80GB
15
Status
Replaces physical host
... :)
RHEL6.0
Performance
oriented
RHEL5.4 1st release
KVM embraced
by Red Hat
KVM 'invented'
2006
16
Kvm in rhel6
Performance
CPU
Block
Qemu aio
Ext' ring entries
Qcow2
RAS
Vmchannel
CPU modeling
General
X2apic
Cgroups
Memory
Networking
Cache/batch
17
2009
250000.00
200000.00
Xen
150000.00
KVM
Bare Metal
Trans/minute
100000.00
50000.00
0.00
8cpu
16cpu
Live migration
Host A
Host B
Migrate to B
1. Setup
2. Transfer Memory
19
Algorithm
Host A
Host B
1. Setup
2. Transfer Memory
Whole Memory
1 -- 133000
20
Algorithm
Host A
Host B
1. Setup
2. Transfer Memory
VM State
3. Stop the VM
4. Transfer State
1 -- 50
21
Algorithm
Host A
Host B
Continue
1. Setup
2. Transfer Memory
3. Stop the VM
4. Transfer State
5. Continue VM
22
Scaling
KVMClock
Virtio-serial (vmchannel)
23
HW enablement (RHEL)
open source
KSM and full swapping - XEN does not have
Hybrid mode - running standard Linux apps along with Vms over VMware
Real time host kernel and micro latency
SELinux
Spice
Better latency and lower ctx-switch - Architecture advantage
over XEN.
24
KVM Support
Libvirt's xml
Qemu cmdline
Cpu consumption on host/guest
Guest type, guest up-to-date?
Qemu-kvm, host/guest kernel, seabios NVR
kvm_stat
kvmtrace
25
IO issues
Timing issues
http://cleo.tlv.redhat.com/qumrawiki/KVM/TimeKeeping
No known issues on windows
KVMclock works (up-to-date 5.5.z guest)
26
Q&A w/ beer
27