Cloud Computing (LTAT.06.008) Lecture 2- Virtualization

Transcription

Cloud Computing (LTAT.06.008)Lecture 2- VirtualizationMr. Shivananda R PoojaraResearch AssistantMobile and Cloud Lab1

Lecture Outcome and Outline- Outline an IaaS service model, architecture and industryplayers- Understand the use of virtualization in cloud computingand its architecture, types & industry tools.- Understand the architecture of Docker and its workingprinciples.Lecture Content from the text book, chapter 3- Virtualization:Mastering Cloud Computing – Book by Christian Vecchiola, Rajkumar Buyya, and S. Thamarai Selvi,2013th edition.Presentations from 7-24 referred from Prof. Satish Srirama lecture in Spring 2019https://courses.cs.ut.ee/MTAT.08.027/2019 spring/uploads/Main/L7 MoreAWSResearchMobileCloudLab2019.pdf2

Cloud Computing Services2/16/2021Shivananda Poojara3

Infrastructure as a service modelWeb based Management InterfaceWeb Services, Portals, REST APIInfrastructure Management SoftwarePricing /BillingQoS vationVM Image RepositoryVM PoolManagementPhysical ClusterDesktop /HeterogeneousResourcesShivananda PoojaraThird Party IaaSCloud4

Cloud Providers and Services Amazon Web Services – We will focus more. Compute: EC2 Storage: S3, EBS– Scaling: Elastic Load Balancing, Auto Scale, CloudWatch Eucalyptus OpenStack Management providers AWS Management Console OpenStack Horizon RightScale PaaS Google AppEngine Windows Azure Elastic MapReduce2/16/2021Shivananda Poojara5

Openstack Founded by NASA and Rackspace The open source cloud computing platform Feature-rich and massively scalable Powers cloud storage, compute, and networking A world-wide open source collaboration Openstack is Infrastructure as a Service which is knows as Cloud Operating System, thattakes resources such as compute, storage and network, Virtualization technologies thatcontrol those resources at a data center level. 110 Companies 50 M Venture capital Motivation: Rackspace had 1.794 billion income2/16/2021Shivananda Poojara6

Openstack supporting companies2/16/2021Shivananda Poojara7

Openstack high level penstack-101-update2/16/2021Shivananda Poojara8

Amazon Web Services stackCompute ServicesStorage ServicesAmazon ElasticCompute Cloud(EC2)Amazon SimpleStorage Service (S3)Amazon ElasticMapReduceAmazon ElasticBlock Store (EBS)AWS ElasticBeanstalkAmazon ElastiCacheAWS CloudformationAmazon SimpleDBAutoscalingAmazon RelationalDatabase Service(RDS)Amazon VirtualPrivate Cloud (VPC)Amazon CloudFrontAmazon DirectConnectAmazonImport/ExportAmazon ElasticLoad BalancingElastic containerserviceWe willfocus in thisverticalIaaSLamdaCommunicationServicesAmazon SimpleQueue Service(SQS)Amazon SimpleNotification Service(EBS)Amazon SimpleEmail Service (SES)Amazon Route 53Additional ServicesAmazon GovCloudAmazon CloudWatchAmazon FlexiblePayment Service(FPS)Amazon DevPayAmazon FullfillmentWeb Service (FWS)Amazon MechanicalTurkAlexa WebInformation ServiceAlexa Top Siteshttp://buyya.com/2/16/2021Amazon AWS PlatformShivananda Poojara9

AWS Elastic Compute Cloud – EC2 It provides scalable compute capacity in AWS cloud services. You can configure your own instance with security, networking and storage. Enables you to scale up and down to handle your workload. Characteristics: 2/16/2021Virtual computing environments known as instances.Preconfigured templates- Amazon Machine Images and package bitsVarious capacity types of instance – CPU, Memory, StorageKey pair for secure loginStorage volumes for temporary data- instance store volumesPersistent storage volumes-Amazon EBS volumesMultiple physical locations for your resources-Regions and Availability ZonesSecurity groupsStatic IPv4 addresses for dynamic cloud computing, known as Elastic IP addressesConnect to your own network, known as virtual private clouds (VPCs)Shivananda Poojara10

AWS EC2 Instance types2/16/2021Shivananda Poojara11

AWS EC2 Instance Types General purpose instance Uses: Scale-out workloads such as web servers, containerized micro services Compute Optimized Uses: High performance web servers, scientific modelling, batch processing, distributed analytics,machine/deep learning inference. Memory optimized instances Used for high performance databases, distributed web scale in-memory caches, real time big dataanalytics, and other enterprise applications. Accelerated Computing Machine/Deep learning, high performance computing, computational fluid dynamics, Storage optimized2/16/2021Shivananda Poojara12

AWS EC2 Spot Instances Spot Instances Spot Instances are available at a discount of up to 90% off compared to OnDemand pricing. Prices are set on spot based availability zone and region Used for known start and end types of applications Examples: fault-tolerant, or flexible applications such as big data,containerized workloads, CI/CD, web servers, high-performance computing(HPC)2/16/2021Shivananda Poojara13

AWS cloud formation Provides an easy way to create and manage a collection of related AWS resources, provisioningand updating them in an orderly and predictable fashion It is based on templates model Templates describe the AWS resources, the associated dependencies, and runtimeparameters to run an app. The templates describe stacks, which are set of software and hardware resources. Something similar to CloudML and RightScale server templates Hides several details How the AWS services need to be provisioned Subtleties of how to make those dependencies work.Free tier1,000 handler operations permonth per accountOther 0.0009 per handler operation *Inside AWSNo price*handler operation durations above 30 seconds per operation, you will be charged 0.00008 per second above the threshold.2/16/2021Shivananda Poojara14

Resources:Ec2Instance:Type: 'AWS::EC2::Instance'Properties:SecurityGroups:- !Ref InstanceSecurityGroup- MyExistingSecurityGroupKeyName: mykeyInstanceType: t2.microImageId: ami-7a11e213InstanceSecurityGroup:Type: on: Enable SSH access via port 22SecurityGroupIngress:- IpProtocol: tcpFromPort: '22'ToPort: '22'CidrIp: 0.0.0.0/02/16/202115/37

Virtualization What is Virtualization? Being to Original but not History of Virtualization: Virtualization’s roots go back to 1960’s from IBM in x86 Architecture. Jim Rymarcktz – first main frame virtualization. IBM’s CP-67 software to partitions and share. VmWare had become pioneer in the virtualization technologies. Virtualization transforms hardware into software. It is the creation of a fully functional virtual computer that can run its ownapplications and an operating system. Creates virtual elements of the CPU, RAM, and hard disk.16

Virtualization- In ation17

Virtualization- DefinitionDefinition - What does Virtualization mean? Virtualization refers to the creation of a virtual resource such as a server, desktop,operating system, file, storage or network. Allows creation of secure, customizable and isolated execution environment forrunning applications. Linux on Windows. Virtualization provides an abstract environment.18

Virtualization- Motivation Increased performance and computing capacity relevance to hardwaremanufacturing. Underutilized Hardware and software Resources Lack of Space Greening Initiatives Rise of administrative costs Administrative tasks include: labor intensive hardware monitoring defective hardware replacement server setup and updates resource monitoring backups19

Three players in virtualizationGuest: direct contact with VL not tohostVirtualization Layer: recreating env.As like host. (Emulation)Virtual ImageApplicationsApplicationsGuestVirtual HardwareVirtual StorageVirtual NetworkingVirtualization LayerSoftware EmulationHost : Original env. Where guest ismanagedPhysicalHardwarePhysical StorageHostPhysical Networking20http://buyya.com/

Characteristics of Virtualization Increased Security Controlling the guest provides secure, controlled execution environment. Operations—Guest VM—emulate– Host– real operations. Resources can be hidden from guest not to install complex security policies.Example:- applets– download—run –sandbox version of JVM protects from guest tointeract with host.- Java and .NET provide such security policies for customizing executionenvironment. Managed ionIsolationVirtualizationPhysicalResources Portability21http://buyya.com/

Taxonomy of Virtualization TechniquesHow it evel dwareassistedVirtualizationNetworkSystemLevel m/22

Taxonomy of Virtualization Techniques Virtualization is mainly used to emulate execution environment , storage andnetworks. Execution Environment classified into two :– Process-level – implemented on top of an existing operating system.– System-level – implemented directly on hardware and do not or minimumrequirement of existing operating system Computer system is complex, and yet it continue to evolve. Computer is designed as hierarchies of well-defined interfaces thatseparate level of abstraction. Simplifying abstractions hide lower-level implementation details.23

Hypervisor Hypervisor runs above the supervisor mode. It recreates a h/w environment. It is a piece of s/w that enables us to run one or more VMs on a physicalserver(host). Two major types of hypervisor – Type –I– Type-II It runs directly on top of the hardware. Takes place of OS. Directly interact with the ISA exposed by theunderlying hardware. Also known as native virtual machine.Example: VmWare ESXi, MS HyperV It require the support of an operating system toprovide virtualization services. Programs managed by the OS. Emulate the ISA of virtual h/w. Also called hosted virtual machine.Example: KVM, Virtual Box24

Type I & Type II HypervisorType IIType IOS- Operating Systemhttp://buyya.com/25

Hardware virtualization Techniques Full Virtualization Ability to run program (OS) directly on top of a virtual machine and without anymodification. Para Virtualization Guest OS need to be modified.Simply transfer the execution of instructions which were hard to virtualized,directly to the host. Partial Virtualization Partial emulation of the underlying hardware and not allow complete isolation to guest OS. Hardware assisted Virtualization Hardware provides architectural support for building a VMM able to run a guestOS in complete isolation.26

Different levels of VirtualizationApplicationsExecution StackApplication - levelVirtualizationProgramming LanguagesProgrammingLanguage levelVirtualizationOperative SystemsOS- levelVirtualizationHardwareHardware - levelVirtualizationhttp://buyya.com/27

Cons of VirtualizationDisadvantages– Performance degradation– Inefficiency and degraded user experience– As it interposes and abstraction layer between guest & host.Some of specific features of the host is unexposed. Security holes and newthreatsCase 1 – emulating a host in a completely transparent manner.Case 2 - H/w virtualization , malicious programs can preload themselvesbefore the OS and act as a thin VMM.28

What is a container?Containers LXC is a Linux container is a Linux operating system-level virtualization method forrunning multiple isolated linux based systems on single host controlled andmanaged by Namespaces and Cgroups. To understand the container technology, the following concepts playan important role: Namespaces: Originally developed by IBM, Linux namespace partitions processesand system resources so that only processes in the same namegroup get access tonamegroup resources and processes. Cgroups: Originally contributed by Google, Cgroups is a Linux kernel concept thatgoverns the isolation and usage of system resources, such as CPU & memory, for agroup of processes.2/16/2021Shivananda Poojara29

Namespaces Namespaces are a feature of the Linux kernel that partitions kernel resources such thatone set of processes sees one set of resources while another set of processes sees adifferent set of resources.Examples: PID(Process Id), MNT(Mount file/folder), IPC,NET(Individual port and IP)Process Id namespace2/16/2021Filesystem namespaceShivananda ified/30

Broad view of Filesystem namespace2/16/2021Shivananda Poojarahttps://www.insecure.ws/linux/systemd nspawn.html31

2/16/2021Shivananda 55883696129/photo/132

Containers in nutshell Containers decouple applications from operating systems, whichmeans that users can have a clean and minimal Linux operatingsystem and run everything else in some form of containers. Motivation Monolithic applications to distributed micro services application Evolution of DevOps Cross platform deployments Faster exploration and deployments Licensing costs2/16/2021Shivananda Poojara33

Difference between VM and 01/VM-Diagram.pngShivananda Poojara34

ContainerVirtual MachineBare metal serverUnderlying platformOS or Virtual Machine orX86 Bare metal ServerHypervisor or Bare metalserver--Provisioning timesecondsminutesHoursTenant isolationenforcementOS KernelHypervisorPhysicalPerformance: Speed anda Poojara35

Container runtime platforms Docker CoreOS rkt Mesos LXC OpenVZ Containerd2/16/2021 Windows Server Containers.Linux VServer.Hyper-V Containers.Unikernels.Java containers.Shivananda Poojara36

Docker In 2013, Solomon Hykes started Docker as an internal project indotCloud. Docker released to open source(moby project) in March 2013. Docker enterprise edition introduced in 2016 as a first commercialproduct. Docker community edition is free and community supported with3400 contributors.2/16/2021Shivananda Poojara37

Docker architecture2/16/2021Shivananda w/38

Docker basics Docker Image The basis of a Docker container Images are read only templates build from Dockerfile. Docker uses Union File System. Duplication-free Layer segregation Docker Engine The software that executes commands for containers. Networking andvolumes are part of Engine. Can be clustered together. Docker Registry Stores, distributes and manages Docker Images. Docker ContainerShivanandaPoojara unit for application service. The image when it is running, Thestandard2/16/202139

Docker ImageDocker storage/2/16/2021Shivananda Poojara40

Build, Ship and Runany application, anywhere Build Construct a docker image which includes code, a runtime, libraries,environment variables and config files using Dockerfile. Ex: docker build command with (Dockerfile) Ship Push the image in to destination location/infrastructure/dockerregistry(docker hub/ org. registry) Ex: docker push command Run Pull an image from registry and run in seconds without any dependencies. Ex: docker pull, run commands2/16/2021Shivananda Poojara41

Docker Compose A tool for defining and running a multi container Docker applications. Uses a single YAML file to configure all application services. With single command create and start all services with dependency.2/16/2021With ComposeWithout ComposeBuild and run one container at a timeDefine multi container app incompose.yamlManually connect the containers togetherSingle command to deploy entire appCareful with start up order and depenciesAutomated management of containerdependenciesShivananda Poojara42

Docker installation and orchestration Docker installation: Supported in Linux and Windows operating system. Earlier, natively supported in Linux and Linux VM based deployment in Windows Windows containers can be deployed in Windows OS and Linux containers are supportedwith WSL in Windows. Docker Orchestration Docker Swarm Kubernetes2/16/2021Shivananda Poojara43

Key benefits of docker Efficiency Less OS overhead Improved VM density in VM docker environment Portability Less dependencies between process layers ability to move betweeninfrastructure Repeatability Do not depend on the runtime, build once's, use many times Automation Build and run anywhere in moments Speed No OS to boot applications onlinein secondsShivananda Poojara2/16/202144

References Mastering Cloud Computing – Book by Christian Vecchiola, Rajkumar Buyya, and S. ThamaraiSelvi, 2013th edition. Docker Manual-pdf: http://wiki.zenoss.org/download/core/drich slides/DockerSlides.pdf Docker Cheat Sheet: -09/docker-cheatsheet.pdf 3e119b/ https://www.snia.org/sites/default/files/CSI/SNIA Intro to Containers Container Storage andDocker Final.pdf2/16/2021Shivananda Poojara45

Next LecturePlatform as a Service2/16/2021Shivananda Poojara46

History of Virtualization: Virtualization's roots go back to 1960's from IBM in x86 Architecture. Jim Rymarcktz -first main frame virtualization. IBM's CP-67 software to partitions and share. VmWare had become pioneer in the virtualization technologies. Virtualization transforms hardware into software.