SlideShare a Scribd company logo
1 of 31
Chapter 14
Virtual Machines
Eighth Edition
By William Stallings
Operatin
g
Systems:
Internals
and
Design
Principle
s
Virtual Machines (VM)
 Virtualization technology enables a single PC or server to simultaneously
run multiple operating systems or multiple sessions of a single OS
 A machine with virtualization software can host numerous applications,
including those that run on different operating systems, on a single
platform
 The host operating system can support a number of virtual machines,
each of which has the characteristics of a particular OS
 The solution that enables virtualization is a virtual machine monitor
(VMM), or hypervisor
Shared Hardware
Figure 14.1 Virtual Machine Concept
Virtual Machine Manager
Virtual
Machine 1
Virtual
Machine 2
Virtual
Machine n
Applications
and
Processes
Applications
and
Processes
Applications
and
Processes
Figure 14.2 Virtual Machine Consolidation
Physical
servers
Virtualization
host
6:1 consolidation ratio
V
M
Approaches to
Virtualization
A Virtual Machine is a software construct
that mimics the characteristics of a
physical server
it is configured with
some number of
processors, some
amount of RAM,
storage resources, and
connectivity through the
network ports
once the VM is created
it can be powered on
like a physical server,
loaded with an
operating system and
software solutions, and
utilized in the manner of
a physical server
unlike a physical server,
this virtual server only
sees the resources it
has been configured
with, not all of the
resources of the
physical host itself
the hypervisor facilitates
the translation and I/O
from the virtual machine
to the physical server
devices and back again
to the correct virtual
machine
Virtual Machine Files
Virtual machines are made
up of files:
configuration file
describes the attributes of
the virtual machine
it contains the server
definition, how many
virtual processors
(vCPUs) are allocated to
this virtual machine, how
much RAM is allocated,
which I/O devices the VM
has access to, how many
network interface cards
(NICs) are in the virtual
server, and more
it also describes the
storage that the VM can
access
when a virtual machine is
powered on, or
instantiated, additional
files are created for
logging, for memory
paging, and other
functions
since VMs are already
files, copying them
produces not only a
backup of the data but
also a copy of the entire
server, including the
operating system,
applications, and the
hardware configuration
itself
Shared Hardware
(a) Type 1 VMM
Figure 14.3 Type 1 and Type 2 Virtual Machine Monitors
Virtual Machine Monitor
Virtual Machine 1
Applications
OS 1
Virtual Machine 2
Applications
OS 2
Shared Hardware
(a) Type 2 VMM
Virtual Machine Monitor
Virtual Machine 1
Applications
OS 1
Host Operating System
Virtual Machine 2
Applications
OS 2
Paravirtualization
 A software assisted virtualization technique that uses specialized
APIs to link virtual machines with the hypervisor to optimize their
performance
 The operating system in the virtual machine, Linux or Microsoft
Windows, has specialized paravirtualization support as part of the
kernel, as well as specific paravirtualization drivers that allow the
OS and hypervisor to work together more efficiently with the
overhead of the hypervisor translations
 Support has been offered as part of many of the general Linux
distributions since 2008
Processor Issues
 In a virtual environment there are two main strategies for providing
processor resources:
 Emulate a chip as software and
provide access to that resource
 examples of this method
are QEMU and the
Android Emulator in the
Android SDK
 Provide segments of
processing time on the physical
processors (pCPUs) of the
virtualization host to the virtual
processors of the virtual
machines hosted on the
physical server
 this is how most of the
virtualization hypervisors
offer processor resources
to their guests
Processor Allocation
• one basic rule during VM
creation is to begin with one
vCPU and monitor the
application’s performance
• another good practice is not
to overallocate the number
of vCPUs in a VM
• when applications are
migrated to virtual
environments, the number of
virtual processors allocated
to their virtual machines
needs to be determined
The number of
processors a server
has is one of the more
important metrics when
sizing a server
Moore’s law provides
processors that would
be four times faster
than those on the
original physical server
There are tools
available that will
monitor resource
(processor, memory,
network, and storage
I/O) usage on the
physical server and
then make
recommendations for
the optimum VM sizing
If the consolidation
estimate utility cannot
be run, there are a
number of good
practices in place
Ring O
Native operating systems manage hardware by acting as the intermediary be
requests and the hardware
One key function of the operating system is to help prevent malicious or
from disrupting the applications or the operating system itself
Protection rings describe level of access or privilege inside of a compu
operating systems and processor architectures take advantage of this
The most trusted layer is often called Ring 0 (zero) and is where the ope
works and can interact directly with hardware
Hypervisors run in Ring 0 controlling hardware access for the virtual machine
Figure 14.4 Page Sharing
Virtual memory Virtual memory Virtual memory
Physical memory
Memory Management
 Since hypervisor manages page sharing, the virtual machine operating
systems are unaware of what is happening in the physical system
 Ballooning
 the hypervisor activates a balloon driver that (virtually) inflates and
presses the guest operating system to flush pages to disk
 once the pages are cleared, the balloon driver deflates and the
hypervisor can use the physical memory for other VMs
 Memory overcommit
 the capability to allocate more memory than physical exists on a
host
Figure 14.5 I/O in a Virtual Environment
Applications
Operating system
NIC driver
NIC driver
NIC
Hypervisor
Virtual
machine
Physucal
server
Emulated device
Network
I/O Management
 An advantage of virtualizing the workload’s I/O path enables hardware
independence by abstracting vendor-specific drivers to more generalized
versions that run on the hypervisor
 This abstraction enables:
 live migration, which is one of virtualization’s greatest availability
strengths
 the sharing of aggregate resources, such as network paths
 The memory overcommit capability is another benefit of virtualizing the I/O of
a VM
 The trade-off for this is that the hypervisor is managing all the traffic and
requires processor overhead
 this was an issue in the early days of virtualization but now faster
multicore processors and sophisticated hypervisors have addressed
this concern
Performance
Technologies
I/OAT
I/O Acceleration
Technology
offered by Intel
a physical subsystem
that moves memory
copies via direct
memory access (DMA)
from the main processor
to this specialized
portion of the
motherboard
TOE
TCP Offload Engine
removes the TCP/IP
processing from the
server processor
entirely to the NIC
LRO
Large Receive Offload
aggregates incoming
packets into bundles for
more efficient
processing
LSO
Large Segment Offload
allows the hypervisor to
aggregate multiple
outgoing TCP/IP
packets and has the
NIC hardware segment
them into separate
packets
VMware ESXi
 A commercially available hypervisor from VMware that provides users a
Type-1, or bare-metal, hypervisor to host virtual machines on their
servers
 VMware developed their initial x86-based solutions in the late 1990s and
were the first to deliver a commercial product to the marketplace
 This first-to-market timing, coupled with continuous innovations, has kept
VMware firmly on top in market share
Figure 14.6 ESX
Hardware
monitoring
agents
VMware
management
agents
Infrastructure
agents
(NTP, Syslog)
CLI commands
for configuration
and support
VM support and
resource
management
VM VM
VMkernel
System
management
agents
Figure 14.7 ESXi
CLI commands
for configuration
and support
Agentless
systems
management
Agentless
hardware
monitoring
VMware
management
framework
Common
information
model
Infrastructure
agents
(NTP, Syslog)
VM support and
resource
management
Local support consoles
VM VM
VMkernel
VMware ESXi Features
Storage VMotion Permits the relocation of the data files that compose a virtual machine, while
that virtual machine is in use
Fault Tolerance Creates a lockstep copy of a virtual machine on a different host --- if the
original host suffers a failure, the virtual machine’s connections get shifted to
the copy without interrupting users or the application they are using
Site Recovery
Manager
Uses various replication technologies to copy selected virtual machines to a
secondary site in the case of a data center disaster
Storage and
Network I/O
Control
Allows an administrator to allocate network bandwidth in a virtual network in
a very granular manner
Distributed
Resource
Scheduler (DRS)
Intelligently places virtual machines on hosts for startup and can
automatically balance the workloads via VMotion based on business policies
and resource usage
Figure 14.8 Xen
Dom0
drivers
DomU
KernelU
Xen Hypervisor
Hardware
Kernel0
DomU
KernelU
Figure 14.9 Hyper-V
Parent partition
drivers
Child partition
Kernel
Microsoft Hyper-V
Hardware
Kernel
Child partition
Kernel
WMI
VSP VSC VSC
VM
workers
VMBus
Java VM
 The goal of a Java Virtual
Machine (JVM) is to provide a
runtime space for a set of Java
code to run on any operating
system staged on any
hardware platform without
needing to make code changes
to accommodate the different
operating systems or hardware
 The JVM can support multiple
threads
 Promises “Write Once, Run
Anywhere”
 The JVM is described as being
an abstract computing machine
consisting of:
 an instruction set
 a program counter
register
 a stack to hold variables
and results
 a heap for runtime data
and garage collection
 a method area for code
and constants
Linux VServer
 Linux VServer is an open-source, fast, lightweight approach to
implementing virtual machines on a Linux server
 Only a single copy of the Linux kernel is involved
 VServer consists of a relatively modest modification to the kernel plus a
small set of OS userland tools
 The VServer Linux kernel supports a number of separate virtual servers
 The kernel manages all system resources and tasks, including process
scheduling, memory, disk space, and processor time
Architecture
 Each virtual server is isolated from the others using Linux kernel capabilities
 The isolation involves four elements:
 chroot
 a UNIX or Linux command to make the root directory (/) become something other than its default for
the lifetime of the current process
 this command provides file system isolation
 chcontext
 Linux utility that allocates a new security context and executes commands in that context
 each virtual server has its own execution context that provides process isolation
 chbind
 executes a command and locks the resulting process and its children into using a specific IP
address
 system call provides network isolation
 capablities
 refers to a partitioning of the privilege available to a root user
 each virtual server can be assigned a limited subset of the root user’s privileges which provides root
isolation
VM Admin.
Remote Admin.
Core Services
Server
Applications
Standard OS Image
Hosting
Platform
Virtual
Platform
Server
Applications
/proc
/home
/usr
/dev
/proc
/home
/usr
/dev
/proc
/home
/usr
/dev
VMhost VM1 VMn
Figure 14.10 Linux VServer Architecture
bucket size=
S tokens
minimum
threshold =
S tokens
Token input rate =
R/T tokens per second
Figure 14.11 Linux VServer Token Bucket Scheme
Tokens can accumulate
up to bucket size; excess
tokens discarded
running process consumes
1 token/timer tick
current bucket
occupancy
Android Virtual Machine
Referred to as Dalvik
The Dalvik VM (DVM)
executes files in the Dalvik
Executable (.dex) format
The Dalvik core class library is
intended to provide a familiar
development base for those
used to programming with
Java Standard Edition, but it is
geared specifically to the
needs of a small mobile device
Each Android application runs
in its own process, with its own
instance of the Dalvik VM
Dalvik has been written so that
a device can run multiple VMs
efficiently
Figure 14.12 Java and Dalvik Formats
Header
.dex
.apk
.class
.jar
Class
Field
Method
Attributes
Heterogenous
constant pool
Header
.class
Class
Field
Method
Attributes
Heterogenous
constant pool
Header
Field list
Method list
Code header
Local variables
Strings
constant pool
Type/class
constant pool
Field
constant pool
Method
constant pool
Class
definition
Zygote
 A process running on a DVM that is launched at boot time
 Generates a new DVM every time there is a request for a new process
 Intended to minimize the amount of time it takes to generate a new DVM
by sharing items in memory to the maximum extent possible
 When first launched it preloads and preinitializes all Java core library
classes and resources that an application may potentially need at
runtime
 Additional memory need not be allocated for copies of these classes
when a new DVM is forked from the Zygote DVM
Summary
 Approaches to virtualization
 Processor issues
 Memory management
 I/O management
 VMware ESXi
 Microsoft hyper-V and Xen
variants
 Java VM
 Linux VServer virtual machine
architecture
 architecture
 process scheduling
 Android virtual machine
 Dex file format
 Zygote

More Related Content

Similar to CH14-Virtual Machines.pptx

virtual-machine-150316004018-conversion-gate01.pdf
virtual-machine-150316004018-conversion-gate01.pdfvirtual-machine-150316004018-conversion-gate01.pdf
virtual-machine-150316004018-conversion-gate01.pdfKowsalyaJayakumar2
 
Virtualization
VirtualizationVirtualization
Virtualizationvishnurk
 
CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...
CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...
CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...Editor IJCATR
 
virtual-machine-ppt 18030 cloud computing.pptx
virtual-machine-ppt 18030 cloud computing.pptxvirtual-machine-ppt 18030 cloud computing.pptx
virtual-machine-ppt 18030 cloud computing.pptxZarwashgulrez
 
Server Virtualization
Server VirtualizationServer Virtualization
Server VirtualizationAkhilesh Jha
 
Cloud Computing using virtulization
Cloud Computing using virtulizationCloud Computing using virtulization
Cloud Computing using virtulizationAJIT NEGI
 
Virtualization: Force driving cloud computing
Virtualization: Force driving cloud computingVirtualization: Force driving cloud computing
Virtualization: Force driving cloud computingMayank Aggarwal
 
Mid term report
Mid term reportMid term report
Mid term reportlokesh039
 
A510840101 24982 23_2020_lecture_2
A510840101 24982 23_2020_lecture_2A510840101 24982 23_2020_lecture_2
A510840101 24982 23_2020_lecture_2Krishna Kumar Singh
 
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...Farwa Ansari
 
Server virtualization
Server virtualization Server virtualization
Server virtualization Akankshaji
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud ComputingBhuvanesh Hingal
 

Similar to CH14-Virtual Machines.pptx (20)

virtual-machine-150316004018-conversion-gate01.pdf
virtual-machine-150316004018-conversion-gate01.pdfvirtual-machine-150316004018-conversion-gate01.pdf
virtual-machine-150316004018-conversion-gate01.pdf
 
Virtualization 101
Virtualization 101Virtualization 101
Virtualization 101
 
Virtualization
VirtualizationVirtualization
Virtualization
 
CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...
CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...
CPU Performance in Data Migrating from Virtual Machine to Physical Machine in...
 
Virtualization Approach: Theory and Application
Virtualization Approach: Theory and ApplicationVirtualization Approach: Theory and Application
Virtualization Approach: Theory and Application
 
virtual-machine-ppt 18030 cloud computing.pptx
virtual-machine-ppt 18030 cloud computing.pptxvirtual-machine-ppt 18030 cloud computing.pptx
virtual-machine-ppt 18030 cloud computing.pptx
 
Live VM Migration
Live VM MigrationLive VM Migration
Live VM Migration
 
Server Virtualization
Server VirtualizationServer Virtualization
Server Virtualization
 
Unit 2
Unit 2Unit 2
Unit 2
 
Cloud Computing using virtulization
Cloud Computing using virtulizationCloud Computing using virtulization
Cloud Computing using virtulization
 
Virtualization: Force driving cloud computing
Virtualization: Force driving cloud computingVirtualization: Force driving cloud computing
Virtualization: Force driving cloud computing
 
Mid term report
Mid term reportMid term report
Mid term report
 
A510840101 24982 23_2020_lecture_2
A510840101 24982 23_2020_lecture_2A510840101 24982 23_2020_lecture_2
A510840101 24982 23_2020_lecture_2
 
Virtulization submission
Virtulization submissionVirtulization submission
Virtulization submission
 
Virtual machine subhash gupta
Virtual machine subhash guptaVirtual machine subhash gupta
Virtual machine subhash gupta
 
lect 1TO 5.pptx
lect 1TO 5.pptxlect 1TO 5.pptx
lect 1TO 5.pptx
 
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
 
Server virtualization
Server virtualization Server virtualization
Server virtualization
 
Vitualisation
VitualisationVitualisation
Vitualisation
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 

Recently uploaded

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

CH14-Virtual Machines.pptx

  • 1. Chapter 14 Virtual Machines Eighth Edition By William Stallings Operatin g Systems: Internals and Design Principle s
  • 2. Virtual Machines (VM)  Virtualization technology enables a single PC or server to simultaneously run multiple operating systems or multiple sessions of a single OS  A machine with virtualization software can host numerous applications, including those that run on different operating systems, on a single platform  The host operating system can support a number of virtual machines, each of which has the characteristics of a particular OS  The solution that enables virtualization is a virtual machine monitor (VMM), or hypervisor
  • 3. Shared Hardware Figure 14.1 Virtual Machine Concept Virtual Machine Manager Virtual Machine 1 Virtual Machine 2 Virtual Machine n Applications and Processes Applications and Processes Applications and Processes
  • 4. Figure 14.2 Virtual Machine Consolidation Physical servers Virtualization host 6:1 consolidation ratio V M
  • 5. Approaches to Virtualization A Virtual Machine is a software construct that mimics the characteristics of a physical server it is configured with some number of processors, some amount of RAM, storage resources, and connectivity through the network ports once the VM is created it can be powered on like a physical server, loaded with an operating system and software solutions, and utilized in the manner of a physical server unlike a physical server, this virtual server only sees the resources it has been configured with, not all of the resources of the physical host itself the hypervisor facilitates the translation and I/O from the virtual machine to the physical server devices and back again to the correct virtual machine
  • 6. Virtual Machine Files Virtual machines are made up of files: configuration file describes the attributes of the virtual machine it contains the server definition, how many virtual processors (vCPUs) are allocated to this virtual machine, how much RAM is allocated, which I/O devices the VM has access to, how many network interface cards (NICs) are in the virtual server, and more it also describes the storage that the VM can access when a virtual machine is powered on, or instantiated, additional files are created for logging, for memory paging, and other functions since VMs are already files, copying them produces not only a backup of the data but also a copy of the entire server, including the operating system, applications, and the hardware configuration itself
  • 7. Shared Hardware (a) Type 1 VMM Figure 14.3 Type 1 and Type 2 Virtual Machine Monitors Virtual Machine Monitor Virtual Machine 1 Applications OS 1 Virtual Machine 2 Applications OS 2 Shared Hardware (a) Type 2 VMM Virtual Machine Monitor Virtual Machine 1 Applications OS 1 Host Operating System Virtual Machine 2 Applications OS 2
  • 8. Paravirtualization  A software assisted virtualization technique that uses specialized APIs to link virtual machines with the hypervisor to optimize their performance  The operating system in the virtual machine, Linux or Microsoft Windows, has specialized paravirtualization support as part of the kernel, as well as specific paravirtualization drivers that allow the OS and hypervisor to work together more efficiently with the overhead of the hypervisor translations  Support has been offered as part of many of the general Linux distributions since 2008
  • 9. Processor Issues  In a virtual environment there are two main strategies for providing processor resources:  Emulate a chip as software and provide access to that resource  examples of this method are QEMU and the Android Emulator in the Android SDK  Provide segments of processing time on the physical processors (pCPUs) of the virtualization host to the virtual processors of the virtual machines hosted on the physical server  this is how most of the virtualization hypervisors offer processor resources to their guests
  • 10. Processor Allocation • one basic rule during VM creation is to begin with one vCPU and monitor the application’s performance • another good practice is not to overallocate the number of vCPUs in a VM • when applications are migrated to virtual environments, the number of virtual processors allocated to their virtual machines needs to be determined The number of processors a server has is one of the more important metrics when sizing a server Moore’s law provides processors that would be four times faster than those on the original physical server There are tools available that will monitor resource (processor, memory, network, and storage I/O) usage on the physical server and then make recommendations for the optimum VM sizing If the consolidation estimate utility cannot be run, there are a number of good practices in place
  • 11. Ring O Native operating systems manage hardware by acting as the intermediary be requests and the hardware One key function of the operating system is to help prevent malicious or from disrupting the applications or the operating system itself Protection rings describe level of access or privilege inside of a compu operating systems and processor architectures take advantage of this The most trusted layer is often called Ring 0 (zero) and is where the ope works and can interact directly with hardware Hypervisors run in Ring 0 controlling hardware access for the virtual machine
  • 12. Figure 14.4 Page Sharing Virtual memory Virtual memory Virtual memory Physical memory
  • 13. Memory Management  Since hypervisor manages page sharing, the virtual machine operating systems are unaware of what is happening in the physical system  Ballooning  the hypervisor activates a balloon driver that (virtually) inflates and presses the guest operating system to flush pages to disk  once the pages are cleared, the balloon driver deflates and the hypervisor can use the physical memory for other VMs  Memory overcommit  the capability to allocate more memory than physical exists on a host
  • 14. Figure 14.5 I/O in a Virtual Environment Applications Operating system NIC driver NIC driver NIC Hypervisor Virtual machine Physucal server Emulated device Network
  • 15. I/O Management  An advantage of virtualizing the workload’s I/O path enables hardware independence by abstracting vendor-specific drivers to more generalized versions that run on the hypervisor  This abstraction enables:  live migration, which is one of virtualization’s greatest availability strengths  the sharing of aggregate resources, such as network paths  The memory overcommit capability is another benefit of virtualizing the I/O of a VM  The trade-off for this is that the hypervisor is managing all the traffic and requires processor overhead  this was an issue in the early days of virtualization but now faster multicore processors and sophisticated hypervisors have addressed this concern
  • 16. Performance Technologies I/OAT I/O Acceleration Technology offered by Intel a physical subsystem that moves memory copies via direct memory access (DMA) from the main processor to this specialized portion of the motherboard TOE TCP Offload Engine removes the TCP/IP processing from the server processor entirely to the NIC LRO Large Receive Offload aggregates incoming packets into bundles for more efficient processing LSO Large Segment Offload allows the hypervisor to aggregate multiple outgoing TCP/IP packets and has the NIC hardware segment them into separate packets
  • 17. VMware ESXi  A commercially available hypervisor from VMware that provides users a Type-1, or bare-metal, hypervisor to host virtual machines on their servers  VMware developed their initial x86-based solutions in the late 1990s and were the first to deliver a commercial product to the marketplace  This first-to-market timing, coupled with continuous innovations, has kept VMware firmly on top in market share
  • 18. Figure 14.6 ESX Hardware monitoring agents VMware management agents Infrastructure agents (NTP, Syslog) CLI commands for configuration and support VM support and resource management VM VM VMkernel System management agents
  • 19. Figure 14.7 ESXi CLI commands for configuration and support Agentless systems management Agentless hardware monitoring VMware management framework Common information model Infrastructure agents (NTP, Syslog) VM support and resource management Local support consoles VM VM VMkernel
  • 20. VMware ESXi Features Storage VMotion Permits the relocation of the data files that compose a virtual machine, while that virtual machine is in use Fault Tolerance Creates a lockstep copy of a virtual machine on a different host --- if the original host suffers a failure, the virtual machine’s connections get shifted to the copy without interrupting users or the application they are using Site Recovery Manager Uses various replication technologies to copy selected virtual machines to a secondary site in the case of a data center disaster Storage and Network I/O Control Allows an administrator to allocate network bandwidth in a virtual network in a very granular manner Distributed Resource Scheduler (DRS) Intelligently places virtual machines on hosts for startup and can automatically balance the workloads via VMotion based on business policies and resource usage
  • 21. Figure 14.8 Xen Dom0 drivers DomU KernelU Xen Hypervisor Hardware Kernel0 DomU KernelU
  • 22. Figure 14.9 Hyper-V Parent partition drivers Child partition Kernel Microsoft Hyper-V Hardware Kernel Child partition Kernel WMI VSP VSC VSC VM workers VMBus
  • 23. Java VM  The goal of a Java Virtual Machine (JVM) is to provide a runtime space for a set of Java code to run on any operating system staged on any hardware platform without needing to make code changes to accommodate the different operating systems or hardware  The JVM can support multiple threads  Promises “Write Once, Run Anywhere”  The JVM is described as being an abstract computing machine consisting of:  an instruction set  a program counter register  a stack to hold variables and results  a heap for runtime data and garage collection  a method area for code and constants
  • 24. Linux VServer  Linux VServer is an open-source, fast, lightweight approach to implementing virtual machines on a Linux server  Only a single copy of the Linux kernel is involved  VServer consists of a relatively modest modification to the kernel plus a small set of OS userland tools  The VServer Linux kernel supports a number of separate virtual servers  The kernel manages all system resources and tasks, including process scheduling, memory, disk space, and processor time
  • 25. Architecture  Each virtual server is isolated from the others using Linux kernel capabilities  The isolation involves four elements:  chroot  a UNIX or Linux command to make the root directory (/) become something other than its default for the lifetime of the current process  this command provides file system isolation  chcontext  Linux utility that allocates a new security context and executes commands in that context  each virtual server has its own execution context that provides process isolation  chbind  executes a command and locks the resulting process and its children into using a specific IP address  system call provides network isolation  capablities  refers to a partitioning of the privilege available to a root user  each virtual server can be assigned a limited subset of the root user’s privileges which provides root isolation
  • 26. VM Admin. Remote Admin. Core Services Server Applications Standard OS Image Hosting Platform Virtual Platform Server Applications /proc /home /usr /dev /proc /home /usr /dev /proc /home /usr /dev VMhost VM1 VMn Figure 14.10 Linux VServer Architecture
  • 27. bucket size= S tokens minimum threshold = S tokens Token input rate = R/T tokens per second Figure 14.11 Linux VServer Token Bucket Scheme Tokens can accumulate up to bucket size; excess tokens discarded running process consumes 1 token/timer tick current bucket occupancy
  • 28. Android Virtual Machine Referred to as Dalvik The Dalvik VM (DVM) executes files in the Dalvik Executable (.dex) format The Dalvik core class library is intended to provide a familiar development base for those used to programming with Java Standard Edition, but it is geared specifically to the needs of a small mobile device Each Android application runs in its own process, with its own instance of the Dalvik VM Dalvik has been written so that a device can run multiple VMs efficiently
  • 29. Figure 14.12 Java and Dalvik Formats Header .dex .apk .class .jar Class Field Method Attributes Heterogenous constant pool Header .class Class Field Method Attributes Heterogenous constant pool Header Field list Method list Code header Local variables Strings constant pool Type/class constant pool Field constant pool Method constant pool Class definition
  • 30. Zygote  A process running on a DVM that is launched at boot time  Generates a new DVM every time there is a request for a new process  Intended to minimize the amount of time it takes to generate a new DVM by sharing items in memory to the maximum extent possible  When first launched it preloads and preinitializes all Java core library classes and resources that an application may potentially need at runtime  Additional memory need not be allocated for copies of these classes when a new DVM is forked from the Zygote DVM
  • 31. Summary  Approaches to virtualization  Processor issues  Memory management  I/O management  VMware ESXi  Microsoft hyper-V and Xen variants  Java VM  Linux VServer virtual machine architecture  architecture  process scheduling  Android virtual machine  Dex file format  Zygote