bug: Auto Scaling places every instance in the first subnet despite multiple availability zones #73
AndreKurait
started this conversation in
Bugs (AWS)
Replies: 1 comment
|
Thanks for the report! I was able to recreate the issue and i'll proceed to inform Engineering so they can fix this issue. I'll keep you posted if any updates arises. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Current behavior
On a freshly pulled
localstack/localstack-pro:dev, Auto Scaling advertises both configured availability zones but launches every instance into the first subnet inVPCZoneIdentifier. This occurs with a launch configuration, a launch template, and a template containing a new device-zero network interface. Creating at desired capacity 2 and then increasing to 3 and 4 always gives zone counts2/0,3/0,4/0.Direct
RunInstancesin either subnet reports the correct zone. InstancePlacement.AvailabilityZoneis consistent with its subnet; the defect is ASG distribution, not the EC2 response field.Expected behavior
For an ordinary on-demand ASG with two available zones and no simulated capacity constraints, new instances should be distributed across the configured zones, giving counts
1/1,2/1(either orientation), and2/2. AWS describes the availability-zone distribution behavior here: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-availability-zone-balanced.htmlExact tested environment
EC2_VM_MANAGER=mock.localstack/localstack-pro@sha256:a9b3e374db5310d706c6676a498f22b2b33a45a110ec79dbd7c41f07209c7e28sha256:9581779d9198ddfa6f1a300760edaf7f28052eb2cfdd8f713bb528b186e0cbcclocalstack-core 2026.10.0.dev101,moto-ext 5.1.51, boto3/botocore1.43.108.The bundled public Moto
FakeAutoScalingGroup.replace_autoscaling_group_instancesselects the first subnet and submits onerun_instancescall for the entire requested count. I have not yet run this reproducer against standalone upstream Moto, so this report is specifically about the tested LocalStack bundle.Reproducer
Save the Python below as
reproduce.py. Use an existing privatelicense.envfor your LocalStack license; it is not included in the report. The example does not publish a host port:The script prints each actual subnet/zone count and retains native failures. An execution failure should not be interpreted as a successful reproduction; the tested run completed all cases.
AI-assisted report; the stated results were obtained from the actual stock container and public SDK calls.
All reactions