The preserved primary IP address provides better flexibility and control over AWS workload

Have you been in a situation where an instance associated with MAC/IP address is terminated but you needed to preserve the address beyond instance lifecycle? For instance, applications licenced by MAC/IP address or static routes/firewall port openings.

“The ability to preserve private IP addresses gives system administrators and DevOps teams better flexibility and control over their AWS workloads “, says Lyudmil Barzev, Cloud Infrastructure Engineer at HeleCloud.

Amazon Elastic compute cloud (EC2) is a cloud service that provides secure, flexible and affordable computing resources. It is very useful for the quick provision of virtual machines on the Amazon hyperscale computing environment by maintaining full control over the underlining OS. Each virtual machine instance is associated with one primary network interface called eth0 and its MAC/IP address remains constant throughout the instance lifecycle. When terminated, its interface is also destroyed and, respectively, the address is released. The mechanism enables basic IP management and automated clean-up capabilities.

But what happens when the situation requires keeping the MAC/IP address after the original EC2 instance termination and using it on a newly created one? Some of the well-known actions are primary instance recovery and secondary ENI, which doubles the used IP addresses and limits the number of instances available for provisioning within a subnet.

HeleCloud team applies approach which is simpler, more flexible and straightforward to migrate. We create the network interface as a separate ENI (elastic network interface) which enables us to preserve it when the termination protection on the object is changed. When the instance is released, the ENI can be attached as primary to a new instance.

Click here to review the HeleCloud approach using AWS Console.