全部產品
Search
文件中心

Elastic Compute Service:DescribeRecommendInstanceType

更新時間:Jul 01, 2026

(Beta)呼叫 DescribeRecommendInstanceType 根據一個指定的執行個體規格,查找一個或多個備選的執行個體規格。針對已經或者即將停售的執行個體規格,DescribeRecommendInstanceType 會羅列出作為替補的所有執行個體規格。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

Cores

integer

ECS 執行個體 vCPU 核數。

說明

同時指定Cores參數和Memory參數會匹配所有滿足 vCPU 核數和記憶體大小的執行個體規格。

2

Memory

number

ECS 執行個體記憶體大小,單位為 GiB。

說明

同時指定Cores參數和Memory參數會匹配所有滿足 vCPU 核數和記憶體大小的執行個體規格。

8.0

InstanceFamilyLevel

string

執行個體規格族級別。取值範圍:

  • EntryLevel:入門級。

  • EnterpriseLevel:企業級。

  • CreditEntryLevel:積分入門級。詳情請參見突發性能執行個體

EnterpriseLevel

InstanceType

string

指定的執行個體規格。更多詳情,請參見執行個體規格族,也可以呼叫 DescribeInstanceTypes 介面獲得最新的規格表。

說明

如果您指定了InstanceType,則無法指定Cores或者Memory

ecs.hfg6.large

NetworkType

string

ECS 執行個體的網路類型。取值範圍:

  • vpc:專有網路 VPC。

  • classic:經典網路。經典網路功能已下線,詳情請參見下線公告

預設值:vpc

vpc

InstanceChargeType

string

ECS 執行個體的計費方式。更多詳情,請參見計費概述。取值範圍:

  • PrePaid:包年包月

  • PostPaid:按量付費

預設值:PostPaid

PostPaid

SpotStrategy

string

搶佔式執行個體的競價策略。取值範圍:

  • NoSpot:正常按量付費執行個體。

  • SpotWithPriceLimit:設定上限價格的搶佔式執行個體。

  • SpotAsPriceGo:系統自動出價,最高按量付費價格。

說明

使用SpotStrategy時,InstanceChargerType必須設定為PostPaid

預設值:NoSpot

NoSpot

IoOptimized

string

是否為 I/O 最佳化執行個體。執行個體規格只支援非 I/O 最佳化時,不能設定 IoOptimized 參數。取值範圍:

  • optimized:I/O 最佳化

  • none:非 I/O 最佳化

預設值:optimized

如果您設定的是已停售執行個體規格。預設值:none

optimized

PriorityStrategy

string

優先推薦策略。取值範圍:

  • InventoryFirst:庫存優先。

  • PriceFirst:價格優先,按每小時 vCPU 單價從低到高排序。

  • NewProductFirst:最新產品優先。

預設值:InventoryFirst

PriceFirst

MaxPrice

number

按量付費執行個體或者搶佔式執行個體可接受的每小時最高價格。

說明

設定搶佔式執行個體的最高單價時,SpotStrategy必須設定為SpotWithPriceLimit

10.0

RegionId

string

地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域列表。

cn-hangzhou

ZoneId

string

可用區 ID。您可以呼叫 DescribeZones 查看最新的阿里雲可用區列表。

建議同時 ZoneMatchMode 取值為 Include(預設值),優先推薦 ZoneId 指定的可用區中的執行個體規格,並列出同地域下其他可用區中的執行個體規格。

cn-hangzhou-f

SystemDiskCategory

string

系統磁碟的雲端硬碟種類。取值範圍:

  • cloud_efficiency:高效雲端硬碟

  • cloud_ssd:SSD 雲端硬碟

  • cloud_essd:ESSD 雲端硬碟

  • cloud:普通雲端硬碟

非 I/O 最佳化執行個體的預設值:cloud

I/O 最佳化執行個體的預設值:cloud_efficiency。

cloud_ssd

ZoneMatchMode

string

是否僅推薦 ZoneId 指定的可用區中的執行個體規格。取值範圍:

  • Strict:僅推薦 ZoneId 指定的可用區中的執行個體規格。

  • Include:推薦同地域下其他可用區中的執行個體規格。

當指定ZoneId時,該參數的預設值為 Strict,表示僅推薦 ZoneId 指定的可用區中的執行個體規格。

Strict

Scene

string

在哪種場景下推薦執行個體規格。取值範圍:

  • UPGRADE:升級或降低執行個體規格。

  • CREATE:建立執行個體。

預設值:CREATE

CREATE

InstanceTypeFamily

array

設定備選的執行個體規格族集合,備選的執行個體規格會從該參數設定的執行個體規格族中選擇。最多可輸入 10 個執行個體規格族。

ecs.hfg6

string

執行個體的規格族。規格族取值請參見執行個體規格族。您也可以呼叫 DescribeInstanceTypeFamilys 查詢規格族列表。

ecs.hfg6

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Data

object

RecommendInstanceType

array<object>

推薦的執行個體規格集合。

array<object>

CommodityCode

string

執行個體規格的商品編碼。

ecs

ZoneId

string

執行個體規格所在的可用區 ID。

cn-hangzhou-h

Priority

integer

排序優先順序。

2

NetworkType

string

ECS 執行個體的網路類型。

vpc

Scene

string

在哪種場景下推薦執行個體規格。

CREATE

SpotStrategy

string

搶佔式執行個體的搶佔策略。

NoSpot

RegionId

string

執行個體規格所在的地域 ID。

cn-hangzhou

InstanceChargeType

string

執行個體的計費方式。

PostPaid

Zones

object

zone

array<object>

執行個體規格所在的可用區集合。

array<object>

ZoneNo

string

執行個體規格所在的可用區 ID。

cn-hangzhou-h

NetworkTypes

object

NetworkType

array

執行個體規格的網路類型集合。

string

執行個體規格的網路類型。

vpc

InstanceType

object

執行個體規格名稱。

SupportIoOptimized

string

執行個體規格是否支援 I/O 最佳化。

optimized

Cores

integer

執行個體規格的 vCPU 核數。

1

Memory

integer

執行個體規格的記憶體大小,單位為 MB。

8192

InstanceType

string

執行個體規格名稱。

ecs.hfg6.large

InstanceTypeFamily

string

執行個體規格族。

ecs.hfg6

Generation

string

執行個體規格族系列。

ecs-4

樣本

正常返回樣本

JSON格式

{
  "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"
        }
      }
    ]
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 RecommendEmpty.InstanceTypeNotAuthorized The recommend instanceTypes are not authorized.
400 RecommendEmpty.InstanceTypeSoldOut The recommend instanceTypes are out of usage.
400 RecommendEmpty.DiskCategoryNotRecommended The specified disk category is not available for recommended.
400 InvalidNetworkType.ValueNotSupported The specified parameter NetworkType is not valid.
400 InvalidSpotStrategy.ValueNotSupported The specified parameter SpotStrategy is not valid.
400 InvalidInstanceChargeType.NotFound The specified parameter InstanceChargeType is not valid.
400 InvalidPriorityStrategy.ValueNotSupported The specified parameter PriorityStrategy is not supported.
400 InvalidParam.TypeAndCpuMem.Conflict The specified parameters InstanceType and Cores,Memory should not be blank at the same time.
400 InvalidIoOptimized.NotFound The specified parameter IoOptimized is not valid.
400 InvalidRegionId.MalFormed The specified parameter RegionId is not valid.
400 InvalidDiskCategory.NotFound The specified parameter SystemDiskCategory is not supported.
400 InvalidInstanceTypeFamily.NotFound The specified InstanceTypeFamily is not valid.
400 InvalidMaxPrice.NotSupported The specified MaxPrice is not valid.
400 InvalidZoneId.MalFormed The specified ZoneId is not valid when Cores and Memory is not null.
400 InvalidInstanceType.NotSupported The specified InstanceType is not valid.
400 InvalidZoneId.ValueNotSupported The specified ZoneId is not valid.
400 InvalidCoreAndMemory.ValueNotSupported The specified Cores/Memory does not match instance type.
400 QuotaExceed.AfterpayInstance Living afterpay instances quota exceeded.
400 RecommendEmpty.PerformanceNotSatisfied The performance of recommend instanceType is not satisfied.
400 RecommendEmpty.PriceNotSatisfied The current price of recommend instanceTypes above user max price.
400 RecommendEmpty.QuotaNotSatisfied The quota of recommend instanceTypes are out of usage.
400 RecommendEmpty.IzNotMatched The iz of recommend instanceTypes are not match.
400 RecommendEmpty.InstanceTypeNotMatched The recommend instanceTypes are not match.
400 InvalidScene.ValueNotSupported The specified Scene is invalid.
400 RecommendEmpty.InstanceTypeFamilyNotMatched The recommend instanceTypeFamily are not match.
400 RecommendEmpty.GenerationNotMatch The recommend instanceType generation are not match.
400 RecommendEmpty.NetworkTypeNotSupported The recommend instanceType networkType are not match.
400 InvalidInstanceFamilyLevel.NotSupported The specified InstanceFamilyLevel is not valid.
404 InvalidRegionId.NotFound The RegionId provided does not exist in our records.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情