Professional Documents
Culture Documents
- التفاعل بالحاسب
326كهح
Spring 2023
VIRTUALIZED DATA
CENTER – COMPUTE
Class
ic
Data
Cent
Copyright © 2011 EMC Corporation. All Rights Reserved. 4 er
Virtualized Data Center Virtualized Data Center
(VDC)
Virtualize
Network
Virtualize
Storage
Virtualize
Compute
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 5
Module 3: Virtualized Data Center –
Compute
Upon completion of this module, you should be able to:
• Describe compute virtualization
• Discuss the compute virtualization techniques
• Explain the virtual machine (VM) components
• Describe resource management and resource
optimization techniques
• Describe the process to convert physical machine to VM
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 6
Module 3: Virtualized Data Center –
Compute
Lesson 1: Compute Virtualization Overview
Topics covered in this lesson:
• Drivers for compute virtualization
• Types of hypervisor
• Benefits of compute virtualization
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 7
Compute Virtualization
Compute Virtualization
It is a technique of masking or abstracting the physical compute
hardware and enabling multiple operating systems (OSs) to run
concurrently on a single or clustered physical machine(s).
• Enables creation of multiple
virtual machines (VMs), each
running an OS and application
VM is a logical entity that
looks and behaves like Virtualization Layer
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 8
Compute Virtualization
Virtualization Layer
x86 Architecture
Cent
er –
Com
Copyright © 2011 EMC Corporation. All Rights Reserved. 9 pute
Need for Compute Virtualization
Hypervisor
x86 Architecture
x86 Architecture
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 12
Hypervisor
• It has two key components: kernel and VMM:-
1.A hypervisor kernel provides the same functionality as other
operating systems, such as process creation,
creation file system
management, and process scheduling.
scheduling It is designed to specifically
support multiple virtual machines and to provide core
functionalities, such as resource scheduling, I/O stacks,
stacks etc.
2.The Virtual Machine Monitor is responsible for actually executing
commands on the CPUs and performing Binary Translation (BT).
A Virtual Machine Monitor abstracts hardware to appear as a physical
machine with its own CPU, memory, and I/O devices. Each virtual
machine is assigned a Virtual Machine Monitor that has a share of the
CPU, memory, and I/O devices to successfully run the virtual machine.
When a virtual machine starts running, the control is transferred to the
Virtual Machine Monitor, which subsequently begins executing
instructions from the virtual machine.
Copyright © 2011 EMC Corporation. All Rights Reserved. Classic Data Center 13
Types of Hypervisor
APP
Hypervisor
Hypervisor
x86 Architecture
Operating System
x86 Architecture
CPU NIC Card Memory Hard Disk CPU NIC Card Memory Hard Disk
Type 2: Hosted Hypervisor
Type 1: Bare-Metal Hypervisor
• Server consolidation
• Isolation
• Encapsulation
• Hardware independence
• Reduced cost
Virtu
alize
d
Data
Cent
er –
Com
Copyright © 2011 EMC Corporation. All Rights Reserved. 16 pute
Benefits of Compute Virtualization
• Server Consolidation: it enables running multiple virtual
machines on a physical server. This reduces the requirement for
physical servers.
• Isolation: While virtual machines can share the physical
resources of a physical machine, they remain completely
isolated from each other as if they were separate physical
machines. If, for example, there are four virtual machines on a
single physical machine and one of the virtual machines
crashes,
crashes the other three virtual machines remain unaffected.
unaffected
• Encapsulation: A virtual machine is a package that contains a
complete set of virtual hardware resources, an operating
system, and applications. Encapsulation makes virtual
machines portable and easy to manage. For example, a virtual
machine can be moved and copied from one location to
another just like a file.
Copyright © 2011 EMC Corporation. All Rights Reserved. Classic Data Center 17
Benefits of Compute Virtualization
Copyright © 2011 EMC Corporation. All Rights Reserved. Classic Data Center 18
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 19
Module 3: Virtualized Data Center –
Compute
Lesson 2: Compute Virtualization Techniques
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 20
Hierarchical Protection Domains - Protection
Rings
• Computer operating systems provide different hierarchical
levels or layers of privilege of access to resources.
• These are mechanisms to protect data and functionality
from faults (fault tolerance) and malicious.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 21
Hierarchical Protection Domains - protection rings
• Rings are arranged in a hierarchy from most privileged (most
trusted, usually numbered zero) to least privileged (least trusted,
usually with the highest ring number).
• On most operating systems, Ring 0 is the level with the most
privileges and interacts most directly with the physical hardware
such as the CPU and memory.
• Special gates between rings are provided to allow an outer ring to
access an inner ring's resources in a predefined manner, as opposed
to allowing arbitrary usage.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 22
Hierarchical Protection Domains - protection rings
• Correctly gating access between rings can improve security by
preventing programs from one ring or privilege level from
misusing resources intended for programs in another.
• For example :-
Spyware running as a user program in ring 3 should be
prevented from turning on a web camera without informing
the user, since hardware access should be a ring 1 function
reserved for device drivers.
Programs such as web browsers running in higher numbered
rings must request access to the network, a resource
restricted to a lower numbered ring.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 23
X86 Virtualization
• x86 virtualization is the facility that allows multiple operating systems
to simultaneously share x86 processor resources in a safe and
efficient manner, a facility generically known as
hardware virtualization.
• There are various techniques used to virtualize x86 hardware.
• In the late 1990s x86 virtualization was achieved by complex software
techniques that overcame the processor's lack of virtualization
support and attained reasonable performance.
• In 2006, both Intel (VT-x) and AMD (AMD-V) added hardware support
to their processors making virtualization software simpler, and later
hardware changes provided substantial speed improvements.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 24
CPU Virtualization
Requirements: x86 Hardware Virtualization
• x86 architecture offer four levels of privilege to Ring 3 User Apps
operating systems and applications to manage
Ring 2
access to the compute hardware.
Ring 0, 1, 2, and 3 Ring 1
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 25
User Apps
CPU Virtualization Ring 3
Requirements: x86 Hardware Virtualization Ring 2
Ring 1
OS
Ring 0
• Challenges of Virtualizing x86 Hardware X86 Hardware
Virtualizing the x86 architecture requires placing the virtualization
layer below the OS layer (which expects to be in the most privileged
Ring 0) to create and manage the virtual machines that deliver
shared resources.
Is difficult to capture and translate privileged OS instructions at
runtime
Some privileged operating system instructions cannot effectively
be virtualized because they have different semantics when they
are not executed in Ring 0.
The difficulty in capturing and translating these privileged
instruction requests at runtime was the challenge that originally
made x86 architecture virtualization look impossible.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 26
User Apps
CPU Virtualization Ring 3
Requirements: x86 Hardware Virtualization Ring 2
Ring 1
OS
Ring 0
• Challenges of Virtualizing x86 Hardware X86 Hardware
Is difficult to capture and translate privileged OS instructions at runtime
Privileged instruction is a class of instructions that usually includes interrupt
handling, timer control, and input/output instructions.
These instructions can be executed only when the compute is in a special
privileged mode, generally available to an operating system, but not to user
programs.
• VMware resolved the challenge in 1998, developing binary translation techniques
that allow the VMM to run in Ring 0 for isolation and performance, while moving
the operating system to a user level ring with greater privilege than applications
in Ring 3 but less privilege than the virtual machine monitor in Ring 0.
• Each company developing virtualization solutions is free to interpret the technical
challenges and develop solutions with varying strengths and weaknesses.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 27
Requirements: x86 Hardware Virtualization
• The three techniques that now exist for handling privileged
instructions to virtualize the CPU on x86 architecture are as
follows:
1.Full virtualization using Binary Translation (BT)
2.Operating systems-assisted virtualization or Paravirtualization
3.Hardware assisted virtualization
•Figure provides a summary timeline of x86 virtualization
technologies from VMware’s binary translation to the recent
application of kernel paravirtualization and hardware-assisted
virtualization.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 28
Ring 3 User Apps
1-Full Virtualization Ring 2
• Virtual Machine Monitor (VMM) runs in
Ring 1 Guest OS
the privileged Ring 0
• Each VM is assigned a VMM Ring 0 Hypervisor
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 29
1-Full Virtualization
• Application requests work as they would otherwise
on a physical machine.
• VMM decouples guest operating system (OS) from Ring 3 User Apps
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 30
1-Full Virtualization
• The hypervisor translates all operating
system instructions on the fly and caches
the results for future use, while user level
instructions run unmodified at native
speed.
• Full virtualization offers the best isolation and security for virtual
machines, and simplifies migration and portability as the same guest
OS instance can run virtualized or on native hardware.
• VMware’s virtualization products and Microsoft Virtual Server are
examples of full virtualization.
VMware ESX/ESXi and Microsoft Hyper-V are product examples that
implement the full virtualization technique.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 31
2-Paravirtualization
• “Para-“ is an English affix means "beside," "with," or "alongside.”
Given the meaning “alongside virtualization,”
• Paravirtualization refers to communication between the guest OS
and the hypervisor to improve performance and efficiency.
• Paravirtualization involves modifying the OS kernel to replace
nonvirtualizable instructions with hypercalls that communicate
directly with the virtualization layer hypervisor.
• The hypervisor also provides
hypercall interfaces for other
critical kernel operations such as
memory management, interrupt
handling and time keeping.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 32
Ring 3 User Apps
2-Paravirtualization
Ring 2
Ring 1
Paravirtualized
Ring 0 Guest OS
Hypervisor
Physical Machine
X86 Hardware
• Paravirtualization is possible in open source operating
systems
• Guest operating system (OS) knows that it is virtualized
• Guest OS runs in Ring 0
• Modified guest OS kernel is used to eliminate the need for
Binary Translation, such as Linux and OpenBSD
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 33
2-Paravirtualization
• Unmodified guest OS is not supported, such
as Microsoft Windows Ring 3 User Apps
it is possible to modify open source operating
systems, such as Linux and OpenBSD, it is notRing 2
possible to modify “closed” source operatingRing 1
systems such as Microsoft Windows. Paravirtualized
Ring 0
• A full virtualization approach should be
Guest OS
Hypervisor
adopted for unmodified guest operating
systems such as Microsoft Windows. Physical Machine
X86 Hardware
• Xen and KVM are product examples of
paravirtualization.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 34
3-Hardware Assisted Virtualization
• Hardware vendors are rapidly embracing virtualization and
developing new features to simplify virtualization techniques.
• Privileged and sensitive calls are set to automatically trap to
the hypervisor, removing the need for either binary translation
or paravirtualization.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 35
3-Hardware Assisted Virtualization
• Achieved by using hypervisor-
Ring 3 User Apps
aware CPU to handle privileged
instructions Ring 2
Reduces virtualization overhead Ring 1
caused due to full and
Ring 0 Guest OS
paravirtualization
CPU and Memory virtualization
VMM
support is provided in hardware
• Enabled by AMD-V and Intel VT Physical Machine
X86 Hardware
technologies in the x86
processor architecture
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 36
Module 3: Virtualized Data Center –
Compute
Lesson 3: Virtual Machine
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 37
Virtual Machine
• From a user’s perspective a
virtual machine (VM) is a logical
compute system
Runs an operating system (OS) and
application like a physical machine Hypervisor
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 38
Virtual Machine Files
File name Description
Virtual BIOS • Stores the state of the virtual machine’s (VM’s) BIOS
File
• Is a VM’s paging file which backs up the VM RAM contents
Virtual Swap
File • The file exists only when VM is running
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 40
Virtual Machine Hardware
• A virtual machine uses a virtual hardware.
• Each guest operating system sees the hardware devices as
if they were physical and owned by them.
Parallel Serial/Com USB controller
port ports and USB devices
Mouse
Graphic Virtual Machine
card
Keyboard
RAM
Copyright © 2011 EMC Corporation. All Rights Reserved. Classic Data Center 42
VM Hardware Components
Virtual Hardware Description
• Virtual machine (VM) can be configured with one or more
vCPU virtual CPUs
• Number of CPUs allocated to a VM can be changed
• Amount of memory presented to the guest operating system
vRAM (OS)
• Memory size can be changed based on requirement
• Stores VM's OS and application data
Virtual Disk
• A VM should have at least one virtual disk
• Enables a VM to connect to other physical and virtual
vNIC
machines
Virtual DVD/CD-ROM • It maps a VM’s DVD/CD-ROM drive to either a physical
Drive drive or an .iso file
• It maps a VM’s floppy drive to either a physical drive or
Virtual Floppy Drive
an .flp file
Virtual SCSI Controller • VM uses virtual SCSI controller to access virtual disk
Virtual USB Controller • Maps VM’s USB controller to the physical USB controller
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 43
Virtual Machine Console
• Provides mouse, keyboard, and screen functionality
• Sends power changes (on/off) to the virtual machine
(VM)
• Allows access to BIOS of the VM
• Typically used for virtual hardware configuration and
troubleshooting issues
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 44
Module 3: Virtualized Data Center – Compute
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 45
Resource Management
Resource Management
A process of allocating resources from physical machine or
clustered physical machines to virtual machines (VMs) to
optimize the utilization of resources.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 46
Resource Pool
Resource pool
It is a logical abstraction of aggregated physical
resources that are managed centrally.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 47
Resource Pool Example
Standalone Physical Machine –
Machine 1
Parent Pool
CPU = 3000 MHz
Memory = 6GB
A child pool
Marketing-Production VM
Engineering Pool (Child Pool) Finance Pool (Child
Pool) CPU = 500 MHz
CPU = 1000 MHz CPU = 1000 MHz Memory = 1GB
Memory = 2GB Memory = 2GB
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 48
Resource Pool Example
• The resources of the child resource pools are further
distributed among virtual machines (VMs).
• The parent resource pool includes the sum of all CPUs
power (in megahertz) and the sum of all the capacity
of installed RAM (in megabytes) available in the
compute environment (physical machine or cluster).
• The child resource pool cannot exceed the capacity of
the parent resource pool.
• Creating a child pool reserves resources from the
parent pool, irrespective of whether or not the virtual
machine in the child pool is powered on.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 49
Share, Limit, and Reservation
• Parameters that control the resources consumed by a child
resource pool or a virtual machine (VM) are as follows:
Share
Amount of CPU or memory resources a VM or a child resource pool can
have with respect to its parent’s total resources- relative priority
Limit
Maximum amount of CPU and memory a VM or a child resource pool can
consume
Reservation
Amount of CPU and memory reserved for a VM or a child resource pool
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 50
Share, Limit, and Reservation
1.Share
Child Resource Pool: When resources are scarce and when resource contention occurs, the
share value defines the relative priority of child resource pools in a parent pool.
Virtual machine: Similar to a child resource pool, share specifies the relative priority of a
virtual machine. If a virtual machine has twice as many CPU/memory share as another Virtual
Machine, it is entitled to consume twice as much CPU/memory when the virtual machines are
competing for resources.
2.Limit
Child Resource Pool: It defines the maximum amount of CPU (MHz) and memory (MB) that a
child resource pool is allowed to consume.
Virtual machine: Similar to a resource pool, limit defines the maximum amount of CPU (MHz)
and memory (MB) that a virtual machine is allowed to consume. The maximum amount of
memory and CPU a virtual machine may consume is configured when it is created, and can
only be modified when the virtual machine is powered off.
3.Reservation
Child Resource Pool: It defines the amount of CPU (MHz) and memory (MB) that is reserved
for a child resource pool.
Virtual machine: Similar to child resource pool, virtual machine defines the amount of CPU
(MHz) and memory (MB) reserved for a virtual machine. If the virtual machine does not use
the total amount of its CPU and memory reserved, the unused portion will be available for
use by other virtual machines until the virtual machine needs it. A virtual machine will not
power on if the amount of resources defined in reservation is not available in the pool.
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 51
Optimizing CPU Resources
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 52
two or more cores into a single
Multi-core Processors integrated circuit, called a socket
Virtual CPU
Virtual
Physical
Thread Threa Thre
Thread Thread Thre
Thread Thread ad Thread
d ad
Core
Socket
Single – core Dual – core Quad – core
Dual – socket system Single – socket system Single – socket system
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 53
Hyper-threading VM with VM with VM with
one CPU two CPUs one CPU
• Makes a physical CPU appear as
two Logical CPUs (LCPUs)
Enables operating system (OS) to
schedule two or more threads
simultaneously
• Two LCPUs share the same physical
resources
While the current thread is stalled,
CPU can execute another thread
LCPU LCPU
• Hypervisor running on a hyper-
threading-enabled CPU provides LCPU
LCPU
improved performance and
utilization Thread 1 and 2 Dual – core
Single – socket system
Thread 1 and 2
with hyperthreading
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 54
CPU Load Balancing
VM with VM with VM with
one CPU one CPU one CPU
LCP LCP
U U
LCP LCP
U U
Copyright © 2011 EMC Corporation. All Rights Reserved. Virtualized Data Center – Compute 55