By using AWS re:Post, you agree to the AWS re:Post Terms of Use

how to Restore EC2 ( windows OS ) From AMI image and retain private IP Address

0

How can I how to Restore EC2 ( windows OS ) From AMI image and retain private IP Address.

asked 2 months ago64 views
2 Answers
1

Hello.

If you set the ENI attached to the original EC2 not to be deleted and select that ENI when restoring from the AMI, the same private IP address can be inherited.
Please note that EC2 with the same IP address cannot be started within the same VPC, so the EC2 that is the restore source must be deleted once.
By changing the ENI settings and setting it so that it will not be deleted before deleting the restore source EC2, the ENI will remain when the EC2 is deleted.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html

Termination behavior
You can set the termination behavior for a network interface that's attached to an instance. You can specify whether the network interface should be automatically deleted when you terminate the instance to which it's attached.

profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
  • Can you share with me the article for theses steps ?

  • The method described by @Gary Mclean is the steps in the blog below. https://medium.com/@ahmedmansouri/assign-a-custom-primary-private-ip-address-to-an-existing-ec2-instance-be62bb473a4f
    I couldn't find the method I explained on the blog, so I'll explain it with images. To set the ENI so that it does not disappear when deleting EC2, change the settings from the ENI screen as shown in the image below. a

    a

    If you remove the checkbox above and save, the ENI will remain when EC2 is deleted. When restoring EC2 from an AMI, you can select the same subnet as the ENI and select and boot the ENI. a

0

When creating an EC2 from an AMI, you can set the private IP Address during the launch instance wizard

https://repost.aws/knowledge-center/custom-private-primary-address-ec2

profile picture
EXPERT
answered 2 months ago
  • Thank you, I have A question The first step I will do is the above steps that uncheck box on deletion when EC2 Termination , but is there anything else I should check before termination EC2?

    And the SG and VPC , Elastic IP , are not effected when I delete the EC2, and I can Attach it to new EC2.

  • I have A question The first step I will do is the above steps that uncheck box on deletion when EC2 Termination , but is there anything else I should check before termination EC2?

    I think it's a good idea to create a snapshot before deleting EC2.

    And the SG and VPC , Elastic IP , are not effected when I delete the EC2, and I can Attach it to new EC2.

    Deleting EC2 does not affect security groups, ElasitcIP, VPC, etc.

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