SECTION 5: Special ISSUE 1 - Aishaa-Kulkarni/Photosite GitHub Wiki

Solution for Issue 1: “what happens when an instance stops running?"

When an instance stops, there is a loss of data where we have to create instances again. To prevent re-setup, We can create an image that can be viewed under AMI.

We can use the AWS Command Line Interface (AWS CLI) to run a VM Import/Export job. Then, a copy of the server is created as an Amazon Machine Image (AMI) and uploaded to an Amazon Simple Storage Service (Amazon S3) bucket. You can launch the AMI as an EC2 instance. Before importing a VM, we need to prepare your AWS environment by creating a service account with appropriate permissions and must prepare our locally hosted VM so that it will be accessible once it is imported into AWS. Install the AWS CLI on an on-premises client and configure it with the AWS credentials generated for the VM import user. Create a new S3 bucket in the same AWS Region of EC2 instance and create an IAM role with trust-policy.json. Replace disk-image-file-bucket with your S3 bucket name. Then upload the image to the S3 bucket. Now run the AWS CLI command import-image. In the end, the image will be imported as an AMI, then we should launch the instance from an AMI by choosing instance type and configuring it.

image

image

image

image

image

image