How to Change or Upgrade an EC2 Instance Type | Logicata

文章推薦指數: 80 %
投票人數:10人

EC2, or Elastic Compute Cloud, is AWS IaaS for running virtual machines in the AWS cloud. In this post we take a deep dive on how to change instance type. SkiptomaincontentSkiptoprimarysidebar HowtoChangeorUpgradeanEC2InstanceType EC2,orElasticComputeCloud,isAmazonWebServicesIaaS(InfrastructureasaService)offering–essentiallyitisaserviceforrunningvirtualmachinesintheAWScloud. IwroteanearlierpostaboutEC2andallthedifferentinstancetypestitledAWSEC2–EverythingYouNeedToKnowAboutEC2Instances whichtouchedonsomeofthepre-requisitesforchangingEC2instancetypes–I’llcoverthatagainhereandthentakeadeeperdiveonhowtoactuallygoaboutchanginginstancetype. WhyChangeec2instancetype? ThereareanumberofreasonsthatyoumaywishtochangeanEC2instancerunninginAWS. Herearesomeofthemostcommon: Increaseresources–perhapsyouneedmoreCPU,RAMornetworkthroughputduetoincreasedapplicationdemand,whichhopefullyisagoodthing! Decreaseresources–perhapsyouwanttorightsizeforcostoptimizationpurposesbyremovinganyunderutilizedresources. Changeofworkloadtype–iftheworkloadontheEC2instancehaschangedfrom,say,CPUinstensivetoRAMintensive,itmaybemoreefficienttochangetoadifferentinstancefamilymoresuitedtothenewworkload.  Migratefrompreviousgenerationtocurrentgenerationinstancetype–AWSfrequentlyupdatetheirinstancefamilies,andoftennewergenerationinstancesofferhigherperformanceatalowercost. ChangingEC2Instance–Pre-requisites Ifyoudecidethatyouneedtochangeinstancetypeforperformanceorcostmanagementreasons,youcansimplyresizeittoanotherinstancetypeaslongas: Virtualizationtypeisthesame –PV(paravirtual)orHVM(Hardwarevirtualmachine)–EC2usesbothvirtualizationtypesanditisnotpossibletochangeaninstancefromonetypetotheother. CPUArchitectureisthesame –thereislimitedsupportfor32bitAMIs,Armprocessorsetc–youcannotswitchfromanIntelCPUinstancetoanAMDCPUinstance,forexample. Networkiscompatible –newerinstancesneedtobeinaVPC,soEC2classicinstancescan’tberesizedtoanewerinstancetypeifnotinaVPC. RootStorageisanEBSvolume– ifyourrootvolumeisinstancestorebased(onephemeralstorage),you’llneedtomigrateyourapplicationtothenewinstancetype. EnhancedNetworkingDriversareinstalled–ifthenewinstancetypesupportsadvancednetworkingfeatures,you’llneedtoinstallthedriversbeforere-sizing. NVMeDriversareinstalled–forinstancesthatsupportNVMe(Non-VolatileMemoryExpress)SSDinstancestorevolumes. UpgradeorResizeEBSBackedEC2instance IftheEC2instanceyouwanttochangehasanEBS(ElasticBlockStore)rootpartition,youcansimplychangeor‘resize’theinstance. Theinstancetypethatyouwanttoresizetomustbecompatiblewiththecurrentinstancetype,otherwiseyouwillneedtocreateanewinstanceandmigrateyourappsanddatatothenewinstance(seenextsectionfordetailsonhowtodothis). InordertoresizeanEBSbackedinstanceyoumustfirststoptheinstance. WhenstoppingorstartinganEC2instanceyouneedtobeawarethat: Theinstancewillbemovedtonewhardware,buttheinstanceIDwillnotchange.  TheinstancewillretainanyassociatedElasticIPAddresses,privateIPv4andanyIPv6addresses,butifithasapublicIPv4addressthiswillchange. IftheinstanceispartofanAutoScalinggroup,youmaywishtodisablethescalingprocesseswhileresizingtheinstance,topreventitfrombeingterminatedduetobeingmarkedas‘unhealthy’. Youshouldplanfordowntimewhentheinstanceisstopped–youmayneedtoscheduleamaintenancewindowastheprocesscantakeseveralminutes,plusyoushouldplanforanyunforeseenproblems.  FollowthesestepstoresizeyourEC2instanceintheAWSConsole:  Installanydriversrequiredbythenewinstancetypeontothecurrentinstance(NVMedrivers,enhancednetworkingdrivers)  OpentheEC2consoleandchooseinstancesfromthenavigationpane:  Selecttheinstanceandthenselect‘Actions,State,Stop’:   Choose‘YesStop’inthedialoguebox:  Ensuringthattheinstanceisstillselected,choose‘Actions,Instance,Settings,Change InstanceType’: Inthedialogueboxthatappears,thereisadropdownmenuthatwillonlydisplaycompatibleinstancetypes–iftheinstancetypeyouwantisnotdisplayed,youcannotresizetothisinstancetype. IftheinstancetypeyouareswitchingtosupportsEBS-optimization,youcanselectitinthecheckboxtoenable:  Restartthestoppedinstancebyselecting‘Actions,InstanceState,Start’,thenchoose‘YesStart’inthedialogueboxthatappears. Theinstancecantakeafewminutestoreachthe‘running’state. ChangeInstanceStorebackedEC2InstanceType TheprocessisalittlemorecomplicatedifyouwanttochangetheinstancetypeofanInstanceStorebackedEC2instancetype. Itisnotpossibletosimplychangetheinstancetype–youmustmigratetoanewinstancetypebycreatinganimageoftheexistinginstanceandlaunchinganewinstanceofthedesiredtypefromtheimage. Tomigrateaninstancestorebackedinstance,followthesesteps:  Createabackupofanydataontheinstancestorevolumestopersistentstorage. ForanyattachedEBSvolumes,youcaneithertakeasnapshotordetachthevolumesfromtheinstancetobereattachedtothenewinstanceoncecreated. CreateanAMIoftheinstancestorebackedinstance. FollowtheinstructionsheretocreateanInstanceStorebackedLinuxAMI  IntheEC2console,findtheAMIyoujustcreated:  SelecttheAMIthatyouwishtouseandchoose‘Launch’:  Specifytheinstancetypeyouwantinthelaunchwizard–ifyoucan’tseetheinstancetypeyouwantthenitisnotcompatiblewithyourAMI: Terminatetheoriginalinstanceifitisnolongerrequired. WhichEC2InstanceTypeDoIneed? IfyouknowyouneedtochangeyourEC2instancetype,butyouareunsurewhichinstancetypetoselectfromthedazzlingarrayofalmost300instancetypes,fearnot,youareinluck. AWSComputeOptimizerisonhandtoproviderecommendationstohelpwithimprovingperformance,savingmoney,orboth ComputeOptimizeranalysesexistingEC2instancespecificationsandutilizationmetrics. Bycomparingthedata,itwillrecommendwhichEC2instancetypesarebestsuitedtoyourworkloads. ComputeOptimizerrecommendationsfallintothefollowingcategories: Under-provisioned–youmayneedmoreCPU,RAMornetworkthroughputsoneedtoupgrade. Over-provisioned–youhavetoomuchCPU,RAMornetworkthroughput,soyoucansafelydowngrade. Optimized–everythingisjustright None–therearenorecommendationsfortheinstance,perhapsbecausethereisnotenoughdata,ortheinstancetypeisnotyetsupportedbyComputeOpitmizer.  AlthoughComputeOptimizerisfreetouse,youmustfirstoptintostartthecollectionofdataonwhichtherecommendationswillbebased. Itmaytakeupto12hoursbeforeanydataorrecommendationsareavailable. OnceComputeOptimizerhasmaderecommendations,youcanfindthemintheEC2consolebyselectingandinstance,theninthe‘Details’tab,under‘Finding’: Therecommendationwilldisplaythesuggestedinstancetypealongwiththehourlyon-demandpricefortherecommendedinstance. Sothereyouhaveit. AWShasthetoolstohelpyouselecttheappropriateinstancetypefromahugelistofoptions. Ifthisallstillsoundsalittleoverwhelming,Logicataareheretohelp. CheckoutourAWSManagedServices –we’reroutinelyoptimizingEC2instancesforourclientswhileminimizingdowntime,soperhapswecanassistyoutoo! YouMightBeAlsoInterestedInThese... AWSPriceReductionsJanuary2020 CloudEndureDisasterRecovery.AWShasrecentlyannouncedwhatamountstoan80%pricedropoftheirCloudEnduredisasterrecoverysoftware,usedforreplicatingonpremiseworkloadstothecloudforDRpurposes.Priortotheprice,drop,thelistpriceforCloudEndurewas$45-$99perserverpermonth,dependingonnumber[…] ViewPost CloudComputingistooExpensive(SaysMarkZuckerberg) Atarecentconferenceaboutbio-sequencing,MarkZuckerberg,founderofFacebook,calledoutthatcloudcomputingcostsaregettingwaytooexpensive,andthatthisisholdingupadvancementsinmedicalresearch.HespecificallycalledoutAWS(AmazonWebServices)andjokinglysuggestedhemaycallAmazonfounderJeffBezostodiscuss.Perhapshehas[…] ViewPost UKTechAwards2019 LastnightIonceagainhadthepleasureofbeinginvitedtotheannualUKTechAwardsceremonyattheParkPlazaWestminsterHotelinLondon. TheeventisagatheringofthebrightestcompaniesintheUKtechnologyindustry,togetherwiththeirinvestorsandadvisors. TheeventissponsoredbyPWCandSiliconValley[…] ViewPost 5StepstoaSuccessful AWSMigration DOWNLOADFREEEBOOK LogicataAWSWeeklyNewsRoundup–TheSaneWayToKeepUpToDateWithAWSNews. There’sacascadeofAWScontentproduceddaily.Ourfounderhandpicksthemostinteresting,thebesttipsandmostrelevanttechnicaldetails,stripsthenonsenseanddeliversittoyouonceaweek. Firstname*Email* x FreeCloudCheckup TheCloudCheckUpisadetailedassessmentofyourcloudinfrastructure,designedtopinpointoptimizationopportunities,securityvulnerabilitiesanddocumentsharedobjectives.Useyourclouddatatorevealopportunitiestocorrectover-spending,identifysecurityandcompliancevulnerabilities,andplanforfutureresourceneedsandexpenditures. Firstname*Email* Tellusaboutyourrequirements* x BOOKAFREEDISCOVERYCALL Firstname*Email* Tellusaboutyourrequirements* x 5StepstoaSuccessful AWSMigration FirstName*Email* Wewillonlysendyouawesomestuff PrivacyPolicy x



請為這篇文章評分?