Introduction to Cloud Computing Roberto Beraldi
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
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
Cloud computing Cloud computing, like other technologies, such as cluster, grid, aims at allowing access to large amounts of computing power in a fully virtualized manner, by aggregating resources and offering a single system view. Cloud computing has been coined as an umbrella term to describe a category of sophisticated ondemand computing services initially offered by commercial providers, such as Amazon, Google, and Microsoft.
What CC can provide? Infrastructure Platform Software API STorage Desktop X as a service (IaaS) as a service (PaaS) as a service (SaaS) as a service (APIaaS) as a service (STaaS) as a service (DaaS) as a service (XaaS)
History of CC Roots in the 60 s: Big organizations made resources accessible by thin clients; Also origin of virtualization Then in the 90 s: Application Service Providers; Virtual Private Networks. Evolution of Utility Computing. In 2006, Amazon Web Services (AWS) began offering IT infrastructure services to businesses in the form of web services. About two years later first open source cloud platforms were released (e.g. Eucalyptus).
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 Distributed Computing Utility computing Grid Computing.. Cloud computing Web 2.0 Web Services Mashups SoA Internet Technologies Autonomic Computing Data Center Automation System Management
Cloud actors
From mainframes to clouds Providers of CC can operate their infrastructures at very high utilization rate Something similar to what happened with Mainframes. They had to operate at very high utilization rates simply because they were very expensive and costs should be justified by efficient usage
Provisioning Provisioning for peak load Underprovisioning, case 1 Underprovisioning case 2
Type of Cloud Computing (SaaS)Software as a Service XaaS (PaaS) Platform as a Service (IaaS) Infrastructure as a Service
Cloud computing and mobile apps Mobile applications can benefit from cloud infrastructures in two ways to store and sync data (icloud,dropbox,etc..). to run remote code Web API (as a Service) create ad hoc clouds
Example: Store and synchronize data Dropbox is designed with multiple layers of protection, including secure data transfer, encryption, network configuration, and application- and user-level controls that are distributed across a scalable, secure infrastructure.
Example: access to dropbox 3 sets of API Core Datastore Sync See documentation
WEB Api as a Service e.g., rest call { json: } SERVER
Mobile cloud computing Access to a remote server Create a local cloud with mobile resources Mobile cloud computing: A survey Niroshinie Fernando,Seng W. Loke,Wenny Rahayu Future Generation Computer Systems 29 (2013) 84 106 Use local server as cloud provider (cloudlets), and access to remote clous as well
Mobile cloud computing Example of MCC CloneCloude Maui
CloneCloud Main Idea: augments the smartphone s capabilities by seamlessly off-loading some tasks to a nearby computer, where they are executed in a cloned whole-system image of the device, reintegrating the results in the smartphone s execution upon completion. Augmented Smartphone Applications Through Clone Cloud Execution. Byung-Gon Chun, Petros Maniatis.
MAUI MAUI uses code portability to create two versions of a smartphone application, one of which runs locally on the smartphone and the other runs remotely in the infrastructure. Managed code enables MAUI to ignore the differences in the instruction set architecture between today s mobile devices (which typically have ARM-based CPUs) and servers (which typically have x86 CPUs). MAUI uses programming reflection combined with type safety to automatically identify the remoteable methods and extract only the program state needed by those method MAUI profiles each method of an application and uses Serialization to determine its net- work shipping costs (i.e., the size of its state) MAUI: Making Smartphones Last Longer with Code Offload
MAUI architecture Mark method as remotable At run-time, MAUI generates client and server proxy Profile: MAUI determines whether the method invocation should run locally or remotely Solver: The MAUI solver uses data collected by the MAUI profiler as input to a global optimization problem that determines which remoteable methods should execute locally and which should execute remotely. The solver s goal is to find a program partitioning strategy that minimizes the smartphone s energy consumption, subject to latency constraints
INFRASTRUCTURE AS A SERVICE
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
Virtualization - 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.
Virtualization - isolation
Virtualization 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 VM s state includes a full disk or partition image, configuration files, and an image of its RAM.
Virtualization application mobility
Virtualization - consolidation Virtualization makes it possible to consolidate individual workloads onto a single physical platform, reducing the total cost of ownership.
Automated scaling Physical server 1 Physical server 2 2) VIM allocates the new VM hypervisor 2 VIM hypervisor Automated scale listener 4 3) User increases the load request 3 1 Usage and administrator portal 1)User request a new VM That joins the existing 3 VM
Automated scaling Physical server 1 Physical server 2 hypervisor VIM hypervisor Automated scale Automated scale listener
Virtual machines Virtual machine is a logic machine implemented via software (M L ) running on a physical machine (M F ) Two main types No native emulation M L M F Native emulation. M L =M F
Process virtual machine Runs a SW process Examples Java Virtual Machine Common Language Runtime (CLR)/.NET
Virtual machine and interoperabiity Java Virtual Machine (JVM) ISA: Stack machine (zero-register) Java JVM write once run everywhere M F1 M F2 M Fn
System virtual machine Same machine as the physical machine Efficient, isolated duplicate of a real machine ) Virtualization is realized by a Virtual Machine Virtualization is realized by a Virtual Machine Monitor (VMM) o hypervisor
System virtual machine Full virtualization OS without modification (VMWare) OS legacy Paravirtualization OS must be modified Higher effciency
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 instruction of the Guest OS Guest OS while being in user mode b. CPU generates a trap c. Control passes to the VMM that emulates the instruction 1 2 d. 2 is different of 2, but is produces the same effect ( 3 (for example, CLI VCPU.IF=0) 4 5 trap Kernel level VMM 2 Not privileged instruction Privileged instruction e.g.. CLI, Clear Interrupts green= User Mode red= System Mode 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), VMWare ESX
Type-2 hypervisor (hosted) Runs on top of a Hosting OS Guest OS unchanged (full virtualization) Often used on clients
Example of VMM: Virtual Box It usually runs on Desktop computers VMM runs as an application hosted by an OS Software-based virtualization Lower performance, easy to install VM
IaaS provider s 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 provider s 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
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 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.
IaaS: deployment model
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)
Platform as a Service A cloud platform offering an environment on which developers create and deploy applications Developers do have access to a SDK that allows to develop a new application and to deploy it in the cloud Impact on the programming model Google s app engine, Windows Azure, OpenShift, and many more
PaaS example: GAE Cloud service for running web applications on the Google data center Do one thing well 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
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 Advanced frameworks can be used, e.g., Django WSGI Protocol HTTP Requests WEB Server WEB App
GAE: supported language Java JVM, Java servlet, SDK Eclipse extension Python Go Standard library (without unsecure calls)
LAB: Hello Word in GAE What we need: Google account GAE registration Plafond free (10 app) Register a new application SDK The application ID will be used to deploy the application Python 2.7 (no support for 3.x)
Hello Word in GAE Step 1 Code helloworld.py Deploy Step 4 Google Cloud Web-based Admin console Conf app.yaml Step 3 Simulator Step 2
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 Deploy Step 4 Google Cloud appcfg.py update. Web-based Admin console An application name helloword must be registered with the google engine helloworld.appspot.com
GAE architecture (simplified view) HTTP Requests App Eng Front End App Eng Front End App Eng Front End Load Balancer App Server App Server App Server Other Google Service API layer APP APP APP
Python GAE architecture REQ/REP Services CGI Sandbox URLfetch mail images Python VM Standard Lib App Read-only File system BigTable MEMCACHE DATASTORE Source: Google App Engine Guido van Rossum
Python GAE architecture (scaling) REQ/REP Services CGI Sandbox URLfetch mail images Python VM Standard Lib App Read-only File system BigTable MEMCACHE DATASTORE Source: Google App Engine Guido van Rossum
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 1. Register (Live-id) Web Portal 2. Create Hosted-Service http://xxxx.cloudapp.net 3. Package upload.csconf +.cspkg Service Service Conf (n.inst. =3) Fabric Controller Service Service.cspkg
https://www.openshift.com/get-started#cli 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. OpenShift Online supports a wide selection of programming languages and frameworks, such as Java, Ruby, and PHP. Integrated developer tools, such as Eclipse integration, JBoss Developer Studio, and Jenkins, support the application life cycle. 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 consolle CLI (rhc), very powerfull for coding debugging etc Source: online documentation
OpenShift: basic System components
Subscription plan
Example: create and application git to pull CLIENT git commit GEAR