I am unable to find details in the documentation or Google searches of spot instance limitations in regard to IP addressing. I have tried to do experiments to see what might work using the web based console, the AWS CLI, and the AWS API. So I am either unable find ways to make these requests, or where I have tried what I hoped might work did not work. I would like to know if these capabilities are supposed to work by some means for a spot instance:
- Be assigned and use a random private IPv4 address.
- Be assigned and use a specified private IPv4 address.
- Be assigned and use a random public IPv6 address.
- Be assigned and use a specified public IPv6 address.
Number 1 worked, but I was unable to find a way to make the others work. Example 3 in http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-examples.html seems to imply that user specified addressing is limited in spot instances.
edit 1:
The web console instructions in http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/MultipleIP.html work for adding an IPv4 address to a network interface. But for adding an IPv6 address to a network interface, they do not. There are no error messages, but the addresses are not added.
edit 2:
The web console does not work for adding a specific IPv6 address to a network interface or to create a network interface with a specific IPv6 address. The awscli package in Ubuntu does not include IPv6 subcommands and options. However, the awscli package in Python pip does. I have succeeded adding an IPv6 address to a spot instance by attaching a network interface with an IPv6 address to it.
The only difference between spot, on-demand and reserved instances is how you're billed. This page has a lot of useful information.
Private IPv4 addresses
You can assign additional private IP addresses, known as secondary private IP addresses, to instances that are running in a VPC. Unlike a primary private IP address, you can reassign a secondary private IP address from one network interface to another. A private IP address remains associated with the network interface when the instance is stopped and restarted, and is released when the instance is terminated. For more information about primary and secondary IP addresses, see Multiple IP Addresses in the Amazon EC2 User Guide for Linux Instances.