Sei sulla pagina 1di 18

MANIPAL INSTITUTE OF TECHNOLOGY (A constituent Institute of MANIPAL UNIVERSITY)

MANIPAL - 576 104, KARNATAKA, INDIA

Industrial Training
on

Cloud Computing

Submitted By
Rumit Singh Tuteja 080905164 rumittuteja@gmail.com

Under the Guidance of :

Dr. Matthew N Dailey


Coordinator AIT, Bangkok,Thailand

Table of Contents :
Page 1 of 18

S.no i ii iii iv 1

Title Abstract Certificate Details of Organization Project Details Learning Part 1.1 Virtulization 1.2 Basics of Cloud Computing 1.3 Use of xm and dstat commands Application 2.1 Module1: Virtual machine resource profiling tool (RMAgent) 2.2 Module2: Resource management tool (PMAgent) Dynamic scaling of resources

Page No 3 4 5 6 - 26 6-9 6-7 8-9

10-16 10-11 11-13

17 18-19 19

4 5. Conclusion

Page 2 of 18

Abstract
Introduction:
CloudComputingisoneoftheemergingareasintheITsector.Virtualization formsthebaseforthedeploymentofcloudservices. Virtualization,thoughanoldconcept,hasreemerged.Thisisbecauseofthe option of controlled and optimum usage of the underlying resources that it givestothecloudproviders.Bytransferingtheirserverstothecloud,ITfirms gaintheoptionofusingoneserverwithhighcapabilitiesratherthanhavingto manageathousandservers.Cloudisdeployedononesingleserveroracluster of servers, where, in each server the resource allocation is controlled by virtualizationoftheunderlyingresources,creatingapoolofvirtualmachines. Resourcesallocatedtoeachofthevirtualmachinescanbecontrolledbyth

TechnologiesUsed:
1>XENhypervisor 2>EclipseforJAVA 3>httperfforsyntheticladgeneration 3>GNUPlot 4>nginxproxy

DistributionoftheWork:
Learningaboutvirtualizationandbasicsofcloudcomputing1week ssh to remote computers, Learning xm command, Learning about httperf 1weeks Learningaboutdynamiccontrolofresourcesandpresentation1week developingRMAgentandexperiments1week developingPMAgentandexperiments1week IntegrationofRmagentandPMAgenttobuilddynamicresourcemanager+ experiments1week

Page 3 of 18

Certificate

Page 4 of 18

DetailsofOrganisation

TheAsianInstituteofTechnology(AIT) isaninternationalinstitutionforhigher educationinengineering,advanced technologies,andmanagementand planning.It"promotestechnological changeandsustainabledevelopment "intheAsiaPacificregion,through highereducation,researchandoutreach.

AIT operates as a selfcontained international community at its campus in Pathumthani province, some 40 kilometres (25 miles) north of Bangkok, Thailand. Besides laboratories and academic buildings, the main campus includes housing, sports, and medical facilities, a conference center, and a librarywithover230,000volumesand830printandonlineperiodicals. AsianInstituteofTechnologyoffersMaster'sandDoctoraldegreesandfrom diploma and certificate courses. It has recently started offering Bachelor's degrees in Engineering. AIT is involved in the Erasmus Mundus academic cooperation programme offered by the European Union as a partner of EMMAsia.

Page 5 of 18

ProjectDetails
1.LearningPart:
Thetrainingwasprimarilybasedocloudcomputing.Virtualizationformsthe baseofcloudcomputing.Oncethecloudissetatthedatacentre,theeconomic aspcets of cloud management, such as hardware cost, heat dissipation, meathodstoupkeeptheSLAaretakenintoconsideration.

1.1Virtualization
Overviewofx86Virtualization.Thetermvirtualizationbroadlydescribesthe separationofaservicerequestfromtheunderlying physical delivery ofthat service. With x86 computer virtualization, a virtualization layer is added between the hardware and operating system as seen in Figure 2. This virtualization layer allows multiple operating system instances to run concurrently within virtual machines on a single computer, dynamically partitioningandsharingtheavailablephysicalresourcessuchasCPU,storage, memoryandI/Odevices.

Page 6 of 18

TheChallengesofx86HardwareVirtualization
X86 operating systems are designed to rundirectlyonthebaremetalhardware, sotheynaturallyassumetheyfullyown the computer hardware. As shown in Figure4,thex86architectureoffersfour levelsofprivilegeknownasRing0,1,2 and 3 to operating systems and applications to manage access to the computer hardware. While user level applicationstypicallyruninRing3,the operating system needs to have direct accesstothememoryandhardwareand must execute its privileged instructions in Ring 0. Virtualizing the x86 architecturerequiresplacingavirtualizationlayerundertheoperatingsystem (whichexpectstobeinthemostprivilegedRing0)tocreateandmanagethe virtual machines that deliver shared resources. Further complicating the situation, some sensitive instructions cant effectively be virtualized as they havedifferentsemanticswhentheyarenotexecutedinRing0.Thedifficultyin trappingandtranslatingthesesensitiveandprivilegedinstructionrequestsat runtimewasthechallengethatoriginallymadex86architecturevirtualization lookimpossible. Threealternativetechniquesnowexistforhandlingsensitiveandprivileged instructionstovirtualizetheCPUonthex86architecture: Fullvirtualizationusingbinarytranslation OSassistedvirtualizationorparavirtualization Hardwareassistedvirtualization(firstgeneration)

Page 7 of 18

1.2BasicsofCloudComputing
Cloud Computing, the longheld dream of computing as a utility, has the potentialtotransformalargepartoftheITindustry. CloudComputingreferstoboththeapplicationsdeliveredasservicesoverthe Internet and the hardware and systems software in the datacenters that providethoseservices.Theservicesthemselveshavelongbeenreferredtoas SoftwareasaService(SaaS).Thedatacenterhardwareandsoftwareiswhatwe willcallaCloud.WhenaCloudismadeavailableinapayasyougomannerto thegeneralpublic,wecallitaPublicCloud;theservicebeingsoldisUtility Computing.WeusethetermPrivateCloudtorefertointernaldatacentersofa businessorotherorganization,notmadeavailabletothegeneralpublic.Thus, Cloud Computing is the sum of SaaS and Utility Computing, but does not includePrivateClouds.PeoplecanbeusersorprovidersofSaaS,orusersor providersofUtilityComputing.WefocusonSaaSProviders(CloudUsers)and
Page 8 of 18

CloudProviders,whichhavereceivedlessattentionthanSaaSUsers. Fromahardwarepointofview,threeaspectsarenewinCloudComputing. 1.Theillusionofinfinitecomputingresourcesavailableondemand,thereby eliminatingtheneedforCloudCom putinguserstoplanfaraheadforprovisioning. 2. The elimination of an upfront commitment by Cloud users, thereby allowingcompaniestostartsmalland increasehardwareresourcesonlywhenthereisanincreaseintheirneeds. 3.Theabilitytopayforuseofcomputingresourcesonashorttermbasisas needed(e.g.,processorsbythehour andstoragebytheday)andreleasethemasneeded,therebyrewarding conservationbylettingmachinesand storagegowhentheyarenolongeruseful. DEFINITION ACloudisatypeofparallelanddistributedsystemconsistingofacollectionof interconnected and virtualized computers that are dynamically provisioned andpresentedasoneormoreunifiedcomputingresource(s)basedonservice levelagreementsestablishedthroughnegotiationbetweentheserviceprovider

Page 9 of 18

1.3Useofxmanddstatcommands xmlist:Liststhenonumberofdomainscurrentlyrunning.
xmcreate:Createsadomainfromitsconfiurationfile. xmconsole:Letsyougettotheconsoleoftherunningdomainmentionedas aparameterwhilepassingthecommand. xmdestroy:destroysorkillsarunningdomain. Aboutdstat: dstatisversatile tool for generating system resource statistics. Dstatallowsyoutoview allofyoursystemresourcesinstantly,youcaneg.comparediskusagein combinationwithinterruptsfromyourIDEcontroller,orcomparethenetwork bandwidthnumbersdirectlywiththediskthroughput(inthesameinterval).

Page 10 of 18

Thefigureshowstheprofilingofcpu,memory,diskandloadlevelsdoneby dstat.

2.Application
Experimentconditions
XENvirtualmachines,hostingatwotierweapplication httperfisanapplicationforsyntheticloadgeneration,thorughwhichadesired loadlevelcanbegenerated.Theapplicationgenerateshtt[requestsforthe applicationhostedonvirtualmachinesandthusconsumestheresourcesofthe virtualmachines. Thetwotierscompriseof: >rubiswebserver. >mysqldatabaseserver. Eachhostedononevirtualmachinewithaspecificinitialamountofresources. (cpuandmemory)

Module1
Tocreateatoolforprofilingoftheresourcesofthevirtualmachines,hostinga twotierweapplication(specifiedbelow),whiletheyaretestedwithsynthetic loadgeneratedbyhttperf. RMAgentisxmlrpcclientserverapplicationtocapturethebehaviourof virtualmachinesinresponsetothegeneratedtrafficfromthedatagenerated bydstat.

Page 11 of 18

CodesnippetoftheserversideoftheRMAgent,listeningonthespecified port.

CodesnippetoftheclientsideofRMAgentwhereatestprogramis
Page 12 of 18

requestingfordetailsoftheresources.
Module2 Tointeractwiththehypervisorfordynamiccontrolofresources.Theguiding factorhereisthereosurceprofilingdonebytheRMAgentforasetinterval. PMAgentinteractswiththehypervisortosettheinitialamountofresourcesfor thevirtualmachinesandprovidethewith allocationslice(s) oftheresource thatiscreatingabottleneckandthusapotentialSLAviolation. ServersideofPMAgent Xmlrpcserverbasedtoresideontheserverhostingthecloudandinteracting withxentocontrolthephysicalresourcesallocatedtotheVMs.Theapplication iscapableofacceptingarequestfromaclientandactaccordingly. ClientsideofPMAgent Xmlrpcclientresidingontheproxythatfromwhereitrequeststheserverside forallocationofresourcesbasedonthedatarecordedfromtheprofilingtool. InteractionwiththehypervisorthroughJavaLibvirt libvirt is an open source API, daemon and management tool for managing platformvirtualization.ItcanbeusedtomanageLinuxKVM,Xen,VMware ESXandothervirtualizationtechnologies.Graphicalinterfacesuseit,suchas VirtualMachineManager,asdocommandlineinterfaces(virsh),andhigher leveltoolslikeoVirt.
libvirt itself is a C library, but it has bindings in other languages, notably in Python, Perl, OCaml, Ruby, Java, and PHP. Development of libvirt is backed by Red Hat,, with significant contributions by other organisations and individuals. Libvirt is available on most Linux distributions; remote servers are also accessible from Apple Mac OS X, and Microsoft Windows clients.

Page 13 of 18

The PMAgent also uses a shell script to allocate CPU slices to the virtual machines.Hereisasnippettoit.

When the server side of the application is started, the domains are automaticallyinitializedwiththencessaryresources. Afterbeinginitialized,theperformanceoftheapplicationbeinghostedonthe Vmsandtheresource profileofthe VMs ismonitored,basedonwhichthe decisionfordynamicscalingofresourcesismade.

Page 14 of 18

4. Dynamic scaling of resources


RMAgentandPMAgentareintegratedwiththeVLBManager.

VLBManager,setintheproxy,calculatesthe95thpercentileoftheresponse time of the server (application hosted on the cloud ), in response to the synthetically generated traffic and the number of requests processed by the serverinasetintervaloftime. Thestepsinwhichtheapplicationfunctionsareasfollows: EXPERIMENT Apparatus: myhnode1hosting2XEN virtualmachineswithmaxmemory 800Mbseach,CPUcaps20each,theapplication used is rubis web server an a mysql database server. Cloudproxy, an nginx proxyserver,thetoolformonitoring, profilingandcontrollingtheresourcesresides,localhostforthegenerationof synthetictrafficinadesired pattern. 1.Establisharemoteconnectiontomyhnode1,theserverthathasXENvirtual machineconfigurationfiles.Theseare: >rubiswebserver. >mysqldatabaseserver.

2. Start the virtual machines and retrieve their IP addresses so that direct remoteconnectionstothemcanbeestablishedfromthelocalhost. 3.StarttheRMAgentserversonboththevirtualmachines,sothatprofilingof desiredresourcescanbedonewhenrequestedandfortherequestedinterval. Theseresourcesareaveragedovertherequestedintervaloftime.

Page 15 of 18

4.StartthePMAgentserveronthemyhnode1,sothatitinitializesthedomains withsetparametersie.baselinememoryallocationandbaselineCPUcap allocationandacceptsrequestsfromtheclientforthedynamicscalingofthese resourcesbasedonVMresourceprofilingandtheobservedresponsetime. 5.SetthehostedapplicationupbyupdatingtheIPaddressofthedatabase serverinthedatabaseserverlistoftherubisservertomakethe2tierweb applicationreadytoprocessrequests. 6.Startthedstatcmldnoupdate3anddirectitintoafilesothatthegenerated statscanbetrackedbytheRMAgentwhenrequestedfor. 7.Establisharemoteconnectiontothecloudproxyhost.Thishostcontainsthe nginxproxy.Thesynthetictrafficgeneratedisvia.thisproxyserver. Updatetheaddress,towhichthesynthetictrafficreceivedbythenginxproxyis toberouted,withtheaddressofthewebserverhostingvirtualmachine. Startthenginxproxy. 8.StarttheVLBManageronthecloudproxy.Itcalculatesthe95thpercentileof theresponsetimeinthepreviousinterval,thetotalno. ofrequestsprocessedbytheapplicationinthelastinterval, requestsforand receivestheresourceprofilefromtheRMAgentfor the set interval of time and also takes the decision about the allocation of resourceslicesfortheVM(s)andtheparticularresource(s)onthemin thenextinterval,thatcreatedbottleneckinthepreviousintervalandcould leadtoapotentialSLAvoilation.AllocationslicesaresetforbothCPUcap and memory. The interval, that can be bound according to the desired experimantalconditions,hereissetto36seconds. 9.Usehttperfwebapplicationforgeneratingsynthetictraffic.UpdatetheIP addresstowhichthetrafficistoberoutedwiththatofcloudproxy. 10.Setthedesiredloadlevelsandthedurationforwhichtheloadsaretobe generated.Hereweusealoadlevelofvaryingform41usersessions persecondto60usersessionspersecond,eachgivenadurationof36seconds (whichisinsynch.withtheintervalsetintheVLBManagerto retrievetheperformanceofthevirtualmacchines).Startloadgenerationafter alltheotherapplicationsareupandrunning.

Page 16 of 18

Asnapofthephysicalserverconsolebeforetheexperimentistobestarted. terminaloneshowsthecommandthatwouldstartrecordingthedstatcmld oftheresourcesofthewebserverintoafile.

terminaltwoshowsthecommandthatwouldstartrecordingthedstatcmld oftheresourcesofthedatabaseserverintoafile.

terminalthree and terminalfour showthecommandsthatwouldstartthe execution of RMAgent jar files. The server side of the RMAgent will start listeningonthespecifiedport. terminalfive showsthecommandthatwouldtriggertheserversideofthe
Page 17 of 18

PMAgentandbereadyforanyrequestfromtheVLBManager.

Conclusion
Dynamic control of resources as a mechanism of cloud management comes under the category of vertical scaling of resources. The method is efficient becauseofthefactthatwerequireaminimumofoneserverforitsdeployment. Theresourcesallocatedtothevirtualmachinescanbeadjusteddynamically andeasilybetweenvarioustiers,thusmeetingtheSLAeffectively. Anothermethodsthatcanbeemployedishorizontalscalinginwhichavirtual machinehosting atierisfallingshort ofresources,another virtual machine hostingexactlythesametiercouldbeaddedtothesystemsothatthenoof requestsbeingprocessedcanbedividedbetweenthetwoVms. Yetanothermethodthatcanbeemployediscalledvirtualmachinemigration, inwhichtheVMhostingthetierismigratedtoanotherphysicalserver.This method is employed in the case when not enough amount of resources are presentonthephysicalmachineonwhichtheVMisrunning.Transferringthe VMtoanotherphysicalserverrelievesthefirstserveroftheexcessivepressure duetoshortageofresourcesthusbalancingtheloadandremovingapotential violationofSLAfromthepicture. Thelimitingfactorwithdynamiccontrolofresourceshowevershowsupwhen theloadonthe physicalserverincreasesexcessively.Insuchasituation,for sharingtheload,itsmoreconvenienttohavetwoserversratherthanonethat cansimultaneouslyprocesstherequests(horizantalscaling)orhavingsomeof theVMmigratedtotheotherservertorelievethefirstphysicalserver. Thereisascopeofimprovementintheapplicationdiscussedearlier.Theuseof predictivealgorithmsthatanpredeterminetheloadlevelinthecominginterval tentetivelybymonitoringtheperformanceofthecurrentintervalforallocation ofresourceswoulddefinitelyprovideamuchbettermodelforthemanagement ofcloud.

Page 18 of 18

Potrebbero piacerti anche