CCIS - Chapter # 4 - Virtualization
CCIS - Chapter # 4 - Virtualization
Chapter 4
Virtualization
• In computing, virtualization is simulating a hardware platform,
operating system (OS), storage device, or network resources
• The term "virtualization" traces its roots to 1960s mainframes
o during which it was a method of logically dividing the mainframes' resources
for different applications
• Virtualization allows one computer to do the job of multiple
computers
o Virtual environments let one computer host multiple operating systems at the
same time
Virtualization
• Virtualization is way to run multiple operating systems and user
applications on the same hardware
o E.g., run both Windows and Linux on the same laptop
• How is it different from dual-boot?
o Both Operating Systems run simultaneously
• The Operating Systems are completely isolated from each other
Virtualization
Virtual Virtual
Container Container
Hardware Hardware
Virtualization
Uses of Virtualization
• Server consolidation
o Run a web server and a mail server on the same physical server
• Easier development
o Develop critical operating system components (file system, disk driver)
without affecting computer stability
• Quality Assurance
o Testing a network product (e.g., a firewall) may require tens of computers
o Try testing thoroughly a product at each pre-release milestone and have a
straight face when your boss shows you the electricity bill
• Cloud computing
o Really helpful in cloud computing
Why to Virtualize
• x86 server deployments introduced new IT challenges
o Low server infrastructure utilization (10-18%)
o Increasing physical infrastructure costs (facilities, power, cooling, etc)
o Increasing IT management costs (configuration, deployment, updates, etc)
o Insufficient failover and disaster protection
• The solution for all these problems was to virtualize x86 platforms
• It matches the benefits of high hardware utilization with running
several operating systems (applications) in separated virtualized
environments
o Each application runs in its own operating system
o Each operating system does not know it is sharing the underlying hardware
with others
Chapter # 4 Sheheryar Malik, Ph.D. 7
Cloud Computing: Infrastructure & Servi
Hypervisor
Hypervisor
• In computing, a hypervisor is a virtualization platform that allows
multiple operating systems to run on a host computer at the same
time
• Also called Virtual Machine Monitor
Types of Hypervisor
• Native (bare-metal) hypervisor
o It runs directly on a given hardware
o A "guest" operating system thus runs at the second level above the hardware
o It sits directly on the hardware platform and most likely used to gain better performance for
individual users
o Has complete control over hardware
o Doesn’t have to “fight” an OS
• Hosted hypervisor
o Runs as a distinct software layer above both the hardware and the OS
o Useful both in private and public clouds to gain performance improvements
o Avoid code duplication: need not code a process scheduler, memory management system –
the OS already does that
o Can run native processes alongside VMs
o Familiar environment – how much CPU and memory does a VM take
o Easy management – stop a VM? Sure, just kill it
Chapter # 4 Sheheryar Malik, Ph.D. 11
Cloud Computing: Infrastructure & Servi
Guest OS 1 OS 2 OS 3 OS 4
Virtualization Platform
Host
Hardware
Guest OS 1 OS 2 OS 3
Hardware
Examples: VMware Workstation, Microsoft Virtual PC, Sun VirtualBox, QEMU, KVM
VMware Products
• VMware Workstation Pro
o First product launched by VMware in 1999
o It allows users to run multiple instances of x86 or x86-64 -compatible operating systems on a single physical
PC
• VMware Workstation Player
o It is for users without a license (for non-commercial use) to use VMware Workstation or VMware Fusion
• VMware Fusion
o It provides similar functionality for users of the Intel Mac platform, along with full compatibility with virtual
machines created by other VMware products
• VMware vSphere
o It is an enterprise-level product, can deliver greater performance than the freeware VMware Server, due to
lower system overhead
o It is also called "ESXi"
o VMware ESXi, as a "bare-metal" product, runs directly on the server hardware, allowing virtual servers to
also use hardware more or less directly
o In addition, VMware ESXi integrates into VMware vCenter, which offers extra services to enhance the
reliability and manageability of a server deployment
Chapter # 4 Sheheryar Malik, Ph.D. 14
Cloud Computing: Infrastructure & Servi
Types of Virtualizations
Types of Virtualization
Hardware Virtualization
Desktop Virtualization
Hardware Virtualization
• Full virtualization
o Almost complete simulation of the actual hardware to allow software, which typically
consists of a guest operating system, to run unmodified
• Partial virtualization
o Some but not all of the target environment is simulated
o Some guest programs, therefore, may need modifications to run in this virtual environment
• Paravirtualization
o Hardware environment is not fully simulated
o It involves modifying the OS kernel to replace non-virtualizable instructions with hypercalls
that directly communicate with the virtualization layer hypervisor
o The guest programs are executed in their own isolated domains, as if they are running on a
separate system
o The hypervisor and the operating system collaborate on the virtualization, requiring
operating system changes but resulting in near native performance
Desktop Virtualization
• It is a software technology that separates the desktop environment and
associated application software from the physical client device that is used to
access it
• It may allow all the components of the desktop to be virtualized
o which allows for a highly flexible and much more secure desktop delivery model
• It supports a more complete desktop disaster recovery strategy as all
components are essentially saved in the data center and backed up through
traditional redundant maintenance systems
• If a user's device or hardware is lost then
o the restore is much more straightforward and simple, as all the components will be present
at login from another device
o there is much less chance that any critical data cannot be retrieved and compromised,
because no data is saved to the user's device
Software
Memory
Storage
Data
Network
Applications
Chapter # 4 Sheheryar Malik, Ph.D. 20
Cloud Computing: Infrastructure & Servi
Software Virtualization
• Operating system-level virtualization
o hosting of multiple virtualized environments within a single OS instance
• Application virtualization
o It is a software technology that encapsulates application software from the
underlying operating system on which it is executed
o It is the hosting of individual applications in an environment separated from
the underlying OS
o Application virtualization is closely associated with the concept of portable
applications
Software Virtualization
• Workspace virtualization
o It is a way of distributing applications to client computers using application
virtualization
o It also bundles several applications together into one complete workspace
o It is an approach that encapsulates and isolates an entire computing
workspace
• Service virtualization
o It is emulating the behavior of dependent (e.g., third-party, evolving, or not
implemented) system components that are needed to exercise an application
under test (AUT) for development or testing purposes
o Rather than virtualizing entire components, it virtualizes only specific slices of
dependent behavior critical to the execution of development and testing tasks
Memory Virtualization
• Memory virtualization
o aggregating random-access memory (RAM) resources from networked systems into a single
memory pool
• Virtual memory
o giving an application program the impression that it has contiguous working memory,
isolating it from the underlying physical memory implementation
Physical memory
App
Benefits of Virtual Memory
Swap space
• Remove physical-memory limits App
• Run multiple applications at once
Storage Virtualization
• Storage virtualization
o the process of completely abstracting logical storage from physical storage
• Distributed file system
o any file system that allows access to files from multiple hosts sharing via a computer
network
• Virtual file system
o an abstraction layer on top of a more concrete file system, allowing client applications to
access different types of concrete file systems in a uniform way
• Storage hypervisor
o the software that manages storage virtualization and combines physical storage
resources into one or more flexible pools of logical storage
• Virtual disk drive
o a computer program the emulates a disk drive such as a hard disk drive or optical disk
drive
Chapter # 4 Sheheryar Malik, Ph.D. 24
Cloud Computing: Infrastructure & Servi
Storage Virtualization
Servers
Data Virtualization
• Data virtualization
o the presentation of data as an abstract layer, independent of underlying
database systems, structures and storage
• Database virtualization
o the decoupling of the database layer, which lies between the storage and
application layers within the application stack over all
Network Virtualization
• Network virtualization
o creation of a virtualized network addressing space within or across network subnets
• Virtual private network (VPN)
o a network protocol that replaces the actual wire or other physical media in a network with an
abstract layer, allowing a network to be created over the Internet
x86 Virtualization
Servers
• Hosted virtualization – mainframes
• VMMs / Bare Metal hypervisors
• OS virtualization
Desktops
• Desktop virtualization
• Server-side workspace virtualization
• Client-side workspace virtualization
Application virtualization
• Application isolation
• Application streaming
Virtual
… Virtual
Machine Machine VM … VM
Dynamic Translation
Virtual
Machine … Virtual
Machine
Hypervisor Hypervisor
Operating System
Hardware Hardware
Hardware
Full Virtualization
• 1st Generation offering of x86/x64 server virtualization
• Dynamic binary translation
Virtual Machine
App. B
App. C
The emulation layer talks to an operating system which talks to
App. A
Guest OS
o
the computer hardware
Device Drivers
o The guest OS doesn't see that it is used in an emulated
environment
• All of the hardware is emulated including the CPU Emulated
Hardware
• Two popular open source emulators are QEMU and Bochs
Device Drivers
Host OS
Hardware
Chapter # 4 Sheheryar Malik, Ph.D. 32
Cloud Computing: Infrastructure & Servi
Full Virtualization
• Advantages
o The emulation layer
Isolates VMs from the host OS and from each other
Controls individual VM access to system resources, preventing an unstable VM from impacting system
performance
o Total VM portability
By emulating a consistent set of system hardware, VMs have the ability to transparently move between hosts
with dissimilar hardware without any problems
• It is possible to run an operating system that was developed for another architecture on your own architecture
• A VM running on a Dell server can be relocated to a Hewlett-Packard server
• Disadvantages
o Hardware emulation comes with a performance price
o In traditional x86 architectures, OS kernels expect to run privileged code in Ring 0
However, because Ring 0 is controlled by the host OS, VMs are forced to execute at Ring 1/3, which requires the
VMM to trap and emulate instructions
o Due to these performance limitations, paravirtualization and hardware-assisted
virtualization were developed
Chapter # 4 Sheheryar Malik, Ph.D. 33
Cloud Computing: Infrastructure & Servi
Para-Virtualization
• Hardware environment is not fully simulated
• It involves modifying the OS kernel to replace non-
Virtual Machine
virtualizable instructions with hypercalls that directly
App. B
App. C
App. A
Guest OS
communicate with the virtualization layer hypervisor
• The Hypervisor is responsible for handling the virtualization Device Drivers
Hardware
Chapter # 4 Sheheryar Malik, Ph.D. 34
Cloud Computing: Infrastructure & Servi
Para-Virtualization Approaches
• Recompiling the OS kernel
o Paravirtualization drivers and APIs must reside in the guest operating system kernel
o You do need a modified operating system that includes this specific API, requiring a compiling
operating systems to be virtualization aware
Some vendors (such as Novell) have embraced paravirtualization and have provided paravirtualized
OS builds, while other vendors (such as Microsoft) have not
• Installing paravirtualized drivers
o In some operating systems it is not possible to use complete paravirtualization, as it requires
a specialized version of the operating system
o To ensure good performance in such environments, paravirtualization can be applied for
individual devices
o For example, the instructions generated by network boards or graphical interface cards can
be modified before they leave the virtualized machine by using paravirtualized drivers
Hardware-assisted Virtualization
• The guest OS runs at ring 0
Virtual Machine
• The VMM uses processor extensions (such as
App. B
App. C
App. A
Guest OS
Intel®-VT or AMD-V) to intercept and emulate
privileged operations in the guest Device Drivers
o super-privileged mode
Hardware
Chapter # 4 Sheheryar Malik, Ph.D. 36
Cloud Computing: Infrastructure & Servi
Hardware-assisted Virtualization
• Pros
o It allows to run unmodified Operating systems (so legacy OS can be run
without problems)
• Cons
o Speed and Flexibility
An unmodified OS does not know it is running in a virtualized environment and so, it
can’t take advantage of any of the virtualization features
• It can be resolved using paravirtualization partially
Desktop Virtualization
• A VMM or hypervisor running on a physical desktop
• Examples include:
o Microsoft Virtual PC
o Parallels Desktop for Mac
o VMware Fusion
o WINE
• Desktop hypervisors and VMMs don’t necessarily scale to meet enterprise needs; that’s why most
of the providers have server products as well
Application Isolation
• An application packaged with its own virtual copies of the operating system
resources it might otherwise need to change (registries, file systems, libraries)
• Examples include:
o Thinstall
o Trigence
• Applications use a virtual registry (Thinstall) and file system embedded in the
package with the application
o These extra tools insulate applications from changes to and incompatibility with the
underlying desktop operating system
• Mostly in Windows, although Linux and Solaris as well
• Drawback: increased footprint of the application package and the correspondingly
greater memory requirements
Chapter # 4 Sheheryar Malik, Ph.D. 41
Cloud Computing: Infrastructure & Servi
Application Streaming
• Just-in-time delivery of a server-hosted application to the desktop, such that
the desktop application can execute before the entire file has been downloaded
from the server
• Examples include:
o AppStream
o Microsoft App-V
o Citrix XenApp
Bochs (emulation)
• Bochs is an x86 computer simulator that is portable and runs on a
variety of platforms, including x86, PowerPC, Alpha, SPARC, and MIPS
• It simulate the entire computer, including the peripherals, such as the
keyboard, mouse, video graphics hardware, network interface card
(NIC) devices, and so on
• Bochs can be configured as an older Intel® 386, or successor
processors such as the 486, Pentium, Pentium Pro, or a 64-bit variant
• Using the Bochs emulator, you can run any Linux distribution on Linux
QEMU (emulation)
• QEMU is another emulator, like Bochs, but it has some differences that are worth
noting
• QEMU supports two modes of operation
o Full System Emulation mode
This mode is similar to Bochs in that it emulates a full personal computer (PC) system with
processor and peripherals
This mode emulates a number of processor architectures, such as x86, x86_64, ARM, SPARC,
PowerPC, and MIPS, with reasonable speed using dynamic translation
Using this mode, you can emulate the Windows operating systems and Linux on Linux, Solaris, and
FreeBSD
o User Mode Emulation
In this mode, which can only be hosted on Linux, a binary for a different architecture can be
launched
This allows, for example, a binary compiled for the MIPS architecture to be executed on Linux
running on x86
Other architectures supported in this mode include ARM, SPARC, and PowerPC, though more are
under development
VMware
• VMware is a commercial solution for full virtualization
• Typically a hypervisor sits between the guest operating systems and
the bare hardware as an abstraction layer
• This abstraction layer allows any operating system to run on the
hardware without knowledge of any other guest operating system
• VMware also virtualizes the available I/O hardware and places drivers
for high-performance devices into the hypervisor
• The entire virtualized environment is kept as a file, meaning that a full
system (including guest operating system, VM, and virtual hardware)
can be easily and quickly migrated to a new host for load balancing
Xen
• Xen is a native (bare-metal) hypervisor providing services that allow multiple
computer operating systems to execute on the same computer hardware
concurrently
• It is a free open source solution for operating system-level paravirtualization
from XenSource
• It is available for the IA-32, x86-64 and ARM instruction sets
• Operating systems that support Xen include Linux Windows, Minix, Plan 9,
NetBSD, FreeBSD, and OpenSolaris
• Xen offers five approaches to running the guest operating system:
o HVM (hardware virtual machine)
o HVM with PV drivers
o PVHVM (paravirtualization with full hardware virtualization i.e. HVM with PVHVM
drivers)
o PVH (PV in an HVM container)
o PV (paravirtualization)
Chapter # 4 Sheheryar Malik, Ph.D. 49
Cloud Computing: Infrastructure & Servi
Linux-VServer
• Linux-VServer is a solution for operating system-level virtualization
• Linux-VServer virtualizes the Linux kernel so that multiple user-space
environments, otherwise known as Virtual Private Servers (VPS), run
independently with no knowledge of one another
• Linux-VServer achieves user-space isolation through a set of
modifications to the Linux kernel
• It operates on a number of platforms, including x86, x86-64, SPARC,
MIPS, ARM and PowerPC
OpenVZ
• Open is another operating system-level virtualization solution, like
Linux-VServer
• OpenVZ is a virtualization-aware (modified) kernel that supports
isolated user-spaces, VPS, with a set of user-tools for management
• For example, you can easily create a new VPS from the command line