Enable fallback mode in a scaling configuration to improve the scale-out success rate
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/10or 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
Log on to the Auto Scaling console.
-
In the navigation pane on the left, click Scaling Groups. In the top navigation bar, select a region.
-
On the Scaling Groups page, find the target scaling group and click its name.
-
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.
-
-
In the Image and Instance section, set Instance Configuration Mode to Specify Instance Type, and then select your desired instance types.
-
Above the list of selected instance types, click the Alternative Mode button.
The Set Alternative Specification Range dialog box appears.
-
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.
-
-
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.
-
After configuring other settings, click Create or Modify to complete the scaling configuration.
-
(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:
|
|
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 |
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
Log on to the Auto Scaling console.
-
In the navigation pane on the left, click Scaling Groups. In the top navigation bar, select a region.
-
On the Scaling Groups page, find the target scaling group and click its name.
-
On the Scaling Configuration tab, find the configuration and click Modify in the Actions column.
-
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.
-
-
Click Modify to save your changes to the scaling configuration.
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:
|
|
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 |
Disable fallback mode
Console
Log on to the Auto Scaling console.
-
In the navigation pane on the left, click Scaling Groups. In the top navigation bar, select a region.
-
On the Scaling Groups page, find the target scaling group and click its name.
-
On the Scaling Configuration tab, find the configuration and click Modify in the Actions column.
-
To the right of the instance type selection, turn off the Alternative Mode switch.
-
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.
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:
-
Attempts to create instances in cn-hangzhou-j using fallback types such as ecs.c6.large or ecs.c8.large.
-
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
-
For complete parameter descriptions, see Create a scaling configuration (ECS instances).
-
To manage scaling configurations (enable, modify, delete), see Manage scaling configurations.
-
To auto-select instance types by specifying attributes, see Configure a scaling configuration by specifying instance attributes.
-
Call CreateScalingConfiguration or ModifyScalingConfiguration and use the
InstanceTypeCandidateOptionsparameter to configure fallback mode. -
Call DescribeScalingConfigurations to query fallback mode settings.