How to move ec2 to different availability zone in same region

0

Hello, We have 2 app servers in us-east-1b AZ. As part of DR plan, app team wants a redundancy based on availability zone. Hence, they want to move one of the app server from one AZ to another AZ (from us-east-1b to us-east-1c) in same region. As per my understanding I will performing below actions

  1. Shutdown existing app server
  2. Take AMI backup of the server
  3. Use the above AMI and launch new server in different AZ by selecting subnet from another AZ
  4. complete the movement

my query is, while I perform above steps, does AWS copies entire AMI to another AZ ? by doing this will new server (compute and ebs volumes both ) will run in new AZ ? so that as per requirement 1 server will run in us-east -1b and another server in us-east-1c

Note: App team do not want region level redundancy.

2 Answers
0
Accepted Answer

Hi Sushant,

Yes you are correct. Copying an AMI within AZs ensures that compute and EBS volumes are preserved.

Have a read here fir confirmation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html

If above helps, I would appreciate to be accepted as answer do that community can benefit for clarity, thanks!

profile picture
EXPERT
answered a year ago
profile picture
EXPERT
reviewed 12 hours ago
  • Hello alatech,

    Thanks a lot for quick response. I went through the documentation you shared above. I still have 1 query, does AWS copies all ebs volumes to the new AZ when we choose subnet from that AZ while deployment. (reason for asking is, time taken by AWS to deploy ec2 in same AZ and different AZ is same, how it is possible) Does that mean ebs volumes are stored as global service in s3. and only it creates pointers from different AZ's? Also, in AWS we do not get option to copy AMI to different AZ as we get option of moving it to another region. I tried to find above query on internet but could not get the answer. Answer to these queries will help me to understand how ebs, ami are maintained. Thanks in advance.

  • About your query have you gone through this? https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes.html, check Snapshots section.

    From my knowledge, when copying AMI, it does not copy the ebs volume in new AZ, but it just references it from original.

    Instead, during copying of ami, you can copy an EBS snapshot, which then you can use to create a volume in the target AZ. These snapshots can be used to create multiple new EBS volumes or move volumes across Availability Zones. Snapshots of encrypted EBS volumes are automatically encrypted.

    When you create a new volume from a snapshot, it's an exact copy of the original volume at the time the snapshot was taken. EBS volumes that are created from encrypted snapshots are automatically encrypted. By optionally specifying a different Availability Zone, you can use this functionality to create a duplicate volume in that zone.

  • Hello Alatech, thanks again for the response. if we consider it creates only pointers and do not copy actual ebs volumes to new AZ, but now I can see that all new volumes are showing Availability Zone as "us-east-1c" ?

  • During the process of creating a new AMI from an EC2 instance, it explicitly says "During the image creation process, Amazon EC2 creates a snapshot of each of the above volumes.", where the above volumes refer to the currently attached to the EC2 instance (us-east-1b)

    This snapshot is then used as a reference in the process of launching an EC2 from the generated AMI. In fact, in that part you will have to specify the target subnet (us-east-1c) where the new ec2 instance needs to be placed.

    The end result will be that, because the Copy AMI brings an EBS snapshot with it, then that snapshot is used to create a new EBS Volume in the target subnet (us-east-1c).

    Above steps are the same as outlined here: https://aws.amazon.com/premiumsupport/knowledge-center/move-ec2-instance/

    Hope it helps and that answer can be accepted for clarity :) Thanks!

0

Hello,

You can find the complete procedure to move an EC2 instance to another subnet, Availability Zone, or VPC documented in this Knowledge Center Article.

AWS
Vincent
answered a year ago
profile pictureAWS
EXPERT
kentrad
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions