All Products
Search
Document Center

Elastic Compute Service:DescribeRecommendInstanceType

Last Updated:Jun 06, 2025

Queries alternative instance types of an instance type. This operation is in internal preview. This operation lists all alternative instance types of an instance type that has been or is planed to be retired.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
CoresintegerNo

The number of vCPU cores of the instance type.

Note If you specify both Cores and Memory, the system returns all instance types that match the values of the parameters.
2
MemoryfloatNo

The memory size of the instance type. Unit: GiB.

Note If you specify both Cores and Memory, the system returns all instance types that match the values of the parameters.
8.0
InstanceFamilyLevelstringNo

The level of the instance family. Valid values:

  • EntryLevel: entry level.
  • EnterpriseLevel: enterprise level.
  • CreditEntryLevel: credit-based entry level. For more information, see Burstable instance families.
EnterpriseLevel
InstanceTypestringNo

The instance type. For more information, see Overview of instance families or call the DescribeInstanceTypes operation to query the most recent instance type list.

Note If you specify InstanceType, you cannot specify Cores or Memory.
ecs.hfg6.large
NetworkTypestringYes

The network type of ECS instances. Valid values:

  • classic
  • vpc

Default value: vpc.

vpc
InstanceChargeTypestringNo

The billing method of ECS instances. For more information, see Billing overview. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go

Default value: PostPaid.

PostPaid
SpotStrategystringNo

The bidding policy of spot instances. Valid values:

  • NoSpot: The instances are regular pay-as-you-go instances.
  • SpotWithPriceLimit: The instances are created as spot instances for which you can specify the maximum hourly price.
  • SpotAsPriceGo: The instances are spot instances for which the market price at the time of purchase is automatically used as the bid price. The market price can be up to the pay-as-you-go price.
Note If you specify SpotStrategy, you must set InstanceChargeType to PostPaid.

Default value: NoSpot.

NoSpot
IoOptimizedstringNo

Specifies whether instances of the instance type are I/O optimized. You cannot specify IoOptimized if the instance type supports only non-I/O optimized instances. Valid values:

  • optimized: The instances are I/O optimized.
  • none: The instances are non-I/O optimized.

Default value: optimized.

If you query alternative instance types for retired instance types, this parameter is set to none by default.

optimized
PriorityStrategystringNo

The policy that is used to recommend instance types. Valid values:

  • InventoryFirst: recommends instance types in descending order of resource availability.
  • PriceFirst: recommends the most cost-effective instance types. Recommended instance types appear based on the hourly prices of vCPUs in ascending order.
  • NewProductFirst: recommends the latest instance types.

Default value: InventoryFirst.

PriceFirst
MaxPricefloatNo

The maximum hourly price for pay-as-you-go instances or spot instances.

Note This parameter takes effect only when SpotStrategy is set to SpotWithPriceLimit.
10.0
RegionIdstringYes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ZoneIdstringNo

The zone ID. You can call the DescribeZones operation to query the most recent zone list.

We recommend that you set ZoneMatchMode to Include, which is the default value. This way, the system recommends instance types that are available in the zone specified by ZoneId based on the priority policy. The system also recommends instance types that are available in other zones within the same region.

cn-hangzhou-f
SystemDiskCategorystringNo

The category of the system disk. Valid values:

  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: Enterprise SSD (ESSD)
  • cloud: basic disk

For non-I/O optimized instances, the default value is cloud.

For I/O optimized instances, the default value is cloud_efficiency.

cloud_ssd
ZoneMatchModestringNo

Specifies whether to recommend only instance types in the zone specified by ZoneId. Valid values:

  • Strict: recommends only instance types that are available in the zone specified by ZoneId.
  • Include: recommends instance types that are available in the zone specified by ZoneId and instance types that are available in other zones within the same region.

If ZoneId is specified, the default value of this parameter is Strict, which indicates that only instance types in the zone specified by ZoneId are recommended.

Strict
ScenestringNo

The scenario in which instance types are recommended. Valid values:

  • UPGRADE: instance type upgrade or downgrade
  • CREATE: instance creation

Default value: CREATE.

CREATE
InstanceTypeFamilyarrayNo

The instance families from which the alternative instance types are selected. You can specify up to 10 instance families.

stringNo

The instance family. For more information, see Overview of instance families. You can also call the DescribeInstanceTypeFamilies operation to query the most recent list of instance families.

ecs.hfg6

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
Dataarray<object>

The details of the recommended instance types.

RecommendInstanceTypeobject
CommodityCodestring

The commodity code of the instance type.

ecs
ZoneIdstring

The ID of the zone in which the instance type is available.

cn-hangzhou-h
Priorityinteger

The priority based on which the system sorts the instance types.

2
NetworkTypestring

The network type of the ECS instances.

vpc
Scenestring

The scenario in which the instance type is recommended.

CREATE
SpotStrategystring

The bidding policy for the spot instances.

NoSpot
RegionIdstring

The ID of the region in which the instance type is available.

cn-hangzhou
InstanceChargeTypestring

The billing method of the instances.

PostPaid
Zonesarray<object>

The details of the zones in which the instance type is available.

zoneobject
ZoneNostring

The ID of the zone in which the instance type is available.

cn-hangzhou-h
NetworkTypesarray

The details of the network types of the instance type.

NetworkTypestring

The network type of the instance type.

vpc
InstanceTypeobject

The details of the instance type.

SupportIoOptimizedstring

Indicates whether the instance type supports I/O optimization.

optimized
Coresinteger

The number of vCPUs of the instance type.

1
Memoryinteger

The memory size of the instance type. Unit: MB.

8192
InstanceTypestring

The name of the instance type.

ecs.hfg6.large
InstanceTypeFamilystring

The instance family.

ecs.hfg6
Generationstring

The generation of the instance family.

ecs-4

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "Data": {
    "RecommendInstanceType": [
      {
        "CommodityCode": "ecs",
        "ZoneId": "cn-hangzhou-h",
        "Priority": 2,
        "NetworkType": "vpc",
        "Scene": "CREATE",
        "SpotStrategy": "NoSpot",
        "RegionId": "cn-hangzhou",
        "InstanceChargeType": "PostPaid",
        "Zones": {
          "zone": [
            {
              "ZoneNo": "cn-hangzhou-h",
              "NetworkTypes": {
                "NetworkType": [
                  "vpc"
                ]
              }
            }
          ]
        },
        "InstanceType": {
          "SupportIoOptimized": "optimized",
          "Cores": 1,
          "Memory": 8192,
          "InstanceType": "ecs.hfg6.large",
          "InstanceTypeFamily": "ecs.hfg6",
          "Generation": "ecs-4"
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400RecommendEmpty.InstanceTypeNotAuthorizedThe recommend instanceTypes are not authorized.No instance types can be recommended because no appropriate alternative instance types are available in the specified region or zone.
400RecommendEmpty.InstanceTypeSoldOutThe recommend instanceTypes are out of usage.No instance types can be recommended because the specified instance type is sold out and no appropriate alternative instance types are available within the specified region or zone.
400RecommendEmpty.DiskCategoryNotRecommendedThe specified disk category is not available for recommended.The specified disk category is out of stock.
400InvalidNetworkType.ValueNotSupportedThe specified parameter NetworkType is not valid.The specified NetworkType parameter is invalid.
400InvalidSpotStrategy.ValueNotSupportedThe specified parameter SpotStrategy is not valid.-
400InvalidInstanceChargeType.NotFoundThe specified parameter InstanceChargeType is not valid.-
400InvalidPriorityStrategy.ValueNotSupportedThe specified parameter PriorityStrategy is not supported.-
400InvalidParam.TypeAndCpuMem.ConflictThe specified parameters InstanceType and Cores,Memory should not be blank at the same time.-
400InvalidIoOptimized.NotFoundThe specified parameter IoOptimized is not valid.The specified IO optimization parameter IoOptimized is invalid.
400InvalidRegionId.MalFormedThe specified parameter RegionId is not valid.The specified RegionId parameter is invalid.
400InvalidDiskCategory.NotFoundThe specified parameter SystemDiskCategory is not supported.The specified disk type DiskCategory not supported.
400InvalidInstanceTypeFamily.NotFoundThe specified InstanceTypeFamily is not valid.-
400InvalidMaxPrice.NotSupportedThe specified MaxPrice is not valid.The specified MaxPrice parameter is invalid. This parameter takes effect only for preemptible instances and must be set to a value greater than 0.
400InvalidZoneId.MalFormedThe specified ZoneId is not valid when Cores and Memory is not null.-
400InvalidInstanceType.NotSupportedThe specified InstanceType is not valid.-
400InvalidZoneId.ValueNotSupportedThe specified ZoneId is not valid.The specified ZoneId parameter is invalid.
400InvalidCoreAndMemory.ValueNotSupportedThe specified Cores/Memory does not match instance type.The specified number of CPU cores and memory configuration do not match the specified specification (family).
400QuotaExceed.AfterpayInstanceLiving afterpay instances quota exceeded.The maximum number of pay-as-you-go instances has been reached.
400RecommendEmpty.PerformanceNotSatisfiedThe performance of recommend instanceType is not satisfied.-
400RecommendEmpty.PriceNotSatisfiedThe current price of recommend instanceTypes above user max price.No instance types can be recommended because no instance types that meet the price requirements are available within the specified region or zone.
400RecommendEmpty.QuotaNotSatisfiedThe quota of recommend instanceTypes are out of usage.No instance types can be recommended because none are available within the specified region or zone due to limited quotas.
400RecommendEmpty.IzNotMatchedThe iz of recommend instanceTypes are not match.-
400RecommendEmpty.InstanceTypeNotMatchedThe recommend instanceTypes are not match.-
400InvalidScene.ValueNotSupportedThe specified Scene is invalid.-
400RecommendEmpty.InstanceTypeFamilyNotMatchedThe recommend instanceTypeFamily are not match.No instance types can be recommended because no instance types that meet the requirements for the array of instance types are available within the specified region or zone.
400RecommendEmpty.GenerationNotMatchThe recommend instanceType generation are not match.-
400RecommendEmpty.NetworkTypeNotSupportedThe recommend instanceType networkType are not match.-
400InvalidInstanceFamilyLevel.NotSupportedThe specified InstanceFamilyLevel is not valid.The specified InstanceFamilyLevel parameter is invalid.
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.The RegionId provided does not exist

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-02-26API Description Update. The Error code has changedView Change Details
2023-12-07The Error code has changedView Change Details