intro to virtualization (part 1)

16
Intro. to Computer Hardware As Needed for Virtualization Deployments

Upload: kiru-sengal

Post on 15-Apr-2017

102 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Intro to Virtualization (Part 1)

Intro. to Computer HardwareAs Needed for Virtualization Deployments

Page 2: Intro to Virtualization (Part 1)

What is Platform/OS Virtualization?

• The simultaneous existence of multiple entire operating systems on a single host.

• “OS virtualization” is not the only type of virtualization, but it’s what’s usually meant when we speak of virtualization

• What are other types of virtualization?– The movie inception?– Java virtual machine

Page 3: Intro to Virtualization (Part 1)

Back up: What is an Operating System?

• A program that has access to the “entire” instruction set of underlying CPU

• Controls and manages/access to underlying hardware/IO devices on host

• Provides a clean programming interfaces (system call layer) to userland processes

• Userland processes MUST use this programming interface as they do NOT have access to the entire instruction set

Page 4: Intro to Virtualization (Part 1)

Operating System Kernel sits in a Specific Spot in the Abstraction Layers of a Computing System

Transistors, Resistors, Capacitors, Inductors, ..

Logic Gates

Sequential and Combinational Logic Blocks

Electronics, Holes, Quantum Effects

Organization of logic blocks with data paths and control FSM

Instruction Set Architecture (ISA)

aka “Microarchitecture”

Operating System Kernel

Userland Applications

“System call interface”

An abstract FSM

Page 5: Intro to Virtualization (Part 1)

OS Kernel Job Functions

Transistors, Resistors, Capacitors, Inductors, ..

Logic Gates

Sequential and Combinational Logic Blocks

Electronics, Holes, Quantum Effects

Organization of logic blocks with data paths and control FSM

Instruction Set Architecture (ISA)

Operating System Kernel

Userland Applications

Hardware

Software

HW/SW interface

• User application, for security reasons, SHOULD NOT be allowed full access to the ISA• Kernel moves CPU into protected mode before running userland processes

• User applications should not have to worry about the specifics of every type of IO device• Kernel provides system call interface for IO operations, which kernel services by calling IO drivers

Page 6: Intro to Virtualization (Part 1)

Hardware (CPU, Memory, Disk, I.O.)

Operating System Kernel

Userland Applications

Hardware

Software

CONFUSED? If all those layers made no sense, at least think of abstraction layers of a computing system like….

System Call Interface

Page 7: Intro to Virtualization (Part 1)

What is Computing Hardware?

Hardware (CPU, Memory, Disk/I.O.)????

????

????

????

BUSRAM Disk

ControllerCPU Keyboard

Controller

Disk Keyboard

Network Controller

NIC

There main categories:-> Processor(s)-> Memory-> IO devices

Processor MemoryIO Devices

CPU <-> RAM can send data between each otherCPU <-> IO Controllers can send data between each otherMEM <-> IO Controllers can, for some cases of IO controllers, send data to/from mem directly This is what is known as DMA == Direct Memory Access

Page 8: Intro to Virtualization (Part 1)

Platform Virtualization• The 3 types of hardware have to be virtualized:

1. Memory Virtualization

2. CPU Virtualization

3. IO Virtualization

- Each one has to be done in a special/unique way- (No details today)

- First need to understand more about hardware layouts and how they evolved- This is needed EVEN to “use/config” virtualization setups

Page 9: Intro to Virtualization (Part 1)

Evolution (separate lower speed IO bus)

RAM

Disk Controller

CPU

Keyboard Controller

Disk Keyboard

Network Controller

NIC

Bridge / Chipset

System Bus

IO Bus

other IO controllers/cards

Discuss: How can multiple programs run at same time?

Page 10: Intro to Virtualization (Part 1)

Evolution (Symmetric MultiProcessing)

RAM

Disk Controller

Keyboard Controller

Disk Keyboard

Network Controller

NIC

Bridge / Chipset

IO Bus

other IO controllers/cards

Socket / CPU

Core

Core

Each core is an entirely separate processor that can run an entirely different program from other cores.

Discuss: How can multiple programs run at same time?

Page 11: Intro to Virtualization (Part 1)

Evolution (Simultaneous MultiThreading)

Core Logical Core

Logical Core

• With multithreading, each core can “sometimes” run parts of different instructionstreams at same time.

• Thus, operating systems are instructed to treat each core as 2 cores.OS scheduling thus has a separate “ready queue” for each logical core.

• A logical thread is also called a “HyperThread” (more of an Intel term).

Page 12: Intro to Virtualization (Part 1)

Problem:

RAM…

Socket / CPU

Core

CoreBridge / Chipset

If we keep increasing the number of cores on above socket, contention for access to RAM and IO (via chipset) increases.

Discuss: How can we solve this and still scale number of processors?

Page 13: Intro to Virtualization (Part 1)

NUMA – Non-uniform Memory Access

IO Bus

…Core

Core

IO Bus

…Core

Core

NUMA NODE 0

NUMA NODE 1

Discuss: What is the point of this? Disadvantages? (discuss PTS dpi scenario)

Page 14: Intro to Virtualization (Part 1)

Live Example• Let’s figure out all this stuff on a live

blade server• Overall view: lscpu• Raw: cat /proc/cpuinfo | less• Better: cpu_layout.py (script provided by DPDK folks

– everyone should have a copy!)• Raw numa: for i in /sys/class/net/*/device; do echo

"$i:"; cat $i/numa_node; done• Better: numactl --ardware

Page 15: Intro to Virtualization (Part 1)

Describing CPU Layouts

• You can usually describe the CPU layout of a machine with 3 numbers:– Number of sockets– Number of cores per socket– Number of lcores per core

• This is 1 if SMT is not available• This is 2 if SMT is available

From these 3 numbers can you determine the number of total lcores on the system? (hint: multiply).

Page 16: Intro to Virtualization (Part 1)

Next time

Operating System Kernel

Userland Applications????

????

1) Review:

2) Explain how platform virtualization just adds another multiplexing layer in between above two.