Sei sulla pagina 1di 83

Introduction to PaaS and IaaS Cloud Computing

Roberto Beraldi
Models for Cloud Computing

(SaaS)Software as a Service

XaaS (PaaS) Platform as a Service

(IaaS) Infrastructure as a Service


Models for cloud computing
CC in a nutshell
Cloud computing is a way to use Information
Technology infrastructures without the need to
install specific HW related to the infrastructures
being used.
IT infrastructure can be as simple as a single raw
virtual machine,
more abstract as a sw platform used to develop
and running applications on several machines,
or a sw application
What CC can provide?
Infrastructure as a service (IaaS)
Platform as a service (PaaS)
Software as a service (SaaS)
API as a service (APIaaS)
STorage as a service (STaaS)
X as a service (XaaS)
Main characteristics of CC
Pay-per-use
no ongoing commitment, utility prices
Elastic capacity and the illusion of infinite resources
Multitentancy
Same instance of an application to serve multiple clients
Resources that are abstracted or virtualized Resources
provided as a Service and with a self-service Interface
provides users the ability to upload, build, deploy,
schedule, manage, and report on their business services
on demand.
Factors enabling cloud computing
Hardware
HW virtualization
Multi-core chips
Computing
Distributed

Technologies
Internet
Utility computing Web 2.0
Grid Computing Cloud Web Services
.. computing Mashups
SoA

Autonomic Computing
Data Center Automation

System Management
Cloud actors
Platform as a Service
A cloud platform offering an environment on
which developers create and deploy applications
E.g., decide the size of the VM, where they are
located, etc.
Different Programming Languages
PHP
Java
Ruby
Different DB
Web based console to create application (with
dashboard)
Platform as a Service
Developers can use an IDE to develop the
application and use either an SDK or CLI to
deploy the application
Impact on the programming model
Main players:
Googles app engine, OpenShift, Windows Azure,
and many more
PaaS example: GAE
Cloud service for running web applications on the
Google data center
GAE is one of the most interesting and complete
PaaS
Simple configuration
Transparent scalability
infinite number of applications, req/sec storage
Security
All applications run inside a sandbox, do not have direct access to
file system, cannot open other connections
Different programming languages
GAE console
Lots of service
Compute
App Engine
VM
Storage
BigTable
SQL
Datastore
Operations
Monitoring
Debugging
Etc.
Tools
Deployment Manager
Development
Big Data
SDK
GAE architecture
Google App Engine speaks with web applications
through the Web Server Gateway Interface (WSGI)
standard protocol
App Engine and SDK includes the webapp2
framework that implements WSGI

WSGI Protocol

HTTP Requests WEB Server WEB App


GAE: supported language
Java
JVM, Java servlet,
SDK Eclipse extension
Python
Standard library (without unsecure calls)
Go
PHP (new)
LAB: Hello Word in GAE
What we need:
Google account
GAE registration
Plafond free (10 app)
Register a new application
The application ID will be used to deploy the
application
SDK
Use the language
Python 2.7 (no support for 3.x)
Hello Word in GAE
Step 1

Code Step 4
Deploy Google Cloud
helloworld.py

Web-based Admin console

Simulator
Conf Step 2
app.yaml Step 3
Hello Word in GAE
Step 1

Code
helloworld.py

Define a handler for the HTTP requests as a class that extends


webapp2.RequestHandler class (MainPage)
Attributes : response, request (instance of class Request, Response)
Methods: get,post, etc.. (to override)
Map HTTP get request to get method (also post, put, etc..)
Write data to HTTP response through self.response
app is a global name that must assigned to the application
Step 3

Conf

app.yaml

Step 4
Deploy Google Cloud
appcfg.py update .

Web-based Admin console


An application name helloword must be registered with the
google engine
helloworld.appspot.com
Dashboard
GAE architecture (simplified view)
HTTP Requests

App Eng App Eng App Eng


Front End Front End Front End
Balancer
Load

App Server App Server App Server

Other API layer


Google
Service APP APP APP
Python GAE architecture

REQ/REP
Services CGI
Sandbox
URLfetch
Standard
mail Lib
Python
VM App
images
Read-only
File system

BigTable

MEMCACHE DATASTORE

Source: Google App Engine Guido van Rossum


Python GAE architecture (scaling)

REQ/REP
Services CGI
Sandbox
URLfetch
Standard
mail Lib
Python
VM App
images
Read-only
.
File system
.

BigTable

MEMCACHE DATASTORE

Source: Google App Engine Guido van Rossum


Example: PHP
an app that handles customer requests might
include separate modules to handle other
tasks, such as:
API requests from mobile devices
Internal, admin-like requests
Backend processing such as billing pipelines and
data analysis
Appication modules instances
GAE and mobile apps
OpenShift
OpenShift Online by Red Hat is a Platform as a Service (PaaS) that provides
developers and IT organizations with an auto-scaling, cloud application
platform for deploying new applications on secure, scalable resources with
minimal configuration and management overhead.
Languages
Java, Ruby, and PHP. Integrated developer tools, such as Eclipse integration, JBoss Developer
Studio, and Jenkins, support the application life cycle.
Database
MySQL, PostgreSQL, MongoDB, and SQLite.

OpenShift Online provides disk space, CPU resources, memory,


network connectivity, and an Apache or JBoss server to create,
deploy, and manage applications in the cloud.

Management web console

CLI, very powerful for coding debugging etc

Source: online documentation


OpenShift: basic System components
Subscription plan
Example: create and application

git to pull

CLIENT git commit GEAR


PaaS example2: Windows Azure

It is a set of integrated cloud technologies each


providing a specific set of services to application
developers
Windows Azure provides developer-accessible
services for creating applications
Strongly integrated with Visual studio
Development fabric simulator
Development storage simulator
Windows azure
Two execution models for applications
Web hosting: Web Site
PaaS: Cloud Service
IaaS: Virtual Machines

http://www.windowsazure.com/en-us/develop/net/fundamentals/intro-to-windows-azure/
Deployement
Web Portal
1. Register (Live-id)

2. Create Hosted-Service
http://xxxx.cloudapp.net
Service
3. Package upload
.csconf + .cspkg
Service

Fabric Service
Controller
Conf
(n.inst. =3)

Service
.cspkg
Microsoft azure
Lots of services are added during the years
Computation
VM,Cloud Services,Batch,RemoteApp
Web and mobile device
Backend for mobile app
Data and storage
Data analysis
Machine learning
Internet of Things

INFRASTRUCTURE AS A SERVICE
Cloud computing in a nutshell
(by an analogy)

Production Distribution Utilization

Electricity is virtual entity


(many sources, we do not care from where we receive it,)
Pay-as-you-go
Elastic
CC: Virtual computing power
Provider Utilization

CPU
cycles

Memory

Storage Virtual machine

control panel

User decides the size on the VM


IaaS
A cloud infrastructure enables on-demand provisioning of
servers running several choices of operating systems and a
customized software stack.

Cloud computing services are usually backed by large-scale


data centers composed of thousands of computers.

Such data centers are built to serve many users and host
many disparate applications.

Offers virtualized resources (computation, storage, and


communication) on demand
IaaS: deployment models
Virtualization, main idea
Memory:
Virtual Memory (>=Physical memory)
Multitasking:
Several processes concurrently on the same HW, see the same
ISA. HW is shared thanks to an OS than manages critical
instructions.
Virtual Machine:
60 from IBM on mainframes
Abandoned with the advent of PCs, now again used for cloud
computing
Even different ISA on the same CPU
Used to run different OS (not processes)
Achieved through a Virtual Machine Monitor
Isolation
Through virtualization, workload isolation is
achieved since all program instructions are fully
confined inside a VM, which leads to
improvements in security.
Better reliability is also achieved because
software failures inside one VM do not affect
others.
Moreover, better performance control is attained
since execution of one VM should not affect the
performance of another VM.
Isolation
Application mobility
Workload migration, also referred to as application
mobility, targets at facilitating hardware maintenance,
load balancing, fault tolerance and disaster recovery.

It is done by encapsulating a guest OS state within a


VM and allowing it to be suspended, fully serialized,
migrated to a different platform, and resumed
immediately or preserved to be restored at a later
date.

A VMs state includes a full disk or partition image,


configuration files, and an image of its RAM.
Application mobility
HW consolidation
Virtualization makes it possible to consolidate
individual workloads onto a single physical
platform, reducing the total cost of ownership.
Interface of a computing system
Virtual Machine
Virtual Machine is a logic machine (ML) whose ISA is
implemented exploiting software running on a
physical machine (MF)
Two main types:
Native. ML=MF
Same ISA. Indeed instructions of the MF are in large part executed
on the real CPU. Sensitive instruction are trapped.
Emulation MLMF (different ISA)
HW emulation
Language level emulation (java)
Emulation
HW emulation:
ISA is different from real CPU
Sparc emulates IA32
Installation of different OS
Language specific VM
JVM
CLR
Native emulation Virtual machine
Same machine as the physical machine
Efficient, isolated duplicate of a real
machine)
Virtualization is realized by a Virtual Machine
Monitor (VMM) o hypervisor
Native emulation
Full virtualization
OS without modification (e.g., VMWares ESX,
ESXi)
OS legacy
Para virtualization
OS must be modified (e.g., Open sources XEN)
Higher efficiency
Resources
Xen and the Art of Virtualization, Pratt et al. SOSP
2003.

The Architecture of Virtual Machines, Smith, J.E.; R.


Nair, IEEE Computer, May 2005, Volume: 38 , Issue: 5

A Comparison of Software and Hardware Techniques


for x86 Virtualization, K. Adams, O. Agesen. ASPLOS
2006.
Classical virtualization
A classical VMM executes guest operating system
directly, but at a reduced privileged level. The VMM
intercepts traps from the de-privileged guest, and
emulates the trapping instruction against a virtual
machine state[*]

[*]A camparison of Software and Hardware Techniques


for x86 Virtualization, K.Adams, O.Agesen, ASPLOS
2006
Classical virtualization, esempio
a. CPU executes a kernel User level Kernel level
instruction of the Guest OS Guest OS VMM Not privileged instruction

while being in user mode


b. CPU generates a trap 1 Privileged instruction
c. Control passes to the VMM e.g.. CLI, Clear Interrupts

that emulates the instruction 2 trap 2


d. 2 is different of 2, but is
produces the same effect ( 3 green= User Mode
(for example, red= System Mode
CLI VCPU.IF=0) 4

time
Hw virtualizazion

Hardware virtualization allows running multiple operating systems and software


stacks on a single physical platform.
The virtual machine monitor (VMM), hypervisor, mediates access to the
physical hardware presenting to each guest operating system a virtual machine
(VM), which is a set of virtual platform interfaces
Type-1 hypervisor (bare metal)
Guest OS runs unchanged
Used to build a Hardware Server (cloud computing)
Hyper-V(Microsoft) , VMWares ESX
Type-2 hypervisor (hosted)
Runs on top of a Hosting OS
Often used on clients
Example of VMM: Virtual Box

It usually runs on Desktop computers


VMM runs as an application hosted by an OS
Lower performance, easy to install VM
HW assisted virtualization
Processors are designed to help virtualization
For example, Intel-VT and AMD-V provide
additional instructions that help virtualization
Hypervisors can use these instructions to
improve the performance
Linux KVM, Microsoft Hyper-V, Microsoft Virtual
PC, Xen, etc. use these features
IaaS providers point of view
A key challenge IaaS providers face when
building a cloud infrastructure is managing
physical and virtual resources, namely servers,
storage, and networks, in a holistic fashion.
The orchestration of resources must be
performed in a way to rapidly and dynamically
provision resources to applications.
IaaS providers point of view
The software toolkit responsible for this
orchestration is called a virtual infrastructure
manager (VIM).
This type of software resembles a traditional
operating system (cloud operating system)
but instead of dealing with a single computer,
it aggregates resources from multiple
computers, presenting a uniform view to user
and applications.
VIM and hypervisor
Virtual
server

Hypervisor Hypervisor Hypervisor


VIM

Virtualization
platform

physical
servers
Automated scaling
Physical server 1 Physical server 2
2) VIM allocates the new VM

2
hypervisor VIM hypervisor
Automated scale
listener
4

3 1 Usage and administrator


portal

3) User increases the load 1)User request a new VM


request That joins the existing 3 VM
Example: automated scaling
Physical server 1 Physical server 2

hypervisor VIM hypervisor


Automated scale
listener
Example: OpenNebula
Interface to Public Clouds: it offers a driver to
manage the life cycle of virtualized resources
obtained from external cloud providers.
In case of spikes in demand, extra load can be
offloaded to rented resources. To the
applications, the use of leased resources must
ideally be transparent
Example: OpenStack

OpenStack is a cloud operating system that


controls large pools of compute, storage, and
networking resources throughout a datacenter,
all managed through a dashboard that gives
administrators control while empowering their
users to provision resources through a web
interface.
Example of IaaS
Windows azure
Different machine with different size and OS
Different geographical region where the machine
is located
Free trial (requires registration with VISA)
Main Amazon Web Service offering
Elastic Cloud Computing (EC2)
Amazon Elastic Compute Cloud (Amazon EC2) is a web
service that provides resizable compute capacity in
the cloud.
Amazon Simple Storage Service (Amazon S3)
Amazon S3 provides a simple web services interface
that can be used to store and retrieve any amount of
data, at any time, from anywhere on the web.
Amazon Simple Queue Service (Amazon SQS)
offers a reliable, highly scalable hosted queue for
storing messages as they travel between computers
Current offer
Amazon Web Services (EC2)
Rich set of VM
General purpose
baseline level of CPU performance with the ability to burst above the
baseline
Compute Optimized, GPU, etc
Reserved Instance
Amazon EC2 Reserved Instances allow to reserve Amazon EC2
computing capacity for 1 or 3 years
Dedicated Instance
run in a VPC (Virtual Private Cloud) on hardware that's dedicated to a
single customer.
Cluster networking
Spot Instance
allow to bid on spare Amazon EC2 computing capacity.
Price (depends on the location)
Microsoft Azure vs Amazon AWS
Short story: AWS is superior to Windows
Azure
Long story: see
http://www.computerworlduk.com/it-
vendors/microsoft-azure-vs-amazon-aws-public-
cloud-comparison-which-cloud-is-best-for-
enterprise-3624848/
New trends: Containers

Each virtual machine includes the


application, the necessary binaries and
libraries and an entire guest operating
system - all of which may be tens of GBs
in size.
Containers

Containers include the


application and all of its
dependencies, but
share the kernel with
other containers. They
run as an isolated
process in userspace on
the host operating
system.
Same OS!
Runs only on Linux
Much faster
Mobile Cloud Computing
Exploiting cloud approach to boost the
performance of an application, reduce the energy
consumption, increase the computation power
Example: CloneCloud
The system is a flexible application partitioner and
execution runtime that enables unmodified mobile
applications running in an application-level virtual
machine to seamlessly off-load part of their execution
from mobile devices onto device clones operating in a
computational cloud.
CloneCloud: main idea
Mobile-to-mobile offloading
Questions?

Potrebbero piacerti anche