程序代写代做代考 AWS Lecture 5: Virtualization Basics

Lecture 5: Virtualization Basics
Sambit Sahu, IBM Research

Reading Materials
§ VMWare virtualization concepts: https://www.youtube.com/watch?v=EvXn2QiL3gs
§ Xen: Art of Virtualization: https://www.cl.cam.ac.uk/research/srg/netos/papers/2003-xensosp.pdf
§ RedHat Virtualization: https://www.redhat.com/en/topics/virtualization § https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/
2

Physical Machines/ Virtual Machines/ Containers
3

4

5

6

7

8

9
Types of Virtualization
§ Hardware emulation
– Most complex: a hardware VM is created for each instance
§ Full Virtualization
– Uses hypervisor to share underlying hardware across guest VMs – Mediates between guest OS and underlying h/w
§ Paravirtualization
– Differs from full virtualization in that integrates virtualization handling code into OS – thus
the guest OS code is modified
§ Operating system level virtualization
– Virtualizes server on top of operating systems – Single OS that isolates the servers

Hypervisor and VMM
§ Hypervisor runs on bare metal machine
§ Functionality/role of hypervisor is dependent of
type of virtualization
§ So what is required in supporting virtualization, i.e., Hypervisor manages virtual machine monitors
running multiple OS instances on a single
machine?
– OS typically has all the privilege, ring 0-3
– Need to somehow not allow all the OS instances to
run at ring 0, but still be able to function as OS
§ Solution
– Hypervisor runs at ring 0
– OS runs at higher layer than ring 0, but lower than
user applications
– OS level instructions that required ring 0 privilege à
need to be now run by hypervisor instead!
10

Three types of virtualization (for CPU)
§ Depending on how hypervisor handles the critical instructions from OS (ring 0), there are different virtualization methods
– Full virtualization using binary translation
– OS assisted virtualization or Paravirtualization – Hardware assisted virtualization
11
Full Virtualization
Para Virtualization
H/W Assisted Virtualization

Memory Virtualization
§ Memory virtualization requires further virtualization of OS level virtual memory
– Another level of MMU virtualization that maps multiple MMU into physical memory
12

13
Device and I/O Virtualization
§ Requires managing the routing of I/O requests between virtual devices and shared physical hardware
§ Example: Virtual Network Interface and switches § Virtual devices emulate the physical devices

Comparison of Three Virtualization Methods
14

Iterative Memory Copy for Live Migration
15

Deconstructing Amazon EC2 request machine API
§ User goes to Amazon EC2 portal and specifies desired parameters for a machine – Resource: CPU, mem, disk
– Stack: OS and possibly with additional software
§ Amazon AWS Cloud manager (resource pool manager) provisions the user request – Finds appropriate physical resource
– Dispatches the request to virtualization manager on the identified resource
– Cloud Manager invokes EC2 API to provisions the request
§ Virtualization manager on physical server
– Copies the pre-built software stack (virtual appliance)
– Provisions a guest VM and configures parameters (IP address, access rules,…) at run/boot time
§ Cloud manager returns login credentials to user
2. Cloud manager processes request
3. Identifies physical server where to instantiate
4. Virtualization mgr on the server launches a VM, copies virtual appliance and boots the VM with appropriate run-time configuration
Physical Resource Pool
1. User requests a machine with a desired Software stack, access rules
6. User is provided instance details
5. Login credentials for user
para
16

17
Key building blocks
§ Cloud manager
§ Virtual machine
§ Virtual appliance
§ Configuring virtual appliance at run to meet the configuration parameters

18

19

20

21

Another important application of Virtualization
§ Note that virtual machines are created on demand by issuing requests to hypervisor
§ Virtual machines can be moved from one physical server to another in real time!
§ VMWare vMotion management software
lets one move running virtual machines in
real time from one server to another – Opens up lot of interesting scenarios – Zero down-time maintenance and/or
upgrades
– Dynamic workload balancing
22
Moving all VMs from server A to server B

Deconstructing Amazon EC2 request machine API
§ User goes to Amazon EC2 portal and specifies desired parameters for a machine – Resource: CPU, mem, disk
– Stack: OS and possibly with additional software
§ Amazon AWS Cloud manager (resource pool manager) provisions the user request – Finds appropriate physical resource
– Dispatches the request to virtualization manager on the identified resource
– Cloud Manager invokes EC2 API to provisions the request
§ Virtualization manager on physical server
– Copies the pre-built software stack (virtual appliance)
– Provisions a guest VM and configures parameters (IP address, access rules,…) at run/boot time
§ Cloud manager returns login credentials to user
2. Cloud manager processes request
3. Identifies physical server where to instantiate
4. Virtualization mgr on the server launches a VM, copies virtual appliance and boots the VM with appropriate run-time configuration
Physical Resource Pool
1. User requests a machine with a desired Software stack, access rules
6. User is provided instance details
5. Login credentials for user
para
23

Virtual Appliance
§ How was Amazon EC2 able to start a (virtual) server with a software stack such as Operating System (win203, SUSE linux 32- bit, LAMP stack etc.) almost instantly?
– User is able to choose from a list of available pre-built stack
§ Virtual Appliance
– A virtual machine image file consisting of
pre-built/installed software bundled with
operating system
– Built in a such a manner that virtual
machine boots from this pre-bundled
stack
– Install once and replicate many times
§ Benefit
– No need to install the software as long
as same virtual machine technology
used
– Removes the need for time consuming
installation and configuration of software
24

VMWare Virtual Appliance Demo
§ http://download3.vmware.com/media/vam/vam_demo.html
25
VMWare Virtual Appliance Marketplace

26

27

28

29

30

31

32

33

34
Reference Materials
§ ESXi: http://www.vmware.com/products/vsphere-hypervisor/ § vSphere: Mastering VMWare vSphere 5.5 – Scott Lowe
§ vCloud: http://www.vmware.com/products/vcloud-suite

Monolith vs Micro-Services
35

36

37

38

Dockers and Containers
39
§ More light weight and runs as user space processes § Containers provide the separation