fbpx

Preferred Spot instance types let customers set priority tiers on the Elastigroups’ configured spot types. Types that are selected as preferred will be prioritized over other types and will be used whenever possible considering availability and cost.
In cases that any of the preferred types are not available, Elastigroup will use other types that are selected in the group.

 

How Preferred Instance types work

When scaling, Elastigroup will distribute the instances across different availability zones and instance types to ensure availability. Each combination of availability zone and instance type is referred to as a market. Each preferred market will be allocated with double the number of instances as a non-preferred market.

a ‘minimum markets’ parameter will be set based on the number of instances in your Elastigroup. The larger the number of instances, the larger ‘minimum markets’ needs to be in order for the group to maximize availability and be interruption tolerant.
If there are not enough selected instance types to satisfy the minimum markets parameter, Elastigroup will provision instances across all available markets.

Minimum markets are calculated based on the following formula:
minimumMarkets = min(CEIL(4 + (numberOfInstancesInGroup / 25)) , 12)

Note: minimum markets will always be in the range of 5-12.
Examples

Below are examples for the distribution of instances across different markets given the specified number of preferred instance types and number of instances in the group –

  • 12 instances, 10 Spot instance types, 1 preferred spot type:
Market1 Market2 Market3 (preferred) Market4 Market5
16.67%
2 instances
16.67%
2 instances
33.33%
4 instances
16.67%
2 instances
16.67%
2 instances
  • 27 instances, 10 Spot instance types , 3 preferred spot types:
Market1 (preferred) Market2 (preferred) Market3 (preferred) Market4 Market5 Market6
22.2%
6 instances
22.2%
6 instances
22.2%
6 instances
11.1%
3 instances
11.1%
3 instances
11.1%
3 instances

 

 

Configuring Preferred Spot types using Spotinst Console

  1. Open Elastigroup creation/edit wizard
  2. Navigate under ‘Compute’ tab
  3. Select your allowed instance types
  4. navigate to ‘Additional configurations’ section
  5. ‘Preferred Spot types’ combo box will now be populated with your allowed spot types, from which you may select your preferred types

 

Configuring Preferred Spot types using the API

{
  ...
  "compute": {
    "instanceTypes": {
      "spot": [
        "c4.large",
        "c3.2xlarge",
        "c3.4xlarge"
      ],
      "preferredSpot": [
        "c4.large"
      ]
    }
  }
  ...
}