- Newest
- Most votes
- Most comments
AWS VPC peering between Lightsail and EC2 instances should work in a similar way for both On-Demand and Spot Instances, assuming all are launched in the same VPC. This includes all EC2 instance types, including spot instances. Here are a few troubleshooting steps you can try:
-
Check Spot Instance Security Group Rules: The first thing to check is the security group rules associated with your spot instances. Ensure that you have inbound rules that allow traffic from the CIDR blocks of your Lightsail VPC or Lightsail instance. Also, double-check the outbound rules of your Lightsail instances.
-
Check Network ACLs: Network ACLs operate at the subnet level, so it's possible that the subnet that your spot instances are in has different rules than the subnet for your on-demand instances. Verify that your Network ACLs allow traffic to and from the Lightsail VPC.
-
Verify Route Tables: Check the route tables associated with the subnet your spot instances are in. The route tables need to have an entry that allows traffic to flow between the Lightsail and EC2 VPCs.
-
Check IP Addressing: Make sure you are indeed using the private IP address of the Spot Instances. While it might seem obvious, it can be easy to get mixed up when you are dealing with many instances.
-
Instance State: It's possible that the spot instance got terminated due to market conditions (i.e., the spot price went above your bid). In this case, the instance would no longer exist to connect to. So, double-check your Spot instances' state.
-
Try Traceroute: If you are still having problems, you can try using a traceroute from the Lightsail instance to the Spot Instance to see if that gives you any more information on where the packets are getting lost.
Remember, VPC Peering is a one-to-one relationship between two VPCs. You can create multiple VPC peering connections for each VPC that you own, but transitive peering is not allowed. This means that if VPC A is peered with VPC B and VPC B is peered with VPC C, VPC A is not implicitly peered with VPC C. Make sure this is not the case in your setup.
If the answer is helpful, please click "Accept Answer" and upvote it.
Relevant content
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Instance Security Group Rules - I forgot about those. Thank you!