User Tools

Site Tools


move_ec2_instance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
move_ec2_instance [2017/07/26 19:16] – [Move EC2 Instance] walkeradminmove_ec2_instance [2017/07/26 20:34] – [Delete the AMI Image] walkeradmin
Line 155: Line 155:
 \\  \\ 
 \\  \\ 
-Configure Instance Details.+**Configure Instance Details.**
 \\  \\ 
 \\  \\ 
Line 163: Line 163:
 \\  \\ 
 \\  \\ 
-Add Storage.+**Add Storage.**
 \\  \\ 
 \\  \\ 
Line 171: Line 171:
 \\  \\ 
 \\  \\ 
-Add Tags.+**Add Tags.**
 \\  \\ 
 \\  \\ 
-{{ :aws_move_instance_015.jpg?600 |}}+{{ :aws_move_instance_015.jpg?900 |}}
 \\  \\ 
-Nothing to do here, select <color #ffc90e>Next:Configure Security Group</color>.+Nothing to do here, select <color #ff7f27>Next:Configure Security Group</color>
 +\\  
 +\\  
 +**Configure Security Group** 
 +\\  
 +\\  
 +{{ :aws_move_instance_016.jpg?900 |}} 
 +\\  
 +Here we have to open any ports that we were using for the instance we copied earlier. I was using port 80 as my EC2 Instance was a web server. 
 +\\  
 +\\  
 +Add any relevant ports then select <color #ff7f27>Review and Launch</color>
 +\\  
 +\\  
 +You will get a warning about storage. 
 +\\  
 +\\  
 +{{ :aws_move_instance_017.jpg?600 |}} 
 +\\  
 +Because we selected magnetic, we see this page. I have been using magnetic for a few weeks and have not yet incurred any costs. 
 +\\  
 +\\  
 +Select <color #ff7f27>Next</color>
 +\\  
 +\\  
 +After all the settings pages you will see a **confirmation page**. 
 +\\  
 +\\  
 +{{ :aws_move_instance_018.jpg?900 |}} 
 +\\  
 +Select <color #ff7f27>Launch</color>
 +\\  
 +\\  
 +Because this is a new EC2 Instance, we need to create a new Key Pair. 
 +\\  
 +\\  
 +{{ :aws_move_instance_019.jpg?600 |}} 
 +\\  
 +Select <color #ff7f27>Create a new key pair</color> and enter a <color #ff7f27>Key pair name</color>
 +\\  
 +\\  
 +Select <color #ff7f27>Download Key Pair</color>. (Don't lose the key, you will permanently lose access to your EC2 Instance.) 
 +\\  
 +\\  
 +Select <color #ff7f27>Launch Instances</color>
 +\\  
 +\\  
 +If you check the status of your EC2 Instance, you will see the following: 
 +\\  
 +\\  
 +{{ :aws_move_instance_020.jpg?900 |}} 
 +\\  
 +The Availability Zone (AZ) has now changed to the region you selected. Your IP will also have changed, as IPs can't be moved between AZs you will have to update your DNS settings, also if you use Elastic IP Addresses, you will have to recreate new ones for this AZ. 
 +\\  
 +\\  
 + 
 +---- 
 + 
 +==== The Original EC2 Instance ==== 
 +\\  
 +We didn't actually move the EC2 Instance, we simply made a backup, copied the backup to a new AZ and created a new EC2 Instance from that backup. 
 +\\  
 +\\  
 +What this means is that the EC2 Instance that you originally had is still there, and if you left it running, it is still running and potentially costing you money. 
 +\\  
 +\\  
 +From the dashboard, select the AZ where your original EC2 Instance was created (US East (Ohio) in my case.) 
 +\\  
 +\\  
 +{{ :aws_move_instance_021.jpg?900 |}} 
 +\\  
 +You can't see instances in different AZs on one page unfortunately, so if you have co-located EC2 Instances, you have to navigate between AZs. 
 +\\  
 +\\  
 +So here we are, back at the original AZ where our original EC2 Instance is. 
 +\\  
 +\\  
 +{{ :aws_move_instance_022.jpg?900 |}} 
 +\\  
 +We have to stop this instance for two reasons. It is using a server, so this is incurring a cost, yes we could just stop it and leave it BUT, it is also consuming hard disk space. Even worse is that we are using a lot of space now because of the copy process, consider this: 
 +\\  
 +\\  
 +Original EC2 Instance is using..<color #ed1c24>8GB</color>\\  
 +The AMI we created is using.....<color #ed1c24>8GB</color>\\  
 +The AMI copy is using...........<color #ed1c24>8GB</color>\\  
 +The new EC2 Instance is using...<color #ed1c24>8GB</color>\\  
 +\\  
 +Total...........................<color #ed1c24>32GB</color> 
 +\\  
 +\\  
 +Our free allowance is 30GB, so we need to do some cleaning up. 
 +\\  
 +\\  
 +We need to do the following: 
 +\\  
 +\\  
 +Stop the old EC2 Instance.\\  
 +Delete the old EC2 Instance.\\  
 +Delete the AMI Image (Snapshot).\\  
 +Delete the AMI Copy Image.\\  
 +\\  
 +\\  
 + 
 +---- 
 + 
 +==== Stop the old EC2 Instance ==== 
 +\\  
 +From the console, navigate to the old EC2 Instance. 
 +\\  
 +\\  
 +{{ :aws_move_instance_023.jpg?900 |}} 
 +\\  
 +Select <color #ff7f27>Actions</color>, then <color #ff7f27>Instance State</color> then <color #ff7f27>Stop</color>
 +\\  
 +\\  
 +You will see a warning page about stopping an Instance. 
 +\\  
 +\\  
 +{{ :aws_move_instance_024.jpg?600 |}} 
 +\\  
 +Select <color #ff7f27>Yes, Stop</color>
 +\\  
 +\\  
 +It might take a minute or two, but the instance will stop. 
 +\\  
 +\\  
 +{{ :aws_move_instance_025.jpg?900 |}} 
 +\\  
 +Keep checking the console until the instance status is <color #ed1c24>stopped</color>
 +\\  
 +\\  
 + 
 +---- 
 +==== Delete old EC2 Instance ==== 
 +\\  
 +To delete the old EC2 Instance, from the EC2 Console page. 
 +\\  
 +\\  
 +{{ :aws_move_instance_026.jpg?900 |}} 
 +\\  
 +Select <color #ff7f27>Actions</color>, <color #ff7f27>Instance State</color>, <color #ff7f27>Terminate</color>
 +\\  
 +\\  
 +You will get a warning about terminating an instance. 
 +\\  
 +\\  
 +{{ :aws_move_instance_027.jpg?600 |}} 
 +\\  
 +Select <color #ff7f27>Yes, Terminate</color>
 +\\  
 +\\  
 +Check the status of your old EC2 to check termination is complete. 
 +\\  
 +\\  
 +{{ :aws_move_instance_028.jpg?900 |}} 
 +\\  
 +This might take a minute to two. 
 +\\  
 +\\  
 + 
 +---- 
 +==== Delete Old AMI ==== 
 +\\  
 +Naviage back to the EC2 Console (ensure you are on your old AZ) 
 +\\  
 +\\  
 +{{ :aws_move_instance_029.jpg?900 |}} 
 +\\  
 +From the menu on the right, go down to <color #ff7f27>Images</color> and select <color #ff7f27>AMIs</color>.  
 +\\  
 +\\  
 +Your AMI will be listed in the main page. 
 +\\  
 +\\  
 +{{ :aws_move_instance_030.jpg?900 |}} 
 +\\  
 +Select <color #ff7f27>Actions</color>, <color #ff7f27>Deregister</color>
 +\\  
 +\\  
 +You will get a warning about deregistering an AMI. 
 +\\  
 +\\  
 +{{ :aws_move_instance_031.jpg?300 |}} 
 +\\  
 +Select <color #ff7f27>Continue</color>
 +\\  
 +\\  
 + 
 +---- 
 +==== Delete the AMI Image ==== 
 +\\  
 +From the <color #ff7f27>EC2 Dashboard</color>
 +\\  
 +\\  
 +{{ :aws_move_instance_032.jpg?900 |}} 
 +\\  
 +Select <color #ff7f27>Snapshots</color>
 +\\  
 +\\  
 +From the <color #ff7f27>Actions</color> menu, select <color #ff7f27>Delete</color>
 +\\  
 +\\  
 +{{ :aws_move_instance_033.jpg?900 |}} 
 +\\  
 +If you have more than one snapshot, ensure you select the correct one. 
 +\\  
 +\\  
 +You will see a warning about deleting a snapshot. 
 +\\  
 +\\  
 +{{ :aws_move_instance_034.jpg?300 |}} 
 +\\  
 +Click <color #ff7f27>Yes, Delete</color>
 +\\  
 +\\  
 + 
 +---- 
 + 
 +==== Delete the AMI Copy Image ==== 
 +\\  
 +The process to delete the AMI copy image is the same as above, you just need to navigate to your new AZ (Availablility Zone) first. 
 +\\  
 +\\  
 +From the <color #ff7f27>EC2 Dashboard</color>
 +\\  
 +\\  
 +{{ :aws_move_instance_032.jpg?900 |}} 
 +\\  
 +Select <color #ff7f27>Snapshots</color>
 +\\  
 +\\  
 +From the <color #ff7f27>Actions</color> menu, select <color #ff7f27>Delete</color>
 +\\  
 +\\  
 +{{ :aws_move_instance_033.jpg?900 |}} 
 +\\  
 +If you have more than one snapshot, ensure you select the correct one. 
 +\\  
 +\\  
 +You will see a warning about deleting a snapshot. 
 +\\  
 +\\  
 +{{ :aws_move_instance_034.jpg?300 |}} 
 +\\  
 +Click <color #ff7f27>Yes, Delete</color>.
 \\  \\ 
 \\  \\ 
  
 +---
move_ec2_instance.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1