• 沒有找到結果。

WHAT IS VIRTUALIZATION?

N/A
N/A
Protected

Academic year: 2022

Share "WHAT IS VIRTUALIZATION?"

Copied!
49
0
0

加載中.... (立即查看全文)

全文

(1)

VIRTUALIZATION

虛擬化

(2)

WHAT IS VIRTUALIZATION?

把一台系統切成很多獨立的小系統

(3)

WHY VIRTUALIZE?

有什麼好處 ?

(4)

MULTI PLATFORM

一台電腦可以同時跑不同的作業系統

(5)

ISOLATION

隔離不同的使用者或服務

(6)

小明寫系程作業把工作站 搞爆了

大家一起死

(7)

小明把系上分給他的 VM 搞爆了

只有小明交不出作業

(8)

CONSOLIDATION

增加硬體使用率、降低成本

(9)

小公司架了 WEB, MAIL, FT P, SCM, 每台機器只用 5%

花很多冤枉錢

(10)

所有服務集中到一台,總 共用 20%

只買一台,省了 75% 的花費

(11)

硬體也是要人照顧的

少點機器,少點人力

(12)

EASY DEPLOYMENT

一個映像檔跑天下

(13)

HIGH AVAILABILITY

硬體壞了, VM 馬上搬到下一台去跑

(14)

VIRTUALIZE WHAT?

硬體、儲存空間、網路

(15)

HARDWARE VIRTUALIZATIO N

三大宗

(16)

FULL VIRTUALIZATION

完全模擬一台機器必備的硬體

VMware, VirtualBox, Hyper-V, KVM, QEMU…..

(17)

FULL VIRTUALIZATION 之 HARDWARE ASSISTED

Full Virtualization 很吃資源,有 CPU 幫忙比較 好

Xen HWM

(18)

PARAVIRTUALIZATION

透過軟體 (Hypervisor) 處理需要虛擬化的指令

效能高,但 OS 要客製化。

Xen, VMware VMI

(19)

OS-LEVEL VIRTUALIZATION

OS 裡面隔出不同的房間

同個屋簷下,會被鄰居吵到 同一棟房子 ( 同一種 OS) LXC, OpenVZ, FreeBSD Jails….

(20)

NO VIRTUALIZATION

大通鋪,床位先搶先贏,搶輸了站門外

(21)

XEN

External Hypervisor

(22)
(23)

WHAT’S GOOD ABOUT XEN?

Mature products and 3

rd

party support Can also be installed with Linux

API and easy to use tools

(24)

THE NOT SO GOOD

Can only use tools

RedHat dropped support

(25)

XEN PRODUCTS

Citrix XenServer

Citrix Cloud Platform Oracle VM

(26)

KVM

KERNEL VIRTUAL MACHINE

Included in mainstream Linux Kernel

(27)
(28)

MAINSTREAM KERNEL

Get it with every Linux kernel

A set of kernel interfaces and APIs QEMU frontend

(29)

EACH VM IS A PROCESS

Each virtual CPU core is a thread

VM Scheduling, Memory management, Hardware drivers – all provided by Linux

Take advantage of Linux features: KSM, Hugepages

(30)

HOW TO USE KVM?

/usr/bin/kvm -enable-kvm -m 1024 -smp 1 -drive file=linux.img

(31)

SERIOUSLY?

/usr/bin/kvm -S -M pc-1.1 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name list -uuid 6865eebb-e6aa-c7f8-499a-d3ba663b5dd4 -nographic -nodefconfig -nodefaults -chardev

socket,id=charmonitor,path=/var/lib/libvirt/qemu/list.monitor,server,nowait -mon

chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb- uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/mnt/qcow/list.qcow2,if=none,id=drive-virtio-

disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio- disk0,bootindex=1 -netdev tap,fd=26,id=hostnet0 -device

rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:5f:68:2a,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

(32)

WAY TOO UGLY!!

Anything better?

(33)

LIBVIRT

A toolkit to interact with many common virtualization systems.

(34)

VIRSH

CLI tool included with Libvirt

Manipulate libvirt and underlaying VMs with commands and XML files

(35)

EXAMPLE: STOP VM

# virsh stop test-vm

(36)

EXAMPLE: CREATE VM

Create definition XML file

http://libvirt.org/formatdomain.html

# virsh create VM.xml

(37)

DON’T LIKE XML?

(38)

VIRT-INSTALL

CLI tool for creating/importing and installing VMs

(39)

EXAMPLE: CREATE VM

# virt-install \

--name demo \ --ram 512 \

--disk /home/user/VMs/mydisk.img \

--import

(40)

CREATE AND INSTALL

# virt-install \

--virt-type kvm \ --name demo \

--ram 512 \

--disk path=/vm/demo.img,size=20 \

--cdrom /dev/cdrom

(41)

DON’T LIKE CLI?

Are you serious?

(42)

VIRT-MANAGER

GUI frontend for libvirt

(43)
(44)
(45)

EXTRA STUFF TO MANAGE

Networking LVM storage

Libvirt can do it for you

(46)

References

• http://libvirt.org/

• http://www.linux-kvm.org/page/HOWTO

(47)

Homework

• Install a virtual machine host

• Xen, KVM, or even ESXi is OK. You pick.

• Use libvirt to manage it

• Create and install a Linux guest.

• You decide the parameters (CPU, disk, etc.).

• You can use the tools mentioned today, or anything else.

(48)

Homework Submission

• Mail the following (as content, not attachment) to me

• Libvirt domain (guest) xml file

• # virsh dumpxml YOUR_DOMAIN

• Command outputs from guest

• # lspci

• # dmidecode –t system

• File contents from guest

• /proc/cpuinfo

(49)

Homework Grading

• This is an all or nothing assignment.

• The purpose of this assignment is to let you exercise building and managi ng a VM host and guest.

• If something is wrong with the data you submitted, I can not confirm you did so, hence no credit.

• 1 grade lower if you give me wrong format (as attachment)

參考文獻

相關文件

 Calling program stores return address in a specific register.

² Stable kernel in a goals hierarchy is used as a basis for establishing the architecture; Goals are organized to form several alternatives based on the types of goals and

When we know that a relation R is a partial order on a set A, we can eliminate the loops at the vertices of its digraph .Since R is also transitive , having the edges (1, 2) and (2,

6. To complete the ‘What’s Not’ column, students need to think about what used to be considered a fashionable thing to do, see, listen to, talk about and is no longer

Courtesy: Ned Wright’s Cosmology Page Burles, Nolette & Turner, 1999?. Total Mass Density

• An algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output.. • An algorithm is

In digital systems, a register transfer operation is a basic operation that consists of a transfer of binary information from one set of registers into another set of

• Supports program binaries compiled for a different instruction set than the. host hardware 