Enable fallback mode in a scaling configuration to improve the scale-out success rate

Updated at:
Copy as MD

When a scaling group encounters insufficient inventory during scale-out, fallback mode enables Auto Scaling to automatically use alternative instance types or zones from your specified scope, improving the success rate.

How it works

If a scaling group uses a single instance type or limited zones, scale-out may fail due to insufficient inventory. Fallback mode uses real-time inventory data to automatically supplement available instance types and zones within your defined scope, improving the success rate.

When you enable fallback mode, you can control its scope with the following options:

Option

Description

Maximum Price

The maximum hourly price for fallback instance types. Fallback types will not exceed this limit. For example, if the highest price among your selected types is CNY 5.00/hour, you can set the limit to CNY 6.00/hour.

If you do not set a limit, fallback mode uses the highest price among your selected instance types as the default limit.

Allow instance types from other generations

When enabled, the fallback scope expands to include same-sized instance types from other generations. For example, if the primary type is ecs.c7.large, Auto Scaling may use ecs.c6.large or ecs.c8.large as alternatives.

Allow adding vSwitches from other zones

When enabled, if all selected zones are out of stock, Auto Scaling creates a vSwitch in another zone based on real-time inventory and adds it to the scaling group. You must specify a vSwitch CIDR block when you enable this option. For example, if the scaling group uses cn-hangzhou-h and cn-hangzhou-g, and neither zone has inventory, Auto Scaling may create a vSwitch in cn-hangzhou-k and add it to the scaling group.

Prerequisites

  • You have created an ECS scaling group.

  • The instance configuration method for the scaling configuration is Specify Instance Type. Fallback mode is not supported with the Specify Instance Attributes method.

Limits

When you enable Allow adding vSwitches from other zones, you must specify a vSwitch CIDR block. The CIDR block must meet the following requirements:

  • The mask length of the vSwitch CIDR block must be 16 to 29 bits.

  • The vSwitch CIDR block must fall within the VPC CIDR block. For more information, see What is a VPC?.

  • The vSwitch CIDR block cannot match the destination CIDR block of any route entry in the VPC, but can be a subset of one.

  • The vSwitch CIDR block cannot be 100.64.0.0/10 or any of its subnets.

Enable fallback mode

You can enable fallback mode when you create or modify a scaling configuration using the console, CLI, or API.

Console

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups. In the top navigation bar, select a region.

  3. On the Scaling Groups page, find the target scaling group and click its name.

  4. On the Scaling Configuration tab, perform one of the following operations:

    • To create a new scaling configuration, click Create Scaling Configuration.

    • To modify an existing scaling configuration, find the configuration and click Modify in the Actions column.

  5. In the Image and Instance section, set Instance Configuration Mode to Specify Instance Type, and then select your desired instance types.

  6. Above the list of selected instance types, click the Alternative Mode button.

    The Set Alternative Specification Range dialog box appears.

  7. In the Set Alternative Specification Range dialog box, configure the fallback scope as needed. The following table describes the parameters.

    Parameter

    Description

    Maximum Price

    The maximum hourly price for fallback instance types. The system displays the Highest unit price of selected types for reference. Set the limit slightly above the current maximum (up to 10% higher) to expand the fallback pool.

    Instance Type

    Turn on the Allow instance types from other generations switch to include same-sized instance types from other generations. For example, if the primary type is ecs.c7.large, this allows ecs.c6.large or ecs.c8.large as alternatives.

    Vpc_vSwitch

    Turn on the Allow supplemental vSwitches in other zones switch. When all selected zones are out of stock, the scaling group automatically creates a vSwitch in another zone and adds it to the scaling group.

    vSwitch CIDR Blocks

    Required only when Allow adding vSwitches from other zones is enabled. Specify the IPv4 CIDR block for automatically created vSwitches. Requirements:

    • The mask length must be 16 to 29 bits.

    • The CIDR block must fall within the VPC CIDR block.

    • The CIDR block cannot match the destination CIDR block of a route entry in the VPC, but can be a subset.

    • The CIDR block cannot be 100.64.0.0/10 or any of its subnets.

  8. Click OK to save the settings.

    On the scaling configuration page, a preview of Alternative Specifications and Alternative Zone appears below the instance type list, showing the instance types and zones that may be used based on your scope settings.

  9. After configuring other settings, click Create or Modify to complete the scaling configuration.

  10. (Optional) Enable the scaling configuration.

CLI/API

When you call the CreateScalingConfiguration or ModifyScalingConfiguration operation through the CLI or an SDK, use the following parameters to configure fallback mode:

Parameter

Type

Required

Description

InstanceTypeCandidateOptions.Enabled

boolean

No

Specifies whether to enable fallback mode. Valid values:

  • true: Enables fallback mode.

  • false (default): Disables fallback mode.

InstanceTypeCandidateOptions.MaxPrice

float

No

The maximum hourly price for fallback instance types. Fallback instances will not exceed this limit.

InstanceTypeCandidateOptions.AllowDifferentGeneration

boolean

No

Specifies whether to allow instance types from other generations. For example, if the primary type is ecs.c7.large, enabling this allows Auto Scaling to use ecs.c6.large or ecs.c8.large.

InstanceTypeCandidateOptions.AllowCrossAz

boolean

No

Specifies whether to allow supplemental vSwitches in other zones. If enabled and inventory is unavailable in the selected zones, Auto Scaling creates a vSwitch in another zone based on real-time inventory and adds it to the scaling group. You must also specify AllowCidrBlocks when this parameter is set to true.

InstanceTypeCandidateOptions.AllowCidrBlocks.N

string

No

The CIDR block for supplemental vSwitches in other zones. Requirements: the mask length must be 16 to 29 bits; the CIDR block must fall within the VPC CIDR block; it cannot be the same as the destination CIDR block of any route entry in the VPC but can be a subset; it cannot be 100.64.0.0/10 or any of its subnets.

View the fallback mode configuration

You can view a scaling configuration's fallback mode settings through the console, CLI, or API.

Console

  • Scaling configuration list: Scaling configurations with fallback mode enabled display an Alternative Mode tag for quick identification.

  • Scaling configuration details: Click a scaling configuration ID to open its details, which show the complete fallback mode configuration:

    • Whether fallback mode is enabled.

    • The price limit.

    • Whether instance types from other generations are allowed.

    • Whether supplemental vSwitches in other availability zones are allowed.

    • The vSwitch CIDR blocks, if configured.

CLI/API

Call the DescribeScalingConfigurations operation through the CLI or an SDK. The response includes the following fallback mode fields:

Parameter

Type

Description

InstanceTypeCandidateOptions.Enabled

boolean

Indicates whether fallback mode is enabled.

InstanceTypeCandidateOptions.MaxPrice

float

The maximum price per hour for fallback instance types.

InstanceTypeCandidateOptions.AllowDifferentGeneration

boolean

Indicates whether instance types from other generations are allowed.

InstanceTypeCandidateOptions.AllowCrossAz

boolean

Whether supplemental vSwitches in other zones are allowed.

InstanceTypeCandidateOptions.AllowCidrBlocks

array of string

The CIDR blocks for supplemental vSwitches.

Modify the fallback mode configuration

Console

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups. In the top navigation bar, select a region.

  3. On the Scaling Groups page, find the target scaling group and click its name.

  4. On the Scaling Configuration tab, find the configuration and click Modify in the Actions column.

  5. Click Edit Candidate Scope. In the Set Alternative Specification Range dialog box, configure the scope as needed. The following table describes each parameter.

    Parameter

    Description

    Maximum Price

    The maximum hourly price for fallback instance types. The system displays the Highest unit price of selected types for reference. Set the limit slightly above the current maximum (up to 10% higher) to expand the fallback pool.

    Instance Type

    Turn on the Allow instance types from other generations switch to include same-sized instance types from other generations. For example, if the primary type is ecs.c7.large, this allows ecs.c6.large or ecs.c8.large as alternatives.

    Vpc_vSwitch

    Turn on the Allow supplemental vSwitches in other zones switch. When all selected zones are out of stock, the scaling group automatically creates a vSwitch in another zone and adds it to the scaling group.

    vSwitch CIDR Blocks

    Required only when Allow adding vSwitches from other zones is enabled. Specify the IPv4 CIDR block for automatically created vSwitches. Requirements:

    • The mask length must be 16 to 29 bits.

    • The CIDR block must fall within the VPC CIDR block.

    • The CIDR block cannot match the destination CIDR block of a route entry in the VPC, but can be a subset.

    • The CIDR block cannot be 100.64.0.0/10 or any of its subnets.

  6. Click Modify to save your changes to the scaling configuration.

Important

After modifying fallback mode in a scaling configuration, new ECS instances use the updated settings. Existing instances are not affected.

CLI/API

Call the ModifyScalingConfiguration operation through the CLI or an SDK to configure fallback mode with the following parameters:

Parameter

Type

Required

Description

InstanceTypeCandidateOptions.Enabled

boolean

No

Specifies whether to enable fallback mode. Valid values:

  • true: Enables fallback mode.

  • false (default): Disables fallback mode.

InstanceTypeCandidateOptions.MaxPrice

float

No

The maximum hourly price for fallback instance types. Fallback instances will not exceed this limit.

InstanceTypeCandidateOptions.AllowDifferentGeneration

boolean

No

Specifies whether to allow instance types from other generations. For example, if the primary type is ecs.c7.large, enabling this allows Auto Scaling to use ecs.c6.large or ecs.c8.large.

InstanceTypeCandidateOptions.AllowCrossAz

boolean

No

Specifies whether to allow supplemental vSwitches in other zones. If enabled and inventory is unavailable in the selected zones, Auto Scaling creates a vSwitch in another zone based on real-time inventory and adds it to the scaling group. You must also specify AllowCidrBlocks when this parameter is set to true.

InstanceTypeCandidateOptions.AllowCidrBlocks.N

string

No

The CIDR block for supplemental vSwitches in other zones. Requirements: the mask length must be 16 to 29 bits; the CIDR block must fall within the VPC CIDR block; it cannot be the same as the destination CIDR block of any route entry in the VPC but can be a subset; it cannot be 100.64.0.0/10 or any of its subnets.

Disable fallback mode

Console

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups. In the top navigation bar, select a region.

  3. On the Scaling Groups page, find the target scaling group and click its name.

  4. On the Scaling Configuration tab, find the configuration and click Modify in the Actions column.

  5. To the right of the instance type selection, turn off the Alternative Mode switch.

  6. Click Modify to save your changes to the scaling configuration.

CLI/API

Call the ModifyScalingConfiguration API operation via CLI or SDK and set InstanceTypeCandidateOptions.Enabled to false.

Important

After you disable fallback mode, the scaling group no longer supplements other instance types or zones during scale-out. If inventory is insufficient for the configured instance types and zones, scale-out may fail.

Example

The following example demonstrates how fallback mode improves the scale-out success rate during inventory shortages.

Scenario: A scaling group uses ecs.c7.large in cn-hangzhou-j. Scale-out events frequently fail because this instance type is out of stock in this zone.

Solution: Enable fallback mode with the following settings:

Parameter

Value

Price limit

1.10 CNY/hour (10% above the current instance price of 1.00 CNY/hour)

Allow instance types from other generations

Enabled

Allow supplemental vSwitches in other zones

Enabled

vSwitch CIDR block

192.168.3.0/24

Result: When ecs.c7.large is out of stock in cn-hangzhou-j, the scaling group automatically:

  1. Attempts to create instances in cn-hangzhou-j using fallback types such as ecs.c6.large or ecs.c8.large.

  2. If all fallback types are also out of stock in cn-hangzhou-j, creates a vSwitch in another zone such as cn-hangzhou-k and creates instances there using the primary or fallback types.

Fallback mode improves the scale-out success rate without manual intervention.

Related topics