All Products
Search
Document Center

Elastic Compute Service:DescribeResourcesModification

Last Updated:Jun 29, 2026

Queries the inventory of instance types or system disk types in a zone before you change the instance type or system disk type of an instance.

Operation description

The following examples describe common change scenarios:

Example 1: Query instance types to which the current instance can be changed

Query the instance types to which instance i-bp67acfmxazb4p**** can be changed, and the inventory of the corresponding instance types in the zone where the instance resides.

http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&RegionId=ap-southeast-1
&ResourceId=i-bp67acfmxazb4p****
&DestinationResource=InstanceType
&OperationType=Upgrade
&Common request parameters

Example 2: Query instance types available after changing the disk type of the current instance

Query the instance types to which instance i-bp67acfmxazb4p**** can be changed after the disk type is changed, and the inventory of the corresponding instance types in the zone where the instance resides.

http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&RegionId=ap-southeast-1
&ResourceId=i-bp67acfmxazb4p****
&DestinationResource=InstanceType
&OperationType=Upgrade
&Conditions.0=DiskCategory
&Common request parameters

Example 3: Query the disk type required by the target instance type

Query the disk type required by the target instance type (for example, ecs.g7.large). The current instance i-bp67acfmxazb4p**** must be changed to this disk type before it can be changed to the target instance type. Also query the inventory of the disk type in the zone where the instance resides.

Note

The target instance type must be obtained by using Example 2.

http(s)://ecs.aliyuncs.com/?Action=DescribeResourcesModification
&RegionId=ap-southeast-1
&ResourceId=i-bp67acfmxazb4p****
&DestinationResource=SystemDisk
&OperationType=Upgrade
&InstanceType=ecs.g7.large
&Common request parameters

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeResourcesModification

get

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the instance whose configuration you want to change. You can call DescribeRegions to query the most recent region list.

cn-hangzhou

ResourceId

string

Yes

The instance ID (InstanceId) of the instance whose instance type or system disk type you want to change.

i-bp67acfmxazb4p****

MigrateAcrossZone

boolean

No

Specifies whether cross-cluster instance type changes are supported. Valid values:

  • true: Supported.

  • false: Not supported.

Default value: false.

If the MigrateAcrossZone parameter is set to true and you upgrade or downgrade the Elastic Compute Service instance based on the returned information, take note of the following items:

  • VPC-type instances: For retired instance types, when a non-I/O optimized instance is changed to an I/O optimized instance, the disk device names and software authorization codes of the server are changed. For Linux instances, basic disks (cloud) are identified as xvda or xvdb. Ultra disks (cloud_efficiency) and standard SSDs (cloud_ssd) are identified as vda or vdb.

true

DestinationResource

string

Yes

The type of the resource to be changed. Valid values:

  • InstanceType: instance type.

  • SystemDisk: system disk type.

    If you set this parameter to SystemDisk, you must also specify the InstanceType parameter to indicate the disk type required by the target instance type.

InstanceType

OperationType

string

No

The type of the Upgrade/Downgrade operation.

  • Valid values for subscription resources:

    • Upgrade: upgrades resources.

    • Downgrade: downgrades resources.

    • RenewDowngrade: downgrades resources upon renewal.

    • RenewModify: renewal with specification change for expired instances.

  • Valid value for pay-as-you-go resources: Upgrade.

Default value: Upgrade.

Upgrade

InstanceType

string

No

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

If DestinationResource is set to SystemDisk, you must also specify the InstanceType parameter to indicate the disk type required by the target instance type.

ecs.g7.large

Cores

integer

No

The number of vCPU kernels of the target 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 target instance type. Unit: GiB. For valid values, see Instance family.

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

8.0

ZoneId

string

No

The ID of the target zone.

Specify this parameter when you want to change the instance type across zones.

cn-hangzhou-e

Conditions

array

No

The list of conditions.

string

No

Only DiskCategory is supported, which indicates querying the instance types available after the disk type of the current instance is changed.

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

DiskCategory

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

AvailableZones

object

AvailableZone

array<object>

The collection of AvailableZone objects that contain zone information.

array<object>

ZoneId

string

The zone ID.

cn-hangzhou-e

Status

string

The state of the resource. Valid values:

  • Available

  • SoldOut

Available

StatusCategory

string

The category of the resource based on stock status. Valid values:

  • WithStock: resources that are in sufficient stock

  • ClosedWithStock: resources that are in insufficient stock

  • WithoutStock: resources that are out of stock

WithStock

RegionId

string

The region ID.

cn-hangzhou

AvailableResources

object

AvailableResource

array<object>

The resources that are available in the zone.

array<object>

Type

string

The resource type. Valid values:

  • InstanceType

  • SystemDisk

InstanceType

SupportedResources

object

SupportedResource

array<object>

The information about the supported resources.

object

Status

string

The state of the resource. Valid values:

  • Available

  • SoldOut

Available

Value

string

The resource type.

ecs.g7.large

Max

integer

The maximum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

2048

Unit

string

The unit of the disk capacity. This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

GiB

StatusCategory

string

The category of the resource based on stock status. Valid values:

  • WithStock: resources that are in sufficient stock

  • ClosedWithStock: resources that are in insufficient stock

  • WithoutStock: resources that are out of stock

WithStock

Min

integer

The minimum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

20

ConditionSupportedResources

object

ConditionSupportedResource

array<object>

The resource types that resources can be changed to after the resources meet specified conditions. If the conditions are met, you can change the current resource to a resource in the list.

array<object>

The resource types that resources can be changed to after the resources meet specified conditions.

Conditions

object

Condition

array<object>

The conditions.

object

The conditions.

Key

string

The condition name. Valid value:

DiskCategory, which indicates a disk category change.

DiskCategory

Status

string

The stock state of the resource. Valid values:

  • Available

  • SoldOut

Available

Value

string

The resource type.

ecs.g5.large

Max

integer

The maximum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

2048

Unit

string

The unit of the disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

GiB

StatusCategory

string

The category of the resource based on stock status. Valid values:

  • WithStock: resources that are in sufficient stock

  • ClosedWithStock: resources that are in insufficient stock

  • WithoutStock: resources that are out of stock

WithStock

Min

integer

The minimum disk capacity.

This parameter takes effect only when the DestinationResource request parameter is set to SystemDisk.

20

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "AvailableZones": {
    "AvailableZone": [
      {
        "ZoneId": "cn-hangzhou-e",
        "Status": "Available",
        "StatusCategory": "WithStock",
        "RegionId": "cn-hangzhou",
        "AvailableResources": {
          "AvailableResource": [
            {
              "Type": "InstanceType",
              "SupportedResources": {
                "SupportedResource": [
                  {
                    "Status": "Available",
                    "Value": "ecs.g7.large",
                    "Max": 2048,
                    "Unit": "GiB",
                    "StatusCategory": "WithStock",
                    "Min": 20
                  }
                ]
              },
              "ConditionSupportedResources": {
                "ConditionSupportedResource": [
                  {
                    "Conditions": {
                      "Condition": [
                        {
                          "Key": "DiskCategory"
                        }
                      ]
                    },
                    "Status": "Available",
                    "Value": "ecs.g5.large",
                    "Max": 2048,
                    "Unit": "GiB",
                    "StatusCategory": "WithStock",
                    "Min": 20
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 Invalid.OperationType The specified operationType is not valid. The specified OperationType 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 Invalid.InstanceChargeType The specified InstanceChargeType is not valid. The specified InstanceChargeType parameter is invalid.
400 InvalidCondition.Malformed The specified Condition is not valid.
403 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist in our records.
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.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 InvalidRegionId.NotFound The RegionId provided does not exist in our records. Region information error
404 Unavailable.Regions The available regions does not exists. 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.ResourceId The specified ResourceId is not valid. The specified ResourceId parameter is invalid.
404 Invalid.InstancePayType The specified InstancePayType is not valid. The specified InstanceChargeType parameter is invalid.
404 Invalid.OperationType The specified OperationType is not valid. The specified parameter OperationType is invalid.
404 OperationDenied The specified operation is denied as this instanceType is not support. The instance type does not support this operation.
404 InvalidInstanceId.NotFound The specified InstanceId provided does not exist in our records. The specified instance does not exist.
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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.