Sometimes we need new machine with same dependencies that are running on our prod server for test something. So we create new machine from existing machine to avoid any kind of mishappening. First of all login into your AWS account and Go to:-
Service->>Instances->>Select Running instance that we want to replicate ->> Actions ->> Image ->> Create Image
Enter Image Name & Image description for identification purpose. Also please select no reboot option. It won’t reboot our running instance before creating image. But sometimes it’s reduces the data integrity .
Than click on create image.
After that we will get pop up like below than click on marked link.
We have to wait until AMI creation in progress. It’s showing status as pending as you can see in image.
Once AMI is successfully created status will be changed to available.
Now select that AMI and click on Actions ->> Launch
After that we need to follow same steps that we are using to launch new EC2 instance in AWS.
Once we have successfully launched new EC2 from AMI then we can remove AMI to reduce unwanted charges.
Select AMI ->> Actions ->> Deregister
After that popup will prompted like below and click on Continue.
Now we have removed AMI.
ALL Done!