intro to virtualization (part 1)
TRANSCRIPT
Intro. to Computer HardwareAs Needed for Virtualization Deployments
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
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
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
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
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
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
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
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?
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?
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).
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?
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)
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
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).
Next time
Operating System Kernel
Userland Applications????
????
1) Review:
2) Explain how platform virtualization just adds another multiplexing layer in between above two.