0
votes

I understand if you need an AWS EC2 instance with a static/fixed MAC address, you need to also have an elastic network interface (ENI) (Elastic network interfaces - Amazon Elastic Compute Cloud). With an ENI, you would have an elastic IP address which would be static.

Per Elastic IP addresses - Amazon Elastic Compute Cloud:

When you associate an Elastic IP address with an instance or its primary network interface, the instance's public IPv4 address (if it had one) is released back into Amazon's pool of public IPv4 addresses. You cannot reuse a public IPv4 address, and you cannot convert a public IPv4 address to an Elastic IP address. For more information, see Public IPv4 addresses and external DNS hostnames.

Doesn't this imply that an EC2 instance with an elastic IP address cannot be cloned?

1

1 Answers

1
votes

The concept of "clone" doesn't quite exist in Amazon EC2.

When I thinking of what makes a computer, there are two components:

  • The contents of the disks
  • The configuration of the virtual machine

The contents of the disks can certainly be cloned. This is the purpose of an Amazon Machine Image (AMI), which can be created from an existing instance. Any instance then launched from the AMI will have the exact same disk contents. In the case of Windows computers, it is recommended to use sysprep before making the AMI, so that the computer can reset its unique IDs so that it behaves better on the same network as its clones.

The configuration of the virtual machine can mostly be cloned. In fact, there is an option in the Amazon EC2 management console called "Launch more like this" that will copy most of the configuration, such as the Instance Type, subnet, User Data and tags. However, this does not include the IP address since this is assigned outside of the instance.

An EC2 instance with an Elastic IP address can be duplicated, but it will not have the Elastic IP address unless that address is reassigned to the new instance. The Elastic IP address is managed by the network and VPC, not by the instance itself. In fact, the instance does not even 'know' its Elastic IP address -- traffic destined for a public IP address is actually sent to the instance's private IP address.

Similarly, within a given VPC only one instance can have a particular IP address.