Unit-II CC&BD Cs71 Ab
Unit-II CC&BD Cs71 Ab
Textbook:
NOTE: I declare that the PPT content is picked up from the prescribed course text
books or reference material prescribed in the syllabus book and Online Portals.
Unit II
Cloud Resource Virtualization:
• Layering and virtualization, Virtual machine monitors, Virtual machines,
• VM Performance and security isolation,
• Virtualization types, Hardware support for virtualization,
• A performance comparison of virtual machines,
• The darker side of virtualization, Software fault isolation.
• As the scale of a system and the size of its users grows, it becomes very challenging to
manage its recourses
• Resource management issues:
• provision for peak demands overprovisioning
• heterogeneity of hardware and software
• machine failures
• For example, the state of a virtual machine (VM) running under a virtual
machine monitor (VMM) can de saved and migrated to another server to
balance the load
• For example, virtualization allows users to operate in environments they
are familiar with, rather than forcing them to specific ones
Virtualization
• “Virtualization, in computing, refers to the act of creating a virtual (rather than
actual) version of something, including but not limited to a virtual computer hardware
platform, operating system (OS), storage device, or computer network resources.”
• Virtualization abstracts the underlying resources; simplifies their use; isolates users
from one another; and supports replication which increases the elasticity of a system
Issues in Virtualization :
There are many different types of virtualization, including hardware, software, desktop,
memory, storage, data and network virtualization.
• The ability to approximate the global state of the system and to redistribute the
load, the failure rates of different components, and many other factors.
• The traditional solution for a data center is to install standard operating systems on
individual systems and rely on conventional OS techniques to ensure resource
sharing, application protection, and performance isolation.
Virtualization is a basic tenet of cloud computing – that simplifies some of the resource
management tasks.
For example,
• The state of a virtual machine (VM) running under a virtual machine
monitor (VMM) can be saved and migrated to another server to balance the
load.
• Indeed, resources such as CPU cycles, memory, secondary storage, and I/O and
communication bandwidth are shared among several virtual machines; for each VM,
resources must be shared among multiple instances of an application.
Virtualization Simulates the interface to a physical object by:
A1 Applications
API
Libraries A2
ABI
System calls
Operating System A3
ISA
System ISA User ISA
Hardware
Figure 5.1, which shows the interfaces among the software components and the
hardware.
• The binaries resulting from the translation of HLL programs are targeted
to a specific hardware architecture.
Instruction Set Architecture (ISA) – at the boundary between hardware and software.
It defines a processors set of instructions. Ex: Intel architecture is represented by x86-32 and
x86-64 instruction sets for systems supporting 32-bit addressing and 64-bit addressing.
• The Hardware supports two execution mode:
• Privileged or Kernel mode and
• a User Mode.
• The Instruction Set consist of two sets:
• Sensitive Instructions,
• Non Privileged Instructions.
Application Binary Interface (ABI) – which allows the group consisting of the application
and the library modules to access the hardware; the ABI does not include privileged system
instructions, instead it invokes system calls.
Application Program Interface (API) - defines the set of instructions the hardware was
designed to execute and gives the application access to the ISA; it includes HLL library
calls which often invoke system calls.
Code Portability
• The binaries created by a compiler for a specific ISA and a specific operating
system are not portable. Such code cannot run on a computer with a different ISA or
on computers with the same ISA but different operating systems.
Intermediate Portable
code code
VM compiler/ VM compiler/
Loader
interpreter interpreter
• A guest OS is an OS that runs under the control of a VMM rather than directly
on the hardware.
• VMM runs in kernel mode, a guest OS runs in user mode.
• Allows several operating systems to run concurrently on a single hardware
platform; at the same time.
• VMM controls how the guest OS uses the hardware resources.
• Events occurring in one VM do not affect other VM running under same
VMM.
• At the same time the VMM enables
• Multiple services to share the same platform.
• Live migration - the movement of a server from one platform to another.
• System modification while maintaining backward compatibility with the
original system.
• Enforces isolation among the systems, thus security.
Virtualization Approaches
[Reference]https://www.vmware.com/pdf/virtualization.pdf
Virtualization Approaches
[Reference]https://www.vmware.com/pdf/virtualization.pdf
Virtualization Approaches
[Reference]https://www.vmware.com/pdf/virtualization.pdf
VMM virtualizes the CPU and the memory
• Traps interrupts and dispatches them to the individual guest operating systems.
• Maintains a shadow page table for each guest OS and replicates any modification
made by the guest OS in its own shadow page table.
• This shadow page table points to the actual page frame and it is used by the Memory
Management Unit (MMU) for dynamic address translation.
A virtual machine (VM) is a software program or operating system that not only exhibits
the behavior of a separate computer, but is also capable of performing tasks such as
running applications and programs like a separate computer.
• Multiple virtual machines can exist within a single host at one time.
• Virtually all operating systems provide a process VM for each one of the
applications running, but the more interesting process VMs are those that support
binaries compiled on a different instruction set.
System Virtual Machines: A system VM supports an operating system together with many
user processes. When the VM runs under the control of a normal OS and provides a
platform-independent host for a single application, we have an application virtual machine
(e.g., Java Virtual Machine [JVM]).
• A system virtual machine provides a complete system; each VM can run its own
OS, which in turn can run multiple applications.
• A system platform that supports the sharing of the host computer's physical
resources between multiple virtual machines, each running with its own
copy of the operating system.
Binary
optimizers HLL VMs
Hybrid VM
Codesigned VM-1 VM-n
VM
Hardware
(a) (b)
Application Application
Application
Application
Guest OS -n
Application
Guest OS -1
Application
VM-1 VM-n
Guest OS
Virtual Machine Monitor
Hardware Hardware
(c) (d)
Performance and security isolation
• Example - Xen has approximately 60,000 lines of code; Denali has only
about half: 30,000
• For example, Xen VMM has 28 hypercalls while Linux has 100s of
system calls
Full virtualization and
Par-virtualization
• Full virtualization ,in which each
virtual machine runs on an exact Guest OS Guest OS
copy of the actual hardware. Hardware Hardware
• (Guest OS is unaware that its in abstraction abstraction
a virtualized environment) layer layer
• Example: Vmware
Hypervisor Hypervisor
• Paravirtualization , in which each
virtual machine runs on a slightly
Hardware Hardware
modified copy of the actual
hardware.
• (Guest OS is already aware that (a) Full virtualization (b) Paravirtualization
they are shared hardware)
• Example: Xen
An equivalent formulation of the conditions for efficient virtualization can be based on this
classification of machine instructions.
• A VMM for a third-generation (or later) computer can be constructed if the set of
sensitive instructions is a subset of the privileged instructions of that machine. To handle
non virtualizable instructions, one could resort to two strategies:
• Binary translation. The VMM monitors the execution of guest operating
systems; non virtualizable instructions executed by a guest operating system
are replaced with other instructions.
• Para virtualization. The guest operating system is modified to use only
instructions that can be virtualized.
Advantages:
• This type of virtualization provide best isolation and security for Virtual machine.
• Truly isolated multiple guest OS can run simultaneously on same hardware.
• It's only option that requires no hardware assist or OS assist to virtualize sensitive
and privileged instructions.
Limitations:
• Full virtualization is usually bit slower ,because of all emulation.
• Hypervisor contain the device driver and it might be difficult for new device
drivers to be installer by users
Para virtualization
• Unlike full virtualization ,guest servers are aware of one another.
• Hypervisor does not need large amounts of processing power to manage guest OS.
• The entire system work as a cohesive unit.
Advantages:
• As a guest OS can directly communicate with hypervisor
Limitations:
• Para virtualization requires the guest OS to be modified in order to interact
with para virtualization interfaces.
• a VMMs forces the guest software, operating system and the applications to run at a
privilege level greater than 0.
• The x86 architecture provides Four layers of privilege executionrings(level 0-3)
• Address space compression - a VMM uses parts of the guest address space to
store several system data structures.
• Guest system calls which cause transitions to/from privilege level 0 must be
emulated by the VMM.
• Access to hidden state - elements of the system state, e.g., descriptor caches for
segment registers, are hidden; there is no mechanism for saving and restoring the
hidden components when there is a context switch from one VM to another.
• Ring compression - paging and segmentation protect VMM code from being
overwritten by guest OS and applications. Systems running in 64-bit mode can
only use paging, but paging does not distinguish between privilege levels 0, 1, and
2, thus the guest OS must run at privilege level 3, the so called (0/3/3) mode.
Privilege levels 1 and 2 cannot be used thus, the name ring compression.
• Since it has direct access to the hardware resources rather than going through an
operating system, a hypervisor is more efficient than a hosted architecture and
delivers greater scalability, robustness and performance.
X86 operating systems are designed to run directly on the bare-metal hardware, so they
naturally assume they fully ‘own’ the computer hardware. As shown in Figure 4,
the x86 architecture offers four levels of privilege known as Ring 0, 1, 2 and 3 to operating
systems and applications to manage access to the computer hardware.
• While user level applications typically run in Ring 3,
• the operating system needs to have direct access to the memory and hardware and
must execute its privileged instructions in Ring 0.
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.
Three alternative techniques now exist for handling sensitive and privileged instructions
to virtualize the CPU on the x86 architecture:
Xen
Domain0 control Virtual x86 Virtual physical Virtual block
interface Virtual network
CPU memory devices
X86 hardware
Performance comparison of virtual machines
We have seen that a VMM such as Xen introduces additional overhead and negatively
affects performance…..Will Compare the performance of Xen and OpenVZ
• Hosting multiple tiers of the same application on the same server is not an optimal
solution.
The experimental setups for three different experiments are shown in Figure 5.9 .
• In the first group of experiments the two tiers of the application, the Web and the
DB, run on a single server for the Linux, the OpenVZ, and the Xen systems.
• When the workload increases from 500 to 800 threads, The throughput
increases linearly with the workload.
• The response time increases only slightly for the base system and for the
OpenVZ system, whereas it increases 600% for the Xen system.
• For 800 threads the response time of the Xen system is four times longer than
the time for OpenVZ.
• The CPU consumption grows linearly with the load in all three systems; the DB
consumption represents only 1–4% of it.
For a given workload, the Web-tier CPU consumption for the OpenVZ system is close to that
of the base system and is about half of that for the Xen system.
• The performance analysis tool shows that the OpenVZ execution has two times more L2-
cache misses than the base system,
• whereas the Xen Dom0 has 2.5 times more and the Xen application domain has 9 times
more.
• The second group of experiments uses two servers, one for the Web and the other for
the DB application, for each one of the three systems.
• When the load increases from 500 to 800 threads the throughput increases linearly
with the workload.
• The response time of the Xen system increases only 114%, compared with 600%
reported for the first experiments. The CPU time of the base system,
• The OpenVZ system, the Xen Dom0, and the User Domain are similar for the Web
application.
• The third group of experiments uses two servers, one for the Web and the other for
the DB application,
• for each one of the three systems but runs four instances of the Web and the DB
application on the two servers.
• The throughput increases linearly with the workload for the range used in the
previous two experiments, from 500 to 800 threads.
• The response time remains relatively constant for OpenVZ and increases 5 times
for Xen
The main conclusion drawn from these experiments is that
• The VMBR can enable a separate malicious OS to run surreptitiously and make this
malicious OS invisible to the guest OS and to the application running under it.
• observe the data, the events, or the state of the target system.
• run services, such as spam relays or distributed denial-of-service attacks.
• interfere with the application.
Application
Application
Malicious Guest OS
OS
Operating
Malicious system (OS)
OS Virtual machine monitor
Hardware Hardware
(a) (b)
The insertion of a Virtual-Machine Based Rootkit (VMBR) as the lowest layer of the
software stack running on the physical hardware;
(a) below an operating system; (b) below a legitimate virtual machine monitor. The
VMBR enables a malicious OS to run surreptitiously and makes it invisible to the
genuine or the guest OS and to the application.
How such an insertion is possible
The malware runs either inside a VMM or with the support of a VMM;
But a VMM is a very potent engine for the malware. It prevents the software of the
guest operating system or the application from detecting malicious activities.
A VMBR can record key strokes, system state, data buffers sent to or received from
the network, and data to be written to or read from the disk with impunity; moreover, it
can change any data at will.
The only way for a VMBR to take control of a system is to modify the boot sequence
and to first load the malware and only then load the legitimate VMM or the operating
system. This is only possible if the attacker has root privileges.
Software fault isolation
• Software fault isolation (SFI) offers a technical solution for sandboxing binary code of
questionable provenance that can affect security in cloud computing.
• Insecure and tampered VM images are one of the security threats because binary codes
of questionable provenance for native plug-ins to a Web browser can pose a security
threat when Web browsers are used to access cloud services
• The application of the sandboxing technology for two modern CPU architectures,
ARM and 64-bit x86. ARM is a load/store architecture with 32-bit instruction and 16
general-purpose registers
Cloud Resource Management and Scheduling
• Resource management is a core function required for any cloud system or man-
made system. and inefficient resource management has a direct negative effect
on performance and cost, while it can also indirectly affect system functionality,
becoming too expensive or ineffective due to poor performance.
• Cloud resource management requires complex policies and decisions for multi-
objective optimization.
• The Strategies for resource management is associated with the three cloud delivery
models. IaaS, PaaS,SaaS differ from one another.
Admission control The goal is to prevent the system from accepting workload in
violation of high-level system policies. Example:
• workload requires some a system may not accept an additional workload that
would prevent it from completing work already in progress or contracted.
• Limiting the knowledge of the global state of the system.
• Control theory uses the feedback to guarantee system stability and predict
transient behavior. It can be used only to predict local rather than global
behavior.
r s (k )
u* (k)
Predictive Optimal Queuing
filter controller dynamics
external forecast (k )
traffic
Control Theory: The controller uses the feedback regarding the current state and
the estimation of the future disturbance due to environment to compute the optimal
inputs over a finite horizon.
• Compute the integral value of the high and the low threshold as averages of the
maximum and, respectively, the minimum of the processor utilization over the process
history.
• Request additional VMs when the average value of the CPU utilization over
the current time slice exceeds the high threshold.
• Release a VM when the average value of the CPU utilization over the current
time slice falls below the low threshold.
Conclusions
• Such auctions provide a relatively simple , scalable and tractable solution to cloud
resource allocation.
In all these algorithms , the current price for each resource is represented by a
“clock” seen by all participants at the auction.
Combinatorial auctions for cloud resources
• Prices and allocation are set as a result of an auction.
• Users provide bids for desirable bundles and the price they are willing to pay.
1. The user either gets one of the bundles it has opted for or nothing. No partial
allocation is acceptable.
2. The system awards only available resources ; only offered can be allocated.
3. The bid of winners exceeds the final price
4. The winners get the least expensive bundles in their indifference set.
5. Losers bid below the final price.
6. All prices are positive numbers.
Pricing and allocation algorithms
A pricing and allocation algorithm partitions the set of users in two disjoint sets, winners
and losers.
Desirable properties of a pricing algorithm:
• Scale well - given the scale of the system and the number of requests for service,
scalability is a necessary condition.
• Be objective - partitioning in winners and losers should only be based on the price
of a user's bid; if the price exceeds the threshold then the user is a winner, otherwise
the user is a loser.
• Be fair - make sure that the prices are uniform, all winners within a given resource
pool pay the same price.
• Indicate clearly at the end of the auction the unit prices for each resource pool.
• Indicate clearly to all participants the relationship between the supply and the
demand in the system.
u1 Proxy x1(t)
u2 Proxy x2(t)
x3(t)
u3 Proxy Auctioneer
x (t ) 0
u
u
uU Proxy xU(t)
p(t+1)
Ascending Clock Auction, (ASCA) the current price for each resource is represented by
a “clock” seen by all participants at the auction. The algorithm involves user bidding in
multiple rounds; to address this problem the user proxies automatically adjust their demands
on behalf of the actual bidders.
Scheduling algorithms for computing clouds
Scheduling It is a critical component of cloud resource management. It is responsible for
resource sharing/multiplexing at several levels:
• A server can be shared among several virtual machines.
• A virtual machine could support several applications.
• An application may consist of multiple threads.
• Soft-requirements policies
require statistically guaranteed
amounts and timing constraints
Figure 6.7 identifies several broad classes of resource allocation requirements in the
space defined by these two dimensions: best-effort, soft requirements, and hard
requirements.
Fair Scheduling Algorithms:
Max-Min fairness criterion:
• Consider a resource with Bandwidth B shared among n users who have equal rights.
• Each user requests an amount bi and receives Bi.
• Then according to max-min criterion, following conditions for fair allocation:
C1:Bi<=bi (The amount received by any user is not larger than the amount
requested.)
C2:Bmin should not be higher (if the minimum allocation of any user is Bmin no
allocation satisfying C1 has a higher Bmin than the current allocation.)
C3:B-Bmin (When we remove the user receiving the minimum allocation Bmin
and then reduce the total amount of resources available from B to( B-Bmin ) ,the
condition C2 remains recursively true.)
Fairness criterion for CPU scheduling
• A fairness criterion for CPU scheduling requires that the amount of work in the
time interval t1 to t2 of two runnable threads a and b ,
• Interconnection networks allow cloud servers to communicate with one another and
with users.
• When the load exceeds its capacity , a switch starts dropping packets,
because it has limited buffers for the switching fabric and for the outgoing links
, as well as CPU cycles.
• A switch must handle flows and pairs of source destination endpoints of the traffic. Thus
a scheduling algorithm has to manage several quantities at the same time.
Solution_2: Fair Queuing(FQ) proposes that separate queues, one per flow , be
maintained by a switch and the queues be serviced in a round robin (RR) manner.
• impractical scheme , a single bit from each queue is transmitted and the queues are
visited in a round robin fashion.
• A scheduler acts at each level of the hierarchy. The fraction of the processor
bandwidth, B, allocated to the intermediate node i is
• Thus, in the example, the time quanta of the two threads are q/wa and
q/wb, respectively
• The i -th activation of thread a will start at the virtual time Sia and will
finish at virtual time Fia
R1. The threads are serviced in the order of their virtual start-up time; ties are
broken arbitrarily.
R4. The virtual time of all threads is initially zero, v0x = 0. The virtual time v(t) at real
time t is computed as follows:
Borrowed virtual time
Objective - support low-latency dispatching of real-time applications, and weighted
sharing of CPU among several classes of applications.
• Like SFQ , BVT supports scheduling of a mix of applications- hard, soft real
time constraints ,best effort.
A thread i has
• an effective virtual time, Ei.
• an actual virtual time, Ai.
• a virtual time warp, Wi.
• The scheduler thread maintains its own scheduler virtual time (SVT) defined as
the minimum actual virtual time Aj of any thread.
• The threads are dispatched in the order of their effective virtual time Ei, a policy
called the Earliest Virtual Time (EVT).
• The virtual warp time allows a thread to acquire an earlier effective time ie., to
borrow virtual time from its future CPU allocation.
• The virtual warp time is enabled when the variable warpBack is set.
In this case a latency-sensitive thread gains dispatching preference as
• The algorithm measures time in minimum charging units(mcu) and uses time
quantum called Context switch allowance(C)
• which measures the real time a thread is allowed to run when competing with
other threads, measured in multiples of mcu.
• example: mcu=100μsec C= 100 msec
• The demand for computing resources, such as CPU cycles, primary and secondary
storage, and network bandwidth, depends heavily on the volume of data processed by
an application.
• The demand for resources can be a function of the time of day, can monotonically
increase or decrease in time, or can experience predictable or unpredictable peaks.
For example,
• a new Web service will experience a low request rate when the service is
first introduced and the load will exponentially increase if the service is
successful.
• A service for income tax processing will experience a peak around the tax
filling deadline, whereas access to a service provided by Federal Emergency
Management Agency (FEMA)will increase dramatically after a natural
disaster.
The question we address is: How scaling can actually be implemented in a cloud when a
very large number of applications exhibit this often unpredictable behavior.
Vertical scaling keeps the number of VMs of an application constant, but increases the
amount of resources allocated to each one of them.
• This can be done either by migrating the VMs to more powerful servers or by
keeping the VMs on the same servers but increasing their share of the CPU time.
• The first alternative involves additional overhead; the VMis stopped, a snapshot
of it is taken, the file is transported to a more powerful server, and, finally, the
VM is restated at the new site.
Horizontal scaling is the most common mode of scaling on a cloud; it is done by
increasing the number of VMs as the load increases and reducing the number of VMs
when the load decreases.
• For a very large application, multiple load balancers may need to cooperate with
one another. In some instances the load balancing is done by a front-end server
that distributes incoming requests of a transaction-oriented system to back-end
servers.
Most cloud applications belong to this class, which justifies our statement that horizontal
scaling is the most common scaling mode.
There are several strategies to support scaling.
• Automatic scaling requires sensors to monitor the state of VMs and servers;
controllers make decisions based on the information about the state of the cloud,
often using a statemachine model for decision making. Amazon and Rightscale
(www.rightscale.com) offer automatic scaling.
• In the case of AWS the CloudWatch service supports applications monitoring and
allows a user to set up conditions for automatic migrations.