{"id":308271,"date":"2021-07-26T14:00:00","date_gmt":"2021-07-26T11:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-upgrade-or-resize-a-running-ec2-instance-cloudsavvy-it\/"},"modified":"2021-07-26T14:00:00","modified_gmt":"2021-07-26T11:00:00","slug":"how-to-upgrade-or-resize-a-running-ec2-instance-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-upgrade-or-resize-a-running-ec2-instance-cloudsavvy-it\/","title":{"rendered":"#How to Upgrade or Resize a Running EC2 Instance \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2e20907ab9e\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2e20907ab9e\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-upgrade-or-resize-a-running-ec2-instance-cloudsavvy-it\/#Consider_Using_Auto_Scaling_or_a_Load_Balancer\" >Consider Using Auto Scaling, or a Load Balancer<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-upgrade-or-resize-a-running-ec2-instance-cloudsavvy-it\/#Upgrading_an_EC2_Instance_with_Minimal_Downtime\" >Upgrading an EC2 Instance (with Minimal Downtime)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-upgrade-or-resize-a-running-ec2-instance-cloudsavvy-it\/#Upgrading_an_EC2_Instance_with_Zero_Downtime\" >Upgrading an EC2 Instance with Zero Downtime<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Upgrade or Resize a Running EC2 Instance \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-5269\" srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"AWS Logo\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You are free to upgrade or downgrade your on-demand EC2 instances as you please. If your instance is struggling to handle your workload, upgrading to a higher tier or another instance class can help your <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>lications run smoother.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Consider_Using_Auto_Scaling_or_a_Load_Balancer\"><\/span>Consider Using Auto Scaling, or a Load Balancer<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before upgrading, it\u2019s worth considering whether you really need to. For example, if you\u2019re running a web application, it\u2019s pretty typical for traffic to climb throughout the day and dip down at night when there\u2019s little to no usage. If your instance is only being stressed during peak usage, you\u2019ll essentially be paying double what you need to during the 20 other hours that it was previously handling just fine.<\/p>\n<p>The solution to this is Auto-Scaling, one of the many benefits of AWS\u2019s elastic nature. When CPU or memory usage gets too high on your primary instance, AWS will automatically start a new instance to help handle the additional traffic. Auto-Scaling is heavily encouraged by AWS, as it saves both you and AWS a lot of money. You can read our guide to setting it up to learn more.<\/p>\n<p>This is made possible using a Load Balancer, a network device that evenly distributes traffic across all servers in the auto-scaling group. You don\u2019t have to use auto-scaling to make use of a load balancer though, as they\u2019re commonly used to enable greater redundancy.<\/p>\n<p>If you have reserved instances, you won\u2019t be able to switch tiers, and running two or more instances is your only option. If you have convertible reserved instances however, you are able to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/ri-convertible-exchange.html?tag=reviewgeek-20\">exchange them<\/a>\u00a0for different instances.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Upgrading_an_EC2_Instance_with_Minimal_Downtime\"><\/span>Upgrading an EC2 Instance (with Minimal Downtime)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can easily switch an instance\u2019s type from the EC2 console. However, you can\u2019t change an instance\u2019s tier while it is running\u2014you\u2019ll need to turn it off.<\/p>\n<p>If turning the instance off isn\u2019t a problem, the first and simplest method is just to accept that you\u2019ll have a few minutes of downtime while the instance restarts, and perform the upgrade at night when traffic is low. If you have multiple instances behind a load balancer, you can upgrade each one one at a time, allowing your application to stay online.<\/p>\n<p>To switch instance types, stop the instance from the EC2 Management Console by right-clicking on it in the list and selecting Instance State &gt; Stop:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-4189 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/03\/dea34131.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Stop instance from EC2 Management Console \" width=\"636\" height=\"261\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Once it\u2019s fully stopped, you can then select Instance Settings &gt; Change Instance Type:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-4190 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/03\/bce22cb9.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Select Instance Settings &gt; Change Instance Type\" width=\"678\" height=\"302\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>This will bring up a dialog where you\u2019ll choose the new instance type.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-4191 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/03\/616afc49.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Choose new instance type\" width=\"528\" height=\"267\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>After this, select Instance State &gt; Start to turn the instance back on.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Upgrading_an_EC2_Instance_with_Zero_Downtime\"><\/span>Upgrading an EC2 Instance with Zero Downtime<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The best way to achieve a zero-downtime upgrade is with a blue\/green deployment. This involves creating a new instance of the desired tier, readying it for production, swapping traffic over to it, then terminating the old instance.<\/p>\n<p>If you don\u2019t have a build script or custom AMI set up though, creating a new instance can take a bit of time. One method to do this quickly is to create an image of your running instance, and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/instance-launch-snapshot.html?tag=reviewgeek-20\">launch a new instance using that image.<\/a>\u00a0You can create images of running instances by right-clicking them and selecting Image &gt; Create Image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-4193 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/03\/970a2f4c.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Create images of running instances\" width=\"700\" height=\"243\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Then, under AMIs in the sidebar, you can launch a new instance using that image.<\/p>\n<p>Once the instance is up and running, the easiest way to swap traffic over is to change the association on your elastic IP address. Click on \u201cElastic IP\u201d in the sidebar, and select \u201cAssociate Elastic IP Address\u201d from the action menu.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-4192 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/03\/4a912322.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Change association on elastic IP address\" width=\"590\" height=\"207\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Select the new instance from the list, and click \u201cAssociate:\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-4194 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/03\/4c30aada.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Select the new instance\" width=\"700\" height=\"407\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>This will swap the EIP over with zero downtime. Once it\u2019s swapped, and the old instance isn\u2019t receiving any traffic, you can terminate the old instance.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/4188\/how-to-upgrade-or-resize-a-running-ec2-instance\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Upgrade or Resize a Running EC2 Instance \u2013 CloudSavvy IT&#8221; You are free to upgrade or downgrade your on-demand EC2 instances as you please. If your instance is struggling to handle your workload, upgrading to a higher tier or another instance class can help your applications run smoother. Consider Using Auto Scaling, or&#8230;<\/p>\n","protected":false},"author":1,"featured_media":308272,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2020\/06\/e601b806.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-308271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/308271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=308271"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/308271\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/308272"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=308271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=308271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=308271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}