You can call the ModifyDBInstanceSpec operation to change the instance type or storage capacity of an ApsaraDB RDS instance. This operation is supported for primary and read-only instances. This operation is not supported for disaster recovery or temporary instances.

Before you call this operation, make sure that the following requirements are met:

  • The instance must be in the Running state.
  • The instance cannot have ongoing backup tasks.
  • At least one of the DBInstanceClass and DBInstanceStorage parameters must be specified in the request.
  • If you want to decrease the storage capacity, the specified storage capacity must be greater than or equal to 1.1 times the used storage capacity.
  • The instance must be a primary or read-only instance.
Note If you want to upgrade the RDS edition of the instance, for example, from the Basic Edition to the High-availability Edition, you need only to select a proper instance type.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyDBInstanceSpec

The operation that you want to perform. Set the value to ModifyDBInstanceSpec.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance.

PayType String Yes Postpaid

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
ZoneId String No cn-hangzhou-b

The zone ID of the instance.

DBInstanceClass String No rds.mys2.small

The instance type that you want to specify for the instance. For more information, see Primary instance types. You can also call the DescribeAvailableClasses operation to query the instance types that are available to a region.

Note You must specify at least one of the DBInstanceClass and DBInstanceStorage parameters.
DBInstanceStorage Integer No 20

The storage capacity that you want to specify for the instance. Unit: GB. The storage capacity increases at increments of 5 GB. For more information, see Primary instance types. You can also call the DescribeAvailableClasses operation to query the storage capacity range that is supported for an instance type.

  • You must specify at least one of the DBInstanceStorage and DBInstanceClas parameters.
  • If the instance runs MySQL on RDS High-availability Edition with local SSDs, you can decrease the storage capacity with steps of 5 GB.
EffectiveTime String No MaintainTime

The time when you want to apply the specification changes. Valid values:

  • Immediate: The specification changes are immediately applied.
  • MaintainTime: The specification changes are applied during the specified maintenance window. For more information, see ModifyDBInstanceMaintainTime.

Default value: Immediate.

EngineVersion String No 5.6

The database engine version that is run on the instance. Valid values:

  • MySQL: 5.5, 5.6, 5.7, and 8.0
  • SQLServer: 2008r2, 2012, 2012_ent_ha, 2012_std_ha, 2012_web, 2014_std_ha, 2016_ent_ha, 2016_std_ha, 2016_web, and 2017_ent
  • PostgreSQL: 9.4, 10.0, 11.0, and 12.0
  • PPAS: 9.3 and 10.0
  • MariaDB: 10.3
DBInstanceStorageType String No local_ssd

The type of storage media that is used by the instance. Valid values:

  • local_ssd or ephemeral_ssd: local SSD
  • cloud_ssd: standard SSD
  • cloud_essd: enhanced SSD
Direction String No Up

The type of change that you want to perform on the instance. Valid values:

  • Up: This value can specify to upgrade a subscription instance. This value can also specify to upgrade or downgrade a pay-as-you-go instance.
  • Down: This value specifies to downgrade a subscription instance.

Default value: Up.

SourceBiz String No N/A

A deprecated parameter.

DedicatedHostGroupId String No dhg-7a9xxxxxxxx

The ID of the dedicated cluster to which the instance belongs.

Response parameters

Parameter Type Example Description
DBInstanceId String rm-uf6wjk5xxxxxxx

The ID of the instance.

OrderId Long 207938506080728

The ID of the order.

RequestId String 3C5CFDEE-F774-4DED-89A2-1D76EC63C575

The ID of the request.


Sample requests

http(s):// Action=ModifyDBInstanceSpec
&<Common request parameters>

Sample success responses

XML format


JSON format

    "RequestId": "3C5CFDEE-F774-4DED-89A2-1D76EC63C575",
    "DBInstanceId": "rm-uf6wjk5xxxxxxx",
    "OrderId": 207938506080728

Error codes

For a list of error codes, visit the API Error Center.