【发布时间】:2020-06-05 16:42:46
【问题描述】:
我正在使用具有混合策略的 AutoscalingGroup,其中 OnDemandBaseCapacity 和 OnDemandPercentageAboveBaseCapacity 为 0,因此它不会启动任何 On-Demand 实例,但总是在需要时尝试请求和启动 Spot 实例。 我的自动缩放组 Cloudformation 规范:
AutoScalingGroupForApiServers:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
VPCZoneIdentifier: !Ref VpcSubnetsForApiLoadBalancer
MinSize: !Ref ASGMinSizeForApiServers
MaxSize: !Ref ASGMaxSizeForApiServers
HealthCheckType: !Ref HealthCheckTypeForApiServers
HealthCheckGracePeriod: !FindInMap [ Constants, '-', AutoScalingGroupDefaultHealthCheckGracePeriod ]
MixedInstancesPolicy:
InstancesDistribution:
OnDemandBaseCapacity: 0
OnDemandPercentageAboveBaseCapacity: 0
SpotAllocationStrategy: lowest-price
SpotInstancePools: 2
LaunchTemplate:
LaunchTemplateSpecification:
LaunchTemplateId: !Ref AutoScalingLaunchTemplateForApiServers
Version: !GetAtt AutoScalingLaunchTemplateForApiServers.LatestVersionNumber
LoadBalancerNames:
- !Ref ElasticLoadBalancerForApiServers
我有两个问题:
1) 如果一个 Spot 实例终止并且没有另一个 Spot 实例可用,它是否会启动 On-Demand 实例然后将其缩减为 0?
2) 在收到 2 分钟的终止通知后,它会自动从引用的负载均衡器/目标组中抛出实例,还是我已经使用 CloudWatch/SNS/Lambda 手动处理它?
【问题讨论】:
标签: amazon-web-services amazon-ec2