zap

39
Zap Steven Osman Dinesh Subhraveti Gong Su Jason Nieh A System for Migrating Computing Environments

Upload: cameroon45

Post on 21-May-2015

246 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Zap

Zap

Steven OsmanDinesh Subhraveti

Gong SuJason Nieh

A System for Migrating Computing Environments

Page 2: Zap

Benefits of Migration

• Dynamic Load Balancing

• Mobility

• Data Access Locality

• Improved Administration

• Fault Resilience

Page 3: Zap

Clustered System Approach

• Single system image across a cluster

• Good for load-balancingExamples include, MOSIX, Sprite

• May leave dependency on previous host

• May be new operating system or significant kernel changes

Page 4: Zap

Middleware/Language Approach

• Object-based approach using special programming language or middleware

Examples include, Abacus, Emerald, Globus, Legion, Rover

• Requires applications to be rewritten

Page 5: Zap

User-level Approach

• No operating system changes

• Good for long-running applications

Examples include, Condor, CoCheck, Libckpt, MPVM

• Does not support many common operating system services

Page 6: Zap

Virtual Machine Monitor Approach

• Support any operating system

• No application changes

Example, using VMware for migration

• Must migrate the whole operating system

• Potentially higher overhead

Page 7: Zap

Introducing Zap

• Transparent migration

• Unmodified legacy applications

• Networked applications

• Commodity operating system

• Minimal operating system changes

• Leaves nothing behind

• Low overhead

Page 8: Zap

Outline

• Background & Motivation

• Difficulties of Migration

• Zap componentsVirtualizationMigration

• Experimental Results

• Conclusion

Page 9: Zap

Migration Difficulties

int iChildPID;

if (iChildPID=fork()) {/* parent does some work */waitpid(iChildPID);

} else {/* child does some work */exit(0);

}

Page 10: Zap

Resource Consistency Problem

Host A Host B

PID 20

PID 10

Parent invoked waitpid(20)

PID 20

PID 10

PID 40

PID 30

Page 11: Zap

Host B

PID 20

Resource Conflict Problem

Host A

PID 20

PID 10

Resources May Conflict With Other Processes

PID 20PID 20

PID 10

PID 20

PID 10

Page 12: Zap

Resource Dependency Problem

Host A Host B

Child

Parent Parent

Parent and child depend on each other

Parent

Page 13: Zap

Problem Recap

Resource consistency

• Names can’t change

Resource conflict

• Names can’t be duplicates

Resource dependency

• Migration must be complete

Page 14: Zap

Solution

• Group processes into a POD (Process Domain) that has a private virtual namespace

• PODs can contain one process, one group of processes, or a whole user session

• PODs are migrated as a unit• Solves

Resource consistency problem Resource conflict problem Resource dependency problem

Page 15: Zap

Zap Architecture

Zap combines• Thin virtualization layer• Checkpoint/restart mechanism

Checkpoint/restart offers:• Easier to implement than demand paging• Leaves nothing behind• Suspend sessions• Easily configure and clone environments• Dynamic system configuration

Page 16: Zap

What Should Zap Virtualize?

• Process identifiers (PIDs)

• Inter-process communication (IPC) keys

• Memory

• File system structure

• Network connections

• Devices

Page 17: Zap

PID and IPC Key Virtualization & Migration

• Create unique namespace for the POD

• Names are virtualized

• When entering a system call, replace POD virtual identifiers with real ones

• When exiting a system call, replace real return values with POD virtual ones

• Mask out identifiers that do not belong to the POD

Page 18: Zap

Memory Virtualization & Migration

• Like IPC, create unique shared memory namespace

• Modern architectures support virtual memory

Thank you modern architectures!

Migration optimization: Move only data pages, code pages can be remapped

Page 19: Zap

File System Virtualization & Migration

• Some filenames can’t conflict:/var/run/httpd.pid

• Some directories have unique configuration:/etc

• Some directories depend on the current processes

/proc

Page 20: Zap

File System Virtualization & Migration

• Create a directory structure for POD

• Use network file systems

• Create private POD directoriesGood for /tmp, /var & POD specific

configuration

• Private /proc directory

• Private /dev directory

Page 21: Zap

Host FS

POD FS

File System Example

Use chroot() to map POD root directory

binetcpod bin NFS:/pods/bin dev Dynamic proc Dynamic tmp Private POD

Page 22: Zap

Networking Virtualization & Migration

• Two network addresses:Persistent internal addressHost-dependent external address

• For connection migration:Transport layer sees virtual addressNetwork layer sees real addressTransport layer independent Initial virtual address is real address

Page 23: Zap

NetworkADDR. 1

NetworkADDR. 2

12

Application Application

TransportADDR. 1

12 TransportADDR. 2

NetworkADDR. 1

NetworkADDR. 2

12

12=

12

21=

21

NetworkADDR. 3

NetworkADDR. 2

32

12=

32

21=

21

12=

32

21=

23

Virtual Networking

Page 24: Zap

Device Virtualization & Migration

Device migration is hard

• Pseudo Terminal

• Sound Device

• CDRW During a Recording Session

• Electron Microscope

Page 25: Zap

Device Migration & Virtualization

Pseudo Terminal Virtual device configuration+data

Sound Device Virtual device configuration

Recording CDRW Migrate later

Electron Microscope Communicate with original host

Page 26: Zap

Device Migration & Virtualization

Unsupported devices do not appear in a POD’s /dev

Zap currently supports pseudo terminals, ensuring their names are consistent after migration (e.g. /dev/pts/2)

Page 27: Zap

Zap Implementation

• Developed for Linux 2.4

• Zap design enablesLoadable kernel moduleNo need to rebuild the kernel

• Intercept system calls for virtualization

Page 28: Zap

Zap Implementation

User space

kernel space

Kernel

System Calls

User ProcessesZAP Virtualization

Zap Migration

Page 29: Zap

Virtualization Cost

• Created micro-benchmarksPID calls (getpid) IPC calls (shmget/ctl, semget/ctl)Process creation calls (fork, execve, exit)

• Used macro-benchmarksApacheBuild Linux kernelVolano

Page 30: Zap

Virtualization Results8.49

0

0.5

1

1.5

2

2.5

3

Nor

mal

ized

P

erfo

rman

ce

getp

id

shm

get+

shm

ctl

sem

get+

sem

ctl

fork

+exit

fork

+exec

ve

fork

+/bin

/sh

vola

nom

ake

apac

he

Vanilla Linuxwith PODin PODVMware

Page 31: Zap

Virtualization Results

• Zap incurs low overhead

Page 32: Zap

Migration Cost – VNC Session

Page 33: Zap

Migration Cost – Apache

• Apache 2.0.35

• Default configuration

Page 34: Zap

Migration Cost – Time0.

963

1.64

1

26.8

24

0.81

1

3.11

7

3.18

4

0.37

3

2.34

2

27.3

96

0.23

1

1.59

3

2.26

4

0.1

1

10

100

Lat

ency

(se

cond

s)

VNC Checkpoint VNC Restart ApacheCheckpoint

Apache Restart

Zap128MB VMware

384MB VMware

Page 35: Zap

Migration Cost – Space23

129.

2 385.

2

9

129.

2 385.

2

1

10

100

1000

Imag

e S

ize

(Meg

abyt

es)

VNC Image Apache Image

Zap128MB VMware

384MB VMware

Page 36: Zap

Migration Cost

• Zap can be fast

• <1 second checkpoint/restart times

• Includes Zap networking round-trip

Page 37: Zap

Zap

• Offers transparent migration of legacy and network applications

• Introduces PODsConsistencyConflict freeAvoids Unwanted dependencies

• Leaves nothing behind

• Fast and lightweight

Page 38: Zap

For more information…

• Zap computinghttp://www.ncl.cs.columbia.edu/research/migrate

• Network Computing Laboratoryhttp://www.ncl.cs.columbia.edu/

Page 39: Zap

Future Work

• Secure migrationTrusted images, POD sandbox, etc.

• Generalized device support

• Migration policies

• Heterogeneity

• Contextualization

• Resource management