<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bibhu Sunder</title>
    <description>The latest articles on Forem by Bibhu Sunder (@bibhu_sunder).</description>
    <link>https://forem.com/bibhu_sunder</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F800074%2F5d2f2055-d08d-413c-8268-519a35dc93fe.jpg</url>
      <title>Forem: Bibhu Sunder</title>
      <link>https://forem.com/bibhu_sunder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bibhu_sunder"/>
    <language>en</language>
    <item>
      <title>DOCKER SWARM</title>
      <dc:creator>Bibhu Sunder</dc:creator>
      <pubDate>Fri, 08 Jul 2022 09:14:26 +0000</pubDate>
      <link>https://forem.com/bibhu_sunder/docker-swarm-3a2b</link>
      <guid>https://forem.com/bibhu_sunder/docker-swarm-3a2b</guid>
      <description>&lt;p&gt;&lt;strong&gt;WHAT IS DOCKER?&lt;/strong&gt;&lt;br&gt;
Docker is a tool which is used to automate the deployment of applications in lightweight containers so that applications can work efficiently in different environments.&lt;br&gt;
&lt;strong&gt;Point to be noted-&lt;/strong&gt; Container is a software package that consists of all the dependencies required to run an application.&lt;/p&gt;

&lt;p&gt;Advantages of docker-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Multiple containers run on the same hardware&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maintains isolated applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High productivity&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Quick and easy configuration&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;WHAT IS DOCKER SWARM?&lt;/strong&gt;&lt;br&gt;
Docker swarm is a service which allows user to create and manage a cluster of Docker nodes and schedule containers.&lt;/p&gt;

&lt;p&gt;Each node of a Docker Swarm is a Docker daemon and all Docker daemons interact using the Docker API.&lt;/p&gt;

&lt;p&gt;Here, services can be deployed and accessed by nodes of same cluster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now lets see how we can set-up Docker Swarm using AWS EC2 instances.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First of all create at least 4 EC2 instances. One of them will be used as master node and other three will be used as worker node.&lt;br&gt;
Allow ssh, http and https in the inbound rules of the security group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhr0dbb43i8iu8jc5x4u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhr0dbb43i8iu8jc5x4u.png" alt="EC2 instances"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we need to install docker in all the 4 instances using the command "yum install docker* -y"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjo20t751il1mdk7ribt0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjo20t751il1mdk7ribt0.png" alt="docker installation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once installation is completed we need to start docker by the following commands&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;systemctl start docker&lt;/li&gt;
&lt;li&gt;systemctl enable docker&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we need to configure the master node as the master node. the command for that is &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;docker swarm init&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9y5u80b0pci7azte3kr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9y5u80b0pci7azte3kr.png" alt="docker swarm init"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To convert all the other nodes into worker node we need to copy the highlighted area given in the above picture and past that command in all other nodes which we want to make as worker node.&lt;/p&gt;

&lt;p&gt;To check all the available docker nodes we can write&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;docker node ls&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftn48ibu56sjox7vqy597.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftn48ibu56sjox7vqy597.png" alt="docker nodes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we need to create a docker file where we will write the script to launch an image and provide the web page which we want to launch.&lt;br&gt;
To create the docker file we need to write "vi Dockerfile"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4etu03xzjtuy9wcjy22d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4etu03xzjtuy9wcjy22d.png" alt="docker files"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need to built an image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fayqa365vn85bine9m9pv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fayqa365vn85bine9m9pv.png" alt="docker image"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;We need to perform the above two steps in all the worker nodes too.&lt;/p&gt;

&lt;p&gt;Then we need to create service.&lt;br&gt;
-docker service create --name app-server -p 80:80 appimage:1&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5akw109j2n81srpduze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5akw109j2n81srpduze.png" alt="services"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will create a container in any one node but if we hit the public IP address of any of the instance we can see the web page is running regardless in which instance the container is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpjve1x51tb7pyed5cdj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpjve1x51tb7pyed5cdj.png" alt="public ip"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgntxo7gus341e5aloirt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgntxo7gus341e5aloirt.png" alt="web page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is very easy to increase or decrease the numbers of services in docker, we can simply do it by the command given below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nuwe1xst3fo4wzboqrj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nuwe1xst3fo4wzboqrj.png" alt="increase service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also view our containers using a docker visualizer, which is a graphical representation of all the containers and instances.&lt;br&gt;
To set-up visualizer we need to run the given command.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;docker service create --name=viz --publish=8080:8080/tcp --constraint=node.role==manager --mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock dockersamples/visualizer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzg6glky8qdydz21w4z1c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzg6glky8qdydz21w4z1c.png" alt="docker visualizer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you hit the public ip of the master node mapped with port 8080 you can see the Docker visualizer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2mhm6c0cd0wmfs0pi0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2mhm6c0cd0wmfs0pi0t.png" alt="docker visualizer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was the whole process of how to set-up docker swarm.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>aws</category>
      <category>devops</category>
      <category>cloudskills</category>
    </item>
    <item>
      <title>APPLICATION MIGRATION IN AWS</title>
      <dc:creator>Bibhu Sunder</dc:creator>
      <pubDate>Sun, 03 Apr 2022 11:37:51 +0000</pubDate>
      <link>https://forem.com/bibhu_sunder/application-migration-in-aws-31li</link>
      <guid>https://forem.com/bibhu_sunder/application-migration-in-aws-31li</guid>
      <description>&lt;p&gt;Application migration is the process of moving software applications from one computing environment to another. This can include migrating applications from one data center to another, such as from a public to a private cloud, or from a company's on-premises server to a cloud provider's environment.&lt;/p&gt;

&lt;p&gt;Here we will see how we can migrate our server form one AWS account in one region to another AWS account in some other region or in same region.&lt;/p&gt;

&lt;p&gt;This is the server(source server) of Singapore region which we are going to migrate to Mumbai region of another AWS account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gbm1guwN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqkewczlbgwwz6wt1sto.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gbm1guwN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqkewczlbgwwz6wt1sto.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the sample web site(downloaded from  free-css.com) which is hosted form the source server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LfWU0MOa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbfd4c1y34zmxth65s91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LfWU0MOa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbfd4c1y34zmxth65s91.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now in your destination AWS account and go to "AWS Application Migration Service" and click on "Get started". &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QejxTKl1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gubvjdon9ahzywqcwxbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QejxTKl1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gubvjdon9ahzywqcwxbp.png" alt="Image description" width="880" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then click on "Add servers"&lt;/p&gt;

&lt;p&gt;First we need to select our application server type(i.e. Linux)&lt;br&gt;
Then click on create IAM user&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dZhVnwDW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igcmnqef0tfvyyg4z2ge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dZhVnwDW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igcmnqef0tfvyyg4z2ge.png" alt="Image description" width="880" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you created an IAM user by the name "mgn-agent-installer" then copy and past the &lt;strong&gt;Access key ID&lt;/strong&gt; and &lt;strong&gt;Secret access key&lt;/strong&gt;&lt;br&gt;
in their respective place.&lt;/p&gt;

&lt;p&gt;Now copy the " Download the installer using this command:" by clicking on the copy button and past it in the Xshell (paste in the  source server).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I4iGZXwq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxt60oinw606lzpswip2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I4iGZXwq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxt60oinw606lzpswip2.png" alt="Image description" width="880" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bfbNoSaJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxluol3yj1quebwrfc49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bfbNoSaJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxluol3yj1quebwrfc49.png" alt="Image description" width="880" height="750"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repeat the same process for step 5( Copy and input the command below into the command line on your source server)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--czgrI8km--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo4fqk2i10btxs1ghf8f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--czgrI8km--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo4fqk2i10btxs1ghf8f.png" alt="Image description" width="880" height="755"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then go back to the "Source servers" and click on your "Source server name"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--htHcBWZs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3ajxgwcu1bz53ahez6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--htHcBWZs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3ajxgwcu1bz53ahez6i.png" alt="Image description" width="880" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then go to "Launch settings and click on "modify"(EC2 Launch Template)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mUflNLn6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qaaf7wo03mielhl45t3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mUflNLn6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qaaf7wo03mielhl45t3.png" alt="Image description" width="880" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now keep things same as shown in the pictures below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F07olHzz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy2w6ybepcqiuutggtm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F07olHzz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dy2w6ybepcqiuutggtm3.png" alt="Image description" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The instance type must be same as of your source server, then you need to give a key pair for your destination instance and you also need to specify the subnet inside which you want to deploy the server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--avx3MBji--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4gf6e6cvvtf0whi7qqae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--avx3MBji--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4gf6e6cvvtf0whi7qqae.png" alt="Image description" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now assign a security group(allow http, https, ssh)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b41JYCAI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2wk71zgan1vrwtr7sdy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b41JYCAI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2wk71zgan1vrwtr7sdy.png" alt="Image description" width="880" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qn-PdTuo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hwnc0va1yaxwixq1jcl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qn-PdTuo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hwnc0va1yaxwixq1jcl.png" alt="Image description" width="880" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--epDehvbi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dtgsu6y1iz3ut8w3id05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--epDehvbi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dtgsu6y1iz3ut8w3id05.png" alt="Image description" width="880" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then click on "Create template version"&lt;/p&gt;

&lt;p&gt;Go to "Launch templates" select the template click on "Action" and click on "Set default version".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1kyGfDCy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aonghw3l3txwobkk8v3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1kyGfDCy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aonghw3l3txwobkk8v3b.png" alt="Image description" width="880" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now again go to your source server and then click on launch setting and then click on edit (General launch settings) and make "Instance type right sizing" &lt;strong&gt;OFF&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vus_Y_4V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zxnjg3nykpkzlva3ldu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vus_Y_4V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zxnjg3nykpkzlva3ldu.png" alt="Image description" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now wait until the "lifecycle" becomes "ready for testing"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7WRtHD3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gho7112ffy3bgur7g4jp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7WRtHD3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gho7112ffy3bgur7g4jp.png" alt="Image description" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After it becomes ready for testing. Go to source servers and "launch test instances"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0NY0WpgP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yn0g1dm9wkmvjnytwerg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0NY0WpgP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yn0g1dm9wkmvjnytwerg.png" alt="Image description" width="880" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you go to ec2 instances you can see that automatically some instances are created and terminated for testing purpose&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dChmKfmx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t5yu34bvp4dp5ka6xd9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dChmKfmx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t5yu34bvp4dp5ka6xd9n.png" alt="Image description" width="880" height="473"&gt;&lt;/a&gt;&lt;br&gt;
wait until the instance(1.compute.internal) is created and status is checked(2/2 check pass)&lt;br&gt;
Associate an elastic IP to it so that we can test weather the web page is successfully transferred to the server or not&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--551za4nT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j2qmah0wmx85mauxbrfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--551za4nT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j2qmah0wmx85mauxbrfl.png" alt="Image description" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you past the elastic IP in the browser you can see webpage is up and running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8NiEYR3B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqoa5ls3yfofzfoxi3m9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8NiEYR3B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqoa5ls3yfofzfoxi3m9.png" alt="Image description" width="880" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, our testing process is completed.&lt;br&gt;
The next step is to go to the source servers and make the server "ready for cutover"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8lZhm_NI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9wie8d3pst6msqyj7ep.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8lZhm_NI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9wie8d3pst6msqyj7ep.png" alt="Image description" width="880" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then launch cutover instance&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hI5O3KMD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr987cm0zf24ubwgd5cu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hI5O3KMD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr987cm0zf24ubwgd5cu.png" alt="Image description" width="880" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once this instance becomes ready associate the elastic IP to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p5rZZAyI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7awx399os5wpvm6g4re.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p5rZZAyI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7awx399os5wpvm6g4re.png" alt="Image description" width="880" height="475"&gt;&lt;/a&gt;&lt;br&gt;
The above server is the final migrated server.&lt;/p&gt;

&lt;p&gt;Now go to Application migration and finalize cutover&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ove-BETC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfytnbve3zml7lmfs9r6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ove-BETC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfytnbve3zml7lmfs9r6.png" alt="Image description" width="880" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then mark as archived&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZYIq_XJf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yytqvy5u36h8scn61knx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZYIq_XJf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yytqvy5u36h8scn61knx.png" alt="Image description" width="880" height="476"&gt;&lt;/a&gt;&lt;br&gt;
This was the complete process of application migration.&lt;br&gt;
Now you can delete and terminate all the other things except (compute.internal) this server and the allocated elastic IP to it.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>cloudskills</category>
    </item>
    <item>
      <title>Increase or Decrease the size of an EBS volume in AWS.</title>
      <dc:creator>Bibhu Sunder</dc:creator>
      <pubDate>Thu, 20 Jan 2022 16:59:02 +0000</pubDate>
      <link>https://forem.com/bibhu_sunder/increase-or-decrease-the-size-of-an-ebs-volume-in-aws-300l</link>
      <guid>https://forem.com/bibhu_sunder/increase-or-decrease-the-size-of-an-ebs-volume-in-aws-300l</guid>
      <description>&lt;p&gt;Suppose you have created an EC2 instance and attached an EBS volume to it.&lt;/p&gt;

&lt;p&gt;Lets first check how can we increase the storage capacity of the EBS volume.&lt;/p&gt;

&lt;p&gt;To do so go to the volume section, select the volume whose storage capacity you want to increase then click on action and then click on modify volume.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--04PV4JyD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1mmmw6x4sshioek1hp3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--04PV4JyD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1mmmw6x4sshioek1hp3k.png" alt="Image description" width="880" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can increase the storage size to your desired size.&lt;br&gt;
(My present size is 15Gb I am going to convert it to 20 Gb)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---ZjaPXe4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8cxw2til1lgerc9b7x0v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---ZjaPXe4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8cxw2til1lgerc9b7x0v.png" alt="Image description" width="880" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PLEASE NOTE THAT YOU CAN ONLY INCREASE THE SIZE HERE,YOU CAN NOT DECREASE THE STORAGE SIZE FROM HERE.&lt;/p&gt;

&lt;p&gt;Now after changing the size click on modify and then again click on modify.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AG4LwNQG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8aa5eevmdbc79fqdluya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AG4LwNQG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8aa5eevmdbc79fqdluya.png" alt="Image description" width="880" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now wait until the volume to optimize 100%, you can check it by going to the volume section&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QFayowTm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8e4zioce0bt5wgrfrc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QFayowTm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8e4zioce0bt5wgrfrc6.png" alt="Image description" width="880" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once its optimized 100% you can go to Xshell and type &lt;strong&gt;lsblk&lt;/strong&gt;. You can see that the storage size have increased to your desired size.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wQ_f4RBo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr25vgfy083c9zyv6rac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wQ_f4RBo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr25vgfy083c9zyv6rac.png" alt="Image description" width="880" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But if you type &lt;strong&gt;df -h&lt;/strong&gt; then you will see that the size of the external storage is still 15gb.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jSDtqJqJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fuiqne5k92ie66pf0vpp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jSDtqJqJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fuiqne5k92ie66pf0vpp.png" alt="Image description" width="880" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is because we have not resized the size of volume in the instance end. So, we can resize by typing a command in the Xshell.&lt;br&gt;
Just write &lt;strong&gt;resize2fs /dev/xvdf&lt;/strong&gt; and then if you type &lt;strong&gt;df -h&lt;/strong&gt; then you will find that the size of your volume is increased.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bqkSii5N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dq1v5h43ecic7r9z98rf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bqkSii5N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dq1v5h43ecic7r9z98rf.png" alt="Image description" width="880" height="750"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how you can increase the size of your EBS volume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Procedure to decrease the size&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The process to decrease the size of the EBS volume is totally different form that of increasing the size. But this is also quite easy.&lt;/p&gt;

&lt;p&gt;Suppose your current volume size is 20Gb and you want to convert it to 10Gb then you just need to go to the volume section and create a EBS volume of 10Gb at the same Availability Zone as of your EC2 instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--29FGYLhC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04w7b1oeud39jg8j231b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--29FGYLhC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04w7b1oeud39jg8j231b.png" alt="Image description" width="880" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now give it a name tag(its optional) then click on create volume.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uPXiC-fd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0hgj8bhh1qkcyl19vkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uPXiC-fd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0hgj8bhh1qkcyl19vkn.png" alt="Image description" width="880" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then select the newly created volume and click on action and then press on attach volume.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wbXim1_2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6sryddi0c70knsbdkv0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wbXim1_2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6sryddi0c70knsbdkv0.png" alt="Image description" width="880" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then select the instance and then press attach volume.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rA_QwuGl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26naetb5fodh0sfpl4lf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rA_QwuGl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26naetb5fodh0sfpl4lf.png" alt="Image description" width="880" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now do the same old process of formatting and mounting the new volume in the instance.&lt;/p&gt;

&lt;p&gt;Now we just need to sync all the data from the previous external storage to the new reduced external storage. The command to do so is  &lt;strong&gt;rsync -aHAXxSP /ext_vol /red_ext_vol/&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mx2PxzKg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x5d9o7xy156ttqs7xped.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mx2PxzKg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x5d9o7xy156ttqs7xped.png" alt="Image description" width="880" height="43"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now all the data from the previous External storage is transferred to the new external storage, so now we need to unmount the previous external storage. The command to do so is** umount /dev/xvdf**.After doing that go the volume section and select external volume and click on detach volume.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oLHUSEdO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqc5qwve6nv9ixk6r9cj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oLHUSEdO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqc5qwve6nv9ixk6r9cj.png" alt="Image description" width="880" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now once its status become available just select the volume again click on action and click on delete volume.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DzQTQoM8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jt7idbv939m69ddrliz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DzQTQoM8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4jt7idbv939m69ddrliz.png" alt="Image description" width="880" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the whole process by which we can reduce the size of an EBS volume.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
