All Products
Search
Document Center

Elastic Compute Service:DescribeAvailableResource

Last Updated:Jun 29, 2026

Queries the inventory status of resources in a specified zone. This operation is primarily used to check whether target resources, such as instance types and system disk types, are available in a specific zone before you create instances (RunInstances) or modify instance specifications (ModifyInstanceSpec).

Operation description

The DestinationResource parameter has different logic and requirements depending on its value. In the following ordered list, a lower-ranked value requires more parameters to be set. You cannot use a lower-ranked value to filter resources of a higher-ranked category.

  • Value order: Zone > IoOptimized > InstanceType = Network = ddh > SystemDisk > DataDisk

  • Examples:

    • If DestinationResource is set to DataDisk:

      • If ResourceType is set to disk, the operation queries data disk types that are not associated with a specific ECS instance type. In this case, the InstanceType parameter is optional.

      • If ResourceType is set to instance, the operation queries data disk types that can be attached to an ECS instance. Because instance types impose restrictions on data disks, you must specify both InstanceType and DataDiskCategory.

    • If DestinationResource is set to SystemDisk and ResourceType is set to instance, you must specify the InstanceType parameter because ECS instance types impose restrictions on system disks.

    • If DestinationResource is set to InstanceType, specify the IoOptimized and InstanceType parameters.

    • Query the inventory of ecs.g5.large across all zones in a specified region: RegionId=ap-southeast-1 &DestinationResource=InstanceType &IoOptimized=optimized &InstanceType=ecs.g5.large.

    • Query the zones in a specified region where ecs.g5.large is available: RegionId=ap-southeast-1 &DestinationResource=Zone &IoOptimized=optimized &InstanceType=ecs.g5.large.

Query the zones in the China (Hangzhou) region where the ecs.g5.large instance type is available.

"RegionId": "cn-hangzhou",
"DestinationResource": "Zone",
"InstanceType": "ecs.g5.large"

Query the inventory of the ecs.g5.large instance type across all zones in the China (Hangzhou) region.

"RegionId": "cn-hangzhou",
"DestinationResource": "InstanceType",
"InstanceType": "ecs.g5.large"

[Purchase only a data disk] Query the inventory of the cloud_efficiency data disk type in Zone B of the China (Hangzhou) region.

"RegionId": "cn-hangzhou",
"ZoneId": "cn-hangzhou-b",
"ResourceType": "disk",
"DestinationResource": "DataDisk"

[Purchase an ECS instance and a system disk] Query the inventory of the ecs.g7.large instance type with the cloud_essd system disk type in Zone B of the China (Hangzhou) region.

"RegionId": "cn-hangzhou",
"ZoneId": "cn-hangzhou-b",
"ResourceType": "instance",
"InstanceType": "ecs.g7.large",
"DestinationResource": "SystemDisk",
"SystemDiskCategory": "cloud_essd"

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

cn-hangzhou

InstanceChargeType

string

No

The billing method of the resource. For more information, see Billing overview. Valid values:

  • PrePaid: subscription.

  • PostPaid: pay-as-you-go.

Default value: PostPaid.

PrePaid

SpotStrategy

string

No

The bidding policy for pay-as-you-go instances. Valid values:

  • NoSpot: a regular pay-as-you-go instance.

  • SpotWithPriceLimit: a spot instance with a maximum price limit.

  • SpotAsPriceGo: a spot instance priced at the market price with the pay-as-you-go price as the upper limit.

Default value: NoSpot.

This parameter takes effect only when InstanceChargeType is set to PostPaid.

NoSpot

SpotDuration

integer

No

The protection period of the spot instance. Unit: hours. Default value: 1. Valid values:

  • 1: After a spot instance is created, Alibaba Cloud ensures that the instance is not automatically released within 1 hour. After 1 hour, the system compares the bid price with the market price and checks the inventory to determine whether to retain automatic release the instance.

  • 0: After a spot instance is created, Alibaba Cloud does not ensure that the instance runs for 1 hour. The system compares the bid price with the market price and checks the inventory to determine whether to retain automatic release the instance.

Alibaba Cloud sends an ECS system event notification 5 minutes before the instance is released. Spot instances are billed by second. Select an appropriate protection period based on the expected task execution duration.

Note

This parameter takes effect only when InstanceChargeType is set to PostPaid and SpotStrategy is set to SpotWithPriceLimit or SpotAsPriceGo.

1

DestinationResource

string

Yes

The type of resource to query. Valid values:

  • Zone: zone.

  • IoOptimized: I/O optimized.

  • InstanceType: instance type.

  • Network: network type.

  • ddh: dedicated host.

  • SystemDisk: system disk.

  • DataDisk: data disk.

Note

When DestinationResource is set to SystemDisk, you must specify InstanceType because system disks are restricted by instance types.

For more information about how to set the DestinationResource parameter, see the operation description section of this topic.

InstanceType

ZoneId

string

No

The zone ID.

Default value: null. The operation returns resources that match the query conditions across all zones in the specified region (RegionId).

cn-hangzhou-e

IoOptimized

string

No

Specifies whether the instance is an I/O optimized instance. Valid values:

  • none: non-I/O optimized instance.

  • optimized: I/O optimized instance.

Default value: optimized.

optimized

DedicatedHostId

string

No

The ID of the dedicated host.

dh-bp165p6xk2tlw61e****

InstanceType

string

No

The instance type. For more information, see Instance family. You can also invoke DescribeInstanceTypes to query the most recent instance type list.

For more information about how to set the InstanceType parameter, see the operation description section at the beginning of this topic.

ecs.g5.large

SystemDiskCategory

string

No

The category of the system disk. Valid values:

  • cloud: basic disk.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • ephemeral_ssd: local SSD.

  • cloud_essd: enterprise SSD (ESSD).

  • cloud_auto: ESSD AutoPL disk.

Default value description:

  • If InstanceType is set to a retired instance type, the default value is cloud.

  • In other cases, the default value is cloud_efficiency.

Note

When ResourceType is set to instance and DestinationResource is set to DataDisk, the SystemDiskCategory parameter is required. If you do not specify this parameter, the default value takes effect.

cloud_ssd

DataDiskCategory

string

No

The category of the data disk. Valid values:

  • cloud: basic disk.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • ephemeral_ssd: local SSD.

  • cloud_essd: enterprise SSD (ESSD).

  • cloud_auto: ESSD AutoPL disk.

cloud_ssd

NetworkCategory

string

No

The network type. Valid values:

  • vpc: virtual private cloud (VPC).

  • classic: classic network. The classic network is deprecated. For more information, see Deprecation notice.

vpc

Cores

integer

No

The number of vCPU cores of the instance type. For valid values, see Instance family.

This parameter takes effect only when DestinationResource is set to InstanceType.

2

Memory

number

No

The memory size of the instance type. Unit: GiB. For valid values, see Instance family.

This parameter takes effect only when DestinationResource is set to InstanceType.

8.0

ResourceType

string

No

The type of the resource. Valid values:

  • instance: ECS instance.

  • disk: cloud disk.

  • reservedinstance: reserved instance.

  • ddh: dedicated host.

instance

Scope

string

No

The scope of the reserved instance. Valid values:

  • Region: regional.

  • Zone: zonal.

Region

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

0041D94C-FB92-4C49-B115-259DA1C*****

AvailableZones

object

AvailableZone

array<object>

The collection of zone inventory information.

array<object>

The zone inventory information.

ZoneId

string

The ID of the availability zone.

cn-hangzhou-e

Status

string

The status of the availability zone. Possible values:

  • Available: Resources are available for purchase in the zone. This status indicates that at least one resource type is available, not necessarily the specific one you queried.

  • SoldOut: All resources in the availability zone are sold out.

Available

StatusCategory

string

The detailed inventory-based status of the availability zone. Possible values:

  • WithStock: Inventory is available and will be restocked.

  • ClosedWithStock: Inventory is available but will not be restocked.

  • WithoutStock: The inventory is sold out but will be restocked. We recommend selecting a product specification in the WithStock state.

  • ClosedWithoutStock: The inventory is sold out and will not be restocked. We recommend selecting a product specification in the WithStock state.

WithStock

RegionId

string

The ID of the region.

cn-hangzhou

AvailableResources

object

The available resources.

AvailableResource

array<object>

An array of the specific resources that you can create.

array<object>

Details of a specific resource that you can create.

Type

string

The resource type. Possible values:

  • Zone: availability zone.

  • IoOptimized: I/O optimized.

  • InstanceType: instance type.

  • SystemDisk: system disk.

  • DataDisk: data disk.

  • Network: network type.

  • ddh: Dedicated Host.

InstanceType

SupportedResources

object

The supported resources.

SupportedResource

array<object>

An array of the supported resources that you can create.

object

Details of a supported resource that you can create.

Status

string

The status of the resource. Possible values:

  • Available: The resource is available.

  • SoldOut: The resource is sold out.

Available

Value

string

The value of the resource.

ecs.d1ne.xlarge

Max

integer

The maximum capacity of the cloud disk.

Note

This parameter is returned only when DestinationResource is set to SystemDisk or DataDisk.

2048

Unit

string

The capacity unit of the cloud disk.

Note

This parameter is returned only when DestinationResource is set to SystemDisk or DataDisk.

GiB

StatusCategory

string

The detailed inventory-based status of the resource. Possible values:

  • WithStock: Inventory is available and will be restocked.

  • ClosedWithStock: Inventory is available but will not be restocked.

  • WithoutStock: The inventory is sold out but will be restocked. We recommend selecting a product specification in the WithStock state.

  • ClosedWithoutStock: The inventory is sold out and will not be restocked. We recommend selecting a product specification in the WithStock state.

WithStock

Min

integer

The minimum capacity of the cloud disk.

Note

This parameter is returned only when DestinationResource is set to SystemDisk or DataDisk.

20

Examples

Success response

JSON format

{
  "RequestId": "0041D94C-FB92-4C49-B115-259DA1C*****",
  "AvailableZones": {
    "AvailableZone": [
      {
        "ZoneId": "cn-hangzhou-e",
        "Status": "Available",
        "StatusCategory": "WithStock",
        "RegionId": "cn-hangzhou",
        "AvailableResources": {
          "AvailableResource": [
            {
              "Type": "InstanceType",
              "SupportedResources": {
                "SupportedResource": [
                  {
                    "Status": "Available",
                    "Value": "ecs.d1ne.xlarge",
                    "Max": 2048,
                    "Unit": "GiB",
                    "StatusCategory": "WithStock",
                    "Min": 20
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 Invalid.InstanceChargeType The specified InstanceChargeType is not valid. The specified InstanceChargeType parameter is invalid.
400 Invalid.Param The input parameter DestinationResource that is mandatory for processing this request is not supplied. The specified DestinationResource parameter is invalid.
400 InvalidRegionId.MalFormed The specified parameter RegionId is not valid. The specified RegionId parameter is invalid.
403 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist.
403 InvalidParam.TypeAndCpuMem.Conflict The specified 'InstanceType' and 'Cores','Memory' are not blank at the same time.
403 InvalidParam.Cores The specified parameter 'Cores' should be empty. The specified parameter 'Cores' should be empty.
403 InvalidParam.Memory The specified parameter 'Memory' should be empty. The specified parameter 'Memory' should be empty.
403 InvalidParameter.Scope The specified parameter Scope is invalid. The specified parameter Scope is invalid.
403 OperationDenied.RegionIdNotSupported The region does not support preemptible instances.
403 OperationDenied.FlavorNotSupported The flavor does not support preemptible instances.
403 OperationDenied.TimestampNotSupported Preemptible instances are not for sale for current time.
403 InvalidParameter.ResourceOwnerId The specified parameter ResourceOwnerId is not available anymore.
404 Invalid.RegionId The specified RegionId does not exist. The specified RegionId parameter is invalid.
404 Unavailable.Regions The available region does not exist.
404 Invalid.ResourceType The ResourceType provided does not exist in our records. The specified resource type is invalid.
404 Invalid.DestinationResource The specified DestinationResource is not valid. The specified DestinationResource parameter is invalid.
404 Invalid.IoOptimized The specified IoOptimized is not valid. The specified IoOptimized parameter is invalid.
404 Invalid.NetworkCategory The specified NetworkCategory is not valid. The specified NetworkCategory parameter is invalid.
404 Invalid.SpotStrategy The specified SpotStrategy is not valid. The specified SpotStrategy parameter is invalid.
404 Invalid.NetworkType The specified NetworkType is not valid. The specified NetworkType parameter is invalid.
404 InvalidResourceId.NotFound The specified ResourceId is not found in our records. The specified resource does not exist. Check whether the resource ID is correct.
404 InvalidRegionId.NotFound The RegionId provided does not exist in our records. Region information error
404 InvalidDedicatedHostId.NotFound The specified Dedicated Host does not exist. The specified dedicated host does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.