Dear Readers,
In this article,we will see Copy AMI between Regions and Launch Instance From AMI.
Implementation Steps
- View Instance (For already created Instance).
- Connect to Linux Server through putty and verify packages,files and directories.
- Create AMI (Amazon Machine Image).
- Copy AMI to another Region (singapore).
- Go to singapore Region and view AMI and snapshot.
- Launch Instance from AMI.
- Connect to Linux Server through putty and verify packages,files and directories.
First, we need to AWS Console page by using below link.
https://aws.amazon.com/console/
Click on sign in to Console button.
Logging to aws account
Login using username & password and click on sign in.
Enter to AWS Management Console
We can see the AWS Management Console Dashboard.
Go to Services, under the compute module click EC2 service to open.
I have already launched EC2 Instance.
View your Instance
Go to Instances,
We can see Linux Server “My Linux” which was created earlier.
Connect to Linux Server through putty and verify packages,files and directories.
Open Linux Server terminal,.
Open Linux Terminal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Using username "ec2-user". Authenticating with public key "imported-openssh-key" Last login: Sat Nov 23 19:50:40 2019 from 124.123.103.5 __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 5 package(s) needed for security, out of 13 available Run "sudo yum update" to apply all updates. [ec2-user@ip-172-31-0-157 ~]$ |
Switch to root user
1 2 3 4 |
[ec2-user@ip-172-31-0-157 ~]$ sudo su [root@ip-172-31-0-157 ec2-user]# |
Verify files in current directory
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
root@ip-172-31-43-140 ec2-user]# ls ktexperts [root@ip-172-31-43-140 ec2-user]# tree . └── ktexperts └── aws 1 directory, 1 file [root@ip-172-31-43-140 ec2-user]# |
Check the tree package installed or not
1 2 3 4 |
[root@ip-172-31-0-157 ec2-user]# rpm -q tree package tree is installed. |
In this server, we can see one directory “ktexperts” ,one file “aws”.
One package has been installed i.e,tree.
Create AMI (Amazon Machine Image)
Select your instance “My Linux”
Go to actions, click on Create Image under the Image.
Specify Name of the Image “Ktexperts – AMI (Mumbai) and click on Create Image.
One success message will be displayed. Click ‘Close’.
and click on Close.
View your AMI
Navigate to AMIs under IMAGES.
we can see the AMI “Ktexperts – AMI (Mumbai) has been created.
Note
When you create Image , Snapshot will also be created automatically.
Go Snapshots, we can see one snapshot created by Created by Create Image.
View your Snapshot
Navigate to Snapshots under Elastic Block Storage.
We can see the created snapshot as shown below.
Copy AMI to Another Region
Navigate to AMIs under IMAGES.
Select your AMI, click on copy AMI in the Actions.
Select Destination region “Asia Pacific (Singapore) and click on copy AMI.
The AMI copy operation has been initiated.
You can see New AMI in the AMI Screen and click on done.
Go to singapore Region and view AMI and snapshot
Click on Asia Pacific (Singapore).
Navigate to AMIs under IMAGES.
we can see the AMI “Ktexperts – AMI (Mumbai) is being created.
It will take come to complete.
we can see the AMI “Ktexperts – AMI (Mumbai) has been created.
Note
When you create Image , Snapshot will also be created automatically.
Go Snapshots, we can see one snapshot created by Created by Create Image.
View your Snapshot
Navigate to Snapshots under Elastic Block Storage.
We can see the created snapshot as shown below.
Launch Instance From AMI
Go to Instances, Click on Launch Instance
Choose an Amazon Machine Image (AMI)
Select the Operating system of the EC2 instance by choosing any of the Amazon Machine Images (AMI).
Go to My AMI’s,Select you created AMI “Ktexperts – AMI (Mumbai)”.
Choose an Instance type
Choose the Type of instance depending on your requirements.
Instance types comprise of varying combinations of CPU, memory, storage, and networking capacity.
select the default option of t2. micro – this instance type is covered within the free tier. Then click on Configure Instance Details.
Configure Instance Details
Configure EC2 instance details as per requirements of your environment and click on Add Storage.
Add Storage
Here, we can see root volume by default and size of 8GB
Add a new volume if required
Click on Add Tags.
Add Tags
Tags assist in easier identification and classification of the various instances in your AWS environment.
Click on click to add a Name tag to provide name for our server.
Provide the name for the Linux virtual machine for easier understanding and click on Configure Security Groups.
Configure Security Group
A security group allows configuring firewall rules to allow traffic as needed. Only one rule has been added to allow remote connection.
Create a new security group “My Linux” and choose SSH and HTTP ports.
Click on Review and Launch.
Review Instance Launch
Review and confirm the configuration of the instance. Click on the Edit button on each configuration item to make changes and click on Launch.
Create a Key Pair and Launch Your Instance
To connect to your virtual machine, you need a key pair. A key pair is used to log into your instance and Choose create a new key pair
Create a new key pair and name it My Linux. Then click on Download Key Pair.
After you have downloaded and saved your key pair, click on Launch Instance to start your Windows Server instance.
click on View Instances to view the instance you have just created and see its status.
We can the instance which was created.
Connect to Linux Instance through putty
Copy Public DNS of your instance.
Enter public DNS in putty and upload PPK file then terminal will be opened.
It will ask username, specify “ec2-user” .
Open Linux Terminal
Open Linux Terminal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Using username "ec2-user". Authenticating with public key "imported-openssh-key" Last login: Sat Nov 23 19:50:40 2019 from 124.123.103.5 __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 5 package(s) needed for security, out of 13 available Run "sudo yum update" to apply all updates. [ec2-user@ip-172-31-0-157 ~]$ |
Switch to root user
1 2 3 4 |
[ec2-user@ip-172-31-0-157 ~]$ sudo su [root@ip-172-31-0-157 ec2-user]# |
Verify files in current directory
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
root@ip-172-31-43-140 ec2-user]# ls ktexperts [root@ip-172-31-43-140 ec2-user]# tree . └── ktexperts └── aws 1 directory, 1 file [root@ip-172-31-43-140 ec2-user]# |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform