Top Banner
Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Based on the slides of Prof. Roy Campbell & Prof Reza Farivar EE 660: Computer Architecture Cloud Architecture: Virtualization
39

EE 660: Computer Architecture Cloud Architecture ...

Mar 21, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: EE 660: Computer Architecture Cloud Architecture ...

Yao ZhengDepartmentofElectrical Engineering

UniversityofHawaiʻiat Mānoa

BasedontheslidesofProf.RoyCampbell&ProfRezaFarivar

EE660:ComputerArchitectureCloudArchitecture:Virtualization

Page 2: EE 660: Computer Architecture Cloud Architecture ...

Agenda

• IntroductiontoVirtualization• ImplementationsofVirtualization• OSbasedVirtualization:Xen• Containers:Dockers

Page 3: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Sharing Resources

• Economics of Clouds requires sharing resources

• How do we share a physical computer among multiple users?

• Answer: Abstraction• Introduce an abstract model of what a

generic computing resource should look like• The physical computer resource then

provides this abstract model to many users

Page 4: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Layersof Abstraction

• Introduce an abstract model of whata generic computing resource should look like

• The physical computer resource thenprovides this abstract model to many users

• Virtualization avoids creating dependencies on physical resources

Page 5: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Layersof Abstraction

• Introduce an abstract model of whata generic computing resource should look like

• The physical computer resource thenprovides this abstract model to many users

• Virtualization avoids creating dependencies on physical resources

Page 6: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Virtualization:FoundationofCloudComputing

• Virtualization allows distributed computing models without creating dependencies on physical resources

• Clouds are based on Virtualization• offer services based mainly on virtual machines, remote

procedure calls, and client/servers• provide lots of servers to lots of clients (e.g. phones)

• Simplicity of use and ease of programming requires allowing client server paradigms to be used to construct services from lots of resources

Page 7: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Typesof virtualization

• Native, full• Hardware assisted• Para-virtualization• OS level

• Containers• Jails• Chroot• Zones• Open-VZ à Virtuozzo

Page 8: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

NativeandFull Virtualization

• the virtual machine simulates enough hardware to allow an unmodified "guest" OS (one designed for the same CPU) to be run in isolation.

• Examples:• VirtualBox• Virtual PC• Vmware• QEMU

Guest GuestOS OS

Apps Apps

Hypervisor (VMM)Hardware

Management

…..

Page 9: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Hardwareenabled virtualization

• the virtual machine has its own hardware and allows a guest OS to be run in isolation.

• Intel VT (IVT)• AMD virtualization (AMD-V)• Examples:

• VMware Fusion• Parallels Desktop for Mac• Parallels Workstation

…..

Hardware

Apps

Guest Guest GuestOS OS OS

Apps Apps

Hardware VM Hardware VM

Page 10: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Paravirtualization

ModifiedGuest OS Manag

ement

…..

Hypervisor (VMM)Hardware

Stub

ModifiedGuest OS

Stub

• the virtual machine does not necessarily simulate hardware, but instead (or in addition) offers a special API that can only be used by modifying the "guest" OS.

• Examples:• XEN

Apps Apps

Page 11: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Operating system-levelvirtualization

• virtualizing a physical server at the operating system level, enabling multiple isolated and secure virtualized servers to run on a single physical server.

• Examples:• Linux-Vserver• Solaris Containers• FreeBSD Jails• Chroot• CGroups

PrivateServer

PrivateServer

PrivateServer…..

Operating System

Hardware

Page 12: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

The“Software-defined Network”

Simple PacketForwardingHardware

Simple PacketForwardingHardware

Simple PacketForwardingHardware

Simple PacketForwardingHardware Simple Packet

ForwardingHardware

NetworkOperating System

1.Openinterfaceto hardware

3.Well-definedopen API

App App App

2.Atleastonegoodoperating systemthatisextensibleandpossiblyopen source

Page 13: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

TrendVirtualizedOS +Virtualized Network

Windows(O(OSS))

Mac

x86(Computer)

WWininddoowwss(OS)

AppApp

LLininuuxxLinux OOSSMMaacc

OS

Virtualization Layer

App

Computer Industry

AppApp

Virtualizationor “Slicing”

App

OpenFlow

NCOCoXonntrtorolllelerr11(Network OS)

CCoonntrtorolllelerrN2e2tworkOS

Network IndustrySimplecommonstablehardwaresubstratebelow+programmability+strongisolationmodel+competitionabove=faster innovation

Page 14: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Trend— ThenAdd VirtualizedStorage

Linu Mac

x86(Computer)

WWininddooWwiwnsdsows(O(SO(O)SS))

AppApp

LinuLxinxux OOSS

MMaaccOS

Virtualization Layer

App

Computer Industry

AppApp

“Slicing”

App

OpenFlow

CCoonnttrroollllNOX(Neeerrtw11orkOS)

CCoonnttrroollleleNrretworkO22S

Network Industry

AppApp

Controller

Virtualization

App

Distributed FSStorageAreaNetwork

CCoonntrtorolllelerr11HDFSControllerH2B2ase

Storage Industry

Page 15: EE 660: Computer Architecture Cloud Architecture ...

Agenda

• IntroductiontoVirtualization• ImplementationsofVirtualization• OSbasedVirtualization:Xen• Containers:Dockers

Page 16: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Typesof Virtualization

• Native, full• Hardware assisted• Para-virtualization• OS level

• Containers• Jails• Chroot• Zones• Open-VZ à Virtuozzo

Page 17: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

• The virtual machine simulates enough hardware to allow an unmodified "guest" OS (one designed for the same CPU) to be run in isolation.

• Examples:• VirtualBox• Virtual PC• Vmware• QEMU• Win4Lin• XEN/Virtual Iron

NativeandFullVirtualization

Page 18: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

HardwareEnabled Virtualization

• The virtual machine has its own hardware and allows a guest OS to be run in isolation.

• Intel VT (IVT)• AMD virtualization (AMD-V)• Examples:

• VMware Fusion• Parallels Desktop for Mac• Parallels Workstation

Page 19: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Partial Virtualization

• The virtual machine simulates multiple instances of much (but not all) of an underlying hardware environment, particularly address spaces.

Page 20: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Paravirtualization

• The virtual machine does not necessarily simulate hardware, but instead (or in addition) offers a special API that can only be used by modifying the "guest" OS.

• Terminologies• Hypervisor, hypercall• Enomalism

• Examples:• XEN, KVM, Win4Lin 9x

Page 21: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

OperatingSystem-Level Virtualization

• Virtualizing a physical server at the operating system level, enabling multiple isolated and secure virtualized servers to run on a single physical server.

• Examples:• Parallels Workstation• Linux-VServer, Virtuozzo• OpenVZ, Solaris Containers• FreeBSD Jails• Chroot ?

Page 22: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

OperatingSystem-Level Virtualization

• Hypervisor (VM)• OnerealHW,manyvirtualHWs,many Oss

• Highversatility– canrundifferent Oss

• Lowerdensity,performance,scalability

• <<Lowers>> are mitigated bynew hardware features (such asVT-D)

• Containers (CT)• OnerealHW(novirtualHW),onekernel,manyuserspaceinstances

• Higherdensity,natural page

• Dynamicresource allocation• Nativeperformance:[almost]no overhead

sharing

Page 23: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

ThinnerContainers,BetterPerformance

• Containers• Share host OS and drivers• Have small virtualization layer• Naturally share pages

• Hypervisors• Have separate OS plus virtual hardware• Hardware emulation requires VMM state• Have trouble sharing guest OS pages

• Containersaremoreelasticthan hypervisors• ContainerslicingoftheOSisideallysuitedtocloud slicing

• Hypervisors’ only advantage in IaaS is support for different OSfamilies on one server

Page 24: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

10

WhatIstheTrade-Off?

Page 25: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Feature Comparison

11

Hypervisor ContainerMultiple Kernels XLoad Arbitrary Modules XLocal Administration AllLive Migration OpenVZLive System Update X Zap

Page 26: EE 660: Computer Architecture Cloud Architecture ...

Agenda

• IntroductiontoVirtualization• ImplementationsofVirtualization• OSbasedVirtualization:Xen• Containers:Dockers

Page 27: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Xen3.0Guest VM

Page 28: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

•Driver Domain•MapVirtual Devices•CFQfor disk•HTBfor network

Xen3.0Guest VM

Page 29: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

I/O Path•ProcesstoGuest OS•GuestOSto IDD

Xen3.0Guest VM

Page 30: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Security Isolation•Hypervisor•AccessPhysical Level

•PCI Address•Virtual Memory

Xen3.0Guest VM

Page 31: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Security Isolation•Hypervisor•AccessPhysical Level

•PCI Address•Virtual Memory

Resource Control•Hypervisor

•Allocate Resources•Schedule VMs

Xen3.0Guest VM

Page 32: EE 660: Computer Architecture Cloud Architecture ...

Agenda

• IntroductiontoVirtualization• ImplementationsofVirtualization• OSbasedVirtualization:Xen• Containers:Dockers

Page 33: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Overview

• “Docker containers wrap up a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries –anything you can install on a server. This guarantees that the software will always run the same, regardless of its environment it is running in.”(Docker Inc., n.d.)

Page 34: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Overview

• Docker automates the deployment of applications inside software containers

• Additional layer of abstraction and automation of operating system–level virtualization on Linux.

Page 35: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Historyof Docker

• SolomonHykesstartedDockerinFranceasaninternalprojectwithindotCloud,aplatform-as-a-servicecompany

• Dockerwasreleasedasopensourcein13March 2013• libcontainerlibrarywrittenintheGoprogramminglanguage.• Latestversion1.11.2(31May 2016)• Dockerteam,RedHat,IBM,Google,CiscoSystemsandAmadeusITGroup.

Page 36: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Docker Structure

Page 37: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Containersbuiltwith Docker

Page 38: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Basicsof Docker

ComponentA’s

Docker File

Source CodeRepository

DockerEngine

DeveloperLinux Host

ContainerA

DockerContainerImageRegistry

DestinationLinuxHost

Docker

ContainerB

ContainerC

Build

ContainerA

Push

search

PullRun

Page 39: EE 660: Computer Architecture Cloud Architecture ...

Spacereservedfor videoDonotputanything here

Changesand Updates

App A

Bins +Libs

App

𝛻𝛻 DockerContainerImageRegistryA

pp

𝛻𝛻

App A

Bins +Libs

Docker Engine

App A”

Bins +Libs

Docker Engine

DiffspackagedinUpdateContainer

Original Container

Get UpdateUpdatecopiesofcontainer