Search code examples
amazon-ec2configamazon-ami

Configuration of EC2 AMI


it is said after we configure a system in an EC2, we can create EC2 AMI of that, then later on we use the AMI for auto scaling, fail over, etc. But usually the configuration will set something related to the specific information of the EC2, such as IP address, etc. creating EC2 AMI to a new EC2 will setup the old IP to the new EC2 which does not make sense.

So how is EC2 AMI use is this case? Do we need some additional steps to modify the configuration? is it how people use the AMI?


Solution

  • Yes, your understanding is correct, when you capture an AMI, some of the system specific Information do persists, but IP address is not one of them.

    So, if you want to use the AMI, then it is recommended to perform a Sysprep. Sysprep is short hand for System Preparation, which is a Microsoft tool that simplifies the process of duplicating a customised installation of Windows. What Sysprep does is, removes unique information from EC2, which includes information like security identifiers (SID), computer name and drivers. In AWS, Sysprep is integrated with the startup agents EC2-Config for Windows Server 2012R2 and below and EC2 Launch for 2016 and above.

    [1] Create a Standard Amazon Machine Image Using Sysprep: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ami-create-standard.html

    [2] How can I use Sysprep to create and install custom reusable Windows AMIs?: https://aws.amazon.com/premiumsupport/knowledge-center/sysprep-create-install-ec2-windows-amis/

    [3] Sysprep: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview