Skip to content

Does AWS Create Fleet with Instant Type and Multi-Instance Type Guarantee Launching of Next Priority Instances if the First Instance is in Pending State?

0

I'm using the AWS create-fleet API with the instant type and multiple instance types. I have a scenario where the first instance type is set to t2.nano, and the second instance type is set to t2.small. If the first instance type (t2.nano) remains in the pending state for any reason, will AWS guarantee that the next priority instance type (t2.small) will launch the required number of instances?

Here is my fleet configuration:


{
  "OnDemandOptions": {
    "SingleInstanceType": false
  },
  "LaunchTemplateConfigs": [
    {
      "LaunchTemplateSpecification": {
        "LaunchTemplateName": "fleet01",
        "Version": "$Latest"
      },
      "Overrides": [
        {
          "InstanceType": "t2.nano",
          "WeightedCapacity": 1
        },
        {
          "InstanceType": "t2.small",
          "WeightedCapacity": 1
        }
      ]
    }
  ],
  "TargetCapacitySpecification": {
    "TotalTargetCapacity": 2,
    "DefaultTargetCapacityType": "on-demand"
  },
  "Type": "instant"
}

From my understanding, the instant type of fleet only attempts to launch instances once. If the first instance type (t2.nano) does not transition from pending to running due to any issue, does this mean that the fleet will not guarantee the successful launch of the next priority instance type (t2.small)?

I cannot test this scenario by intentionally putting an instance in the pending state. How does AWS handle this situation?

asked 2 years ago262 views

1 Answer
1

Based on the configuration you've provided and the behavior of EC2 Fleet with the "instant" type, AWS does not guarantee launching the next priority instance type if the first instance type remains in a pending state.

For EC2 Fleets of type "instant", the fleet makes a single attempt to launch the target capacity. If the fleet cannot launch the full target capacity, it will not retry or switch to alternative instance types. This means that if your t2.nano instances remain in a pending state, the fleet will not automatically attempt to launch t2.small instances to meet the target capacity.

The "instant" fleet type is designed for use cases where you want to launch capacity quickly and do not want to wait for the capacity to be fulfilled if it's not immediately available. It does not provide the same level of automatic failover or retry mechanisms that are available with other fleet types like "maintain" or "request".

In your specific configuration, with a TotalTargetCapacity of 2 and two instance types specified, the fleet will attempt to launch both instances simultaneously. However, if either or both instances fail to launch or remain in a pending state, the fleet will not make additional attempts to launch instances or switch to the alternative instance type.

To achieve more resilience and ensure that your desired capacity is met, you might consider using a different fleet type, such as "maintain", which continuously attempts to maintain the target capacity and can switch between instance types as needed. Alternatively, you could implement your own logic to check the status of the launched instances and create additional fleets or instances if the desired capacity is not met.
Sources
CreateFleet - Amazon Elastic Compute Cloud
Create an EC2 Fleet - Amazon Elastic Compute Cloud

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.