Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29248

Will AWS Autoscaling group with MixedInstancesPolicy launch On-Demand instance if no spot instances available?

$
0
0

I'm using AutoscalingGroup with mixed policy, where OnDemandBaseCapacity and OnDemandPercentageAboveBaseCapacity are 0, so it won't launch any On-Demand instance but always try to request and launch spot instance when needed. My Cloudformation Spec for autoscaling group:

  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

I have two questions:
1) If one spot instance terminates and there's no another spot instance available, will it launch On-Demand instance and then scale down it to 0?
2) Upon receiving 2-minute termination notice will it automatically throw out instance from referenced load balancers/target groups or do I have manually handle it with CloudWatch/SNS/Lambda?


Viewing all articles
Browse latest Browse all 29248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>