• No results found

Introduction to Virtualization & KVM

N/A
N/A
Protected

Academic year: 2021

Share "Introduction to Virtualization & KVM"

Copied!
25
0
0

Loading.... (view fulltext now)

Full text

(1)

Introduction to

Virtualization & KVM

By Zahra Moezkarimi

(2)

Outline

 Virtualization

– History – Overview

– Advantages and Limitations – Types of virtualization

– Virtualization and Cloud Computing

 KVM

– Overview – Features – Tools

(3)

History

 Virtualization is not a new concept

 We focus on virtualization concepts related to the data center

 60s’ IBM - CP/CMS on S360, …

 1998 VMWare

 2003 Xen

 Then KVM/Hyper-v, …

(4)

Overview

The physical server is called the host

The virtual servers are called guests

Hypervisor (Virtual Machine Manager)

(5)

Advantages and Limitations

 Advantages

 R&D (Agility, Testing)  Cost effectiveness

 Maintenance

 High Availability

 Dynamic Load Balancing  Less energy consumption  Less space

 Environmental Issues  Migration

 Limitations

 Not suitable for applications with high demands on processing power  Implementation and maintenance difficulties

(6)

Types of virtualization

What hardware we can virtualized?

Virtualization falls into three categories:

– Operating System – Storage

– Applications

(7)

Types of virtualization (Cont.)

 Operating System Virtualization  Application Server Virtualization  Application Virtualization  Management Virtualization  Network Virtualization  Hardware Virtualization  Storage Virtualization  Service Virtualization

(8)

Service Virtualization

 The macro definition of virtualization

 Delivering an application over the network  Application availability

(9)

Typical X86 virtualization approaches

 How our VMs interact with physical hardware?  Para-virtualization (PV)

– Para virtualization approach, like Xen

– Modified guest OS aware and co-work with VMM  Binary Translation (BT)

– Full virtualization approach, like VMWare – Unmodified guest OS

– Translate binary ‘on-the-fly’

(10)

Typical X86 virtualization approaches (Cont.)

Hardware-assisted Virtualization

– Full virtualization approach assisted by hardware, like KVM

– Unmodified guest OS – Intel VT-x, AMD-v – Benefits:

(11)

Virtualization and cloud computing

 Cloud vs Grid, Virtualization and Autonomic computing

 Rapid scaling of resources  Migration Concept

– Online migration – Offline migration – Virtual-to-Virtual – Physical-to-Virtual

(12)

KVM

 Overview  Features  Tools

 Qemu & KVM

(13)

KVM - overview

 Kernel-based Virtual Machine

 Linux kernel module (since 2.6.20)  Created by Quramnet

 bought by Red Hat 2008

 Supports x86 (32 and 64 bit), s390, Powerpc

 Needs a CPU with virtualization extention (Intel VT or AMD-V)

(14)

KVM – overview (cont.)

 Unmodified guest images

 Each VM has private virtualized hardware  Open source software

(15)

KVM Architecture

(16)

KVM – Features

Some KVM features include:

 CPU and memory overcommit  High performance paravirtual I/O  Hotplug (cpu, block, nic)

(17)

KVM - Tools

 libvirt (API)  Virsh  Qemu  VirtManager  Libguestfs

(18)

KVM and QEMU

 libvirt + Virtual Machine Manager GUI  choose the ‘Virt Type’ as:

– KVM – QEMU

 a grep of the process ID  The acceleration type

(19)

Hardware Acceleration

 Virtual CPU is actually emulated

 Hypervisor has to translate the instructions  performance overhead

 Modern processors support virtualization extensions

 In VT, a slice of physical CPU can be directly mapped to the Virtual CPU

 KVM enables this mapping of physical CPU to Virtual CPU  TCG: Tiny Code Generator

(20)

KVM and QEMU connection

 QEMU

– A powerful emulator

– Can emulate a variety of processor types

 KVM

– uses hardware extension

– merges its functionality to upstream Qemu

 QEMU can make use of KVM when running a target architecture that is the same as the host architecture

(21)

Set up a VM

 Have a Linux OS

 X86-64 architecture (arch)

 Intel/AMD CPU (egrep –c 'vmx|svm' /proc/cpuinfo) – vmx Intel VT

– svm AMD-V

 Check system bios (BIOS, Advanced, CPU option)

 apt-get install qemu qemu-kvm kvm virt-manager libvirt libvirt-bin bridge-utils uml-utilities

 Kvm-ok (INFO: /dev/kvm exists KVM acceleration can be used )  modprobe kvm-intel nested=1

 qemu-img create xamin.qcow2 20G

(22)

Set up a VM (Cont.)

 Network setting – brctl show – brctl addif br0 eth0 – ifconfig eth0 0.0.0.0 up – ifconfig br0 up – dhclient br0

 First time (install):

– kvm -cpu host -m 2G -hda xamin.qcow2 -cdrom xamin.iso -device e1000,netdev=net0 -netdev tap,id=net0 -enable-kvm

 Next time (boot):

– sudo kvm cpu host m 2G hda xamin.qcow2 device e1000,netdev=net0 netdev tap,id=net0 -enable-kvm

(23)

KVM and Cloud Computing

KVM as a backend for cloud solutions and

Businesses

– Openstack – OpenNebula – Eucalyptus – Vmmanager – …

(24)

Future Work

Memory virtualization approaches

I/O virtualization approaches

KVM best practices

Migration

(25)

References

Related documents