全部產品
Search
文件中心

Elastic Compute Service:ModifyInstanceSpec

更新時間:Aug 27, 2026

此介面用於修改一台隨收隨付 ECS 執行個體的執行個體規格或公網頻寬大小。

介面說明

請確保在使用該介面前,已充分了解 ECS 產品的收費方式和價格

更改隨收隨付執行個體規格前,您可以透過 DescribeResourcesModification 查詢目前執行個體支援變更配置的執行個體規格。

注意事項

  • 帳號必須處於無欠費狀態。

  • 每次呼叫只能修改單項設定,即單次只能修改執行個體規格,或者只能調整公網頻寬大小。

  • 執行個體狀態必須為執行中Running)或者已停止Stopped)時才能調節公網頻寬大小,修改後立即生效。

  • 執行個體狀態必須為已停止Stopped)時才能修改執行個體規格,修改後需要啟動執行個體後生效。

說明

單個地域下,單個阿里雲帳號按固定頻寬計費的公網頻寬峰值總和存在限制,請參見公網頻寬限制

調試

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

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ecs:ModifyInstanceSpec

update

*Instance

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

  • ecs:AssociatePublicIpAddress

請求參數

名稱

類型

必填

描述

樣本值

InstanceId

string

指定的執行個體 ID。

i-bp67acfmxazb4p****

InstanceType

string

執行個體的目標規格。更多資訊,請參見執行個體規格族,也可以呼叫 DescribeInstanceTypes 介面獲得最新的規格表。

ecs.g6.large

InternetMaxBandwidthOut

integer

公網出頻寬最大值,單位為 Mbit/s(Megabit per second)。取值範圍:0~100。

說明

按使用流量計費模式下的出入頻寬峰值都是頻寬上限,不作為業務承諾指標。當出現資源爭搶時,頻寬峰值可能會受到限制。如果您的業務需要有頻寬的保障,請使用按固定頻寬計費模式。

10

InternetMaxBandwidthIn

integer

公網入頻寬最大值,單位為 Mbit/s(Megabit per second)。取值範圍:

  • 當所購公網出頻寬小於等於 10 Mbit/s 時:1~10,預設值為 10。

  • 當所購公網出頻宽大於 10 Mbit/s 時:1~InternetMaxBandwidthOut 的取值,預設值為 InternetMaxBandwidthOut 的取值。

說明

按使用流量計費模式下的出入頻寬峰值都是頻寬上限,不作為業務承諾指標。當出現資源爭搶時,頻寬峰值可能會受到限制。如果您的業務需要有頻寬的保障,請使用按固定頻寬計費模式。

10

Temporary.StartTime

string

說明

該參數正在邀測中,暫未開放使用。

null

Temporary.EndTime

string

說明

該參數正在邀測中,暫未開放使用。

null

Temporary.InternetMaxBandwidthOut

integer

說明

該參數正在邀測中,暫未開放使用。

null

Async

boolean

是否提交非同步請求。取值範圍:

  • true:是。

  • false:否。

預設值:false。

false

AllowMigrateAcrossZone

boolean

是否支援跨叢集升級執行個體規格。

  • true:是。

  • false:否。

預設值:false。

當參數 AllowMigrateAcrossZone 取值為 true 時,一旦您根據返回資訊升級了雲端伺服器,請留意以下注意事項:

傳統網路類型執行個體:

  • 對於已停售的執行個體規格,非 I/O 最佳化執行個體變更配置到 I/O 最佳化執行個體時,執行個體私網 IP 位址、磁碟裝置名稱和軟體授權碼會發生變化。對於 Linux 執行個體,普通雲端硬碟(cloud)會被識別為 xvda 或者 xvdb 等,高效雲端硬碟(cloud_efficiency)和 SSD 雲端硬碟(cloud_ssd)會被識別為 vda 或者 vdb 等。

  • 對於正常販售的執行個體規格族,執行個體的私網 IP 位址會發生變化。

VPC 類型執行個體:對於已停售的執行個體規格,非 I/O 最佳化執行個體變更配置到 I/O 最佳化執行個體時,雲端伺服器磁碟裝置名稱和軟體授權碼會發生變化。Linux 執行個體的普通雲端硬碟(cloud)會被識別為 xvda 或者 xvdb 等,高效雲端硬碟(cloud_efficiency)和 SSD 雲端硬碟(cloud_ssd)會被識別為 vda 或者 vdb 等。

false

SystemDisk.Category

string

更換系統磁碟類型。取值範圍:

  • cloud_efficiency:高效雲端硬碟

  • cloud_ssd:SSD 雲端硬碟

說明

該參數只有在從已停售的執行個體規格升級到正常販售的執行個體規格族,並將非 I/O 最佳化執行個體規格升級為 I/O 最佳化執行個體規格時有效。

cloud_ssd

ClientToken

string

保證請求冪等性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多資訊,請參見如何保證冪等性

0c593ea1-3bea-11e9-b96b-88e9fe637760

ModifyMode

string

說明

該參數暫未開放使用。

null

Disk

array<object>

說明

該參數暫未開放使用。

object

說明

該參數暫未開放使用。

DiskId

string

說明

該參數暫未開放使用。

null

Category

string

說明

該參數暫未開放使用。

null

PerformanceLevel

string

說明

該參數暫未開放使用。

null

DryRun

boolean

是否只預檢此次請求。取值範圍:

  • true:傳送檢查請求,不會調整執行個體的執行個體規格和公網頻寬大小。檢查項目包括是否填寫了必需參數、請求格式、業務限制和 ECS 庫存。如果檢查不通過,則返回對應錯誤。如果檢查通過,則返回錯誤碼 DryRunOperation

  • false(預設):傳送正常請求,通過檢查後直接調整執行個體的執行個體規格和公網頻寬大小。

false

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

樣本

正常返回樣本

JSON格式

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is not valid. 暫不支援指定的網路計費方式,請確認相關參數是否正確。
400 InvalidInstanceType.ValueUnauthorized The specified InstanceType does not exist or beyond the permitted range. 您指定的執行個體規格不存在,或者您沒有權限操作此規格的執行個體。
400 InvalidInstanceType.ValueNotSupported The specified InstanceType does not exist or beyond the permitted range. 指定的執行個體規格不支援目前執行個體掛載的資料磁碟規格。
400 InvalidParameter The specified parameter "InternetMaxBandwidthOut" is not valid.
400 InvalidParameter.Mismatch Too many parameters in one request. 非加密磁碟不能透過加密快照進行重設。
400 BandwidthUpgradeDenied.EipBoundInstance The specified VPC instance has bound EIP, temporary bandwidth upgrade is denied. 目前執行個體綁定了 EIP。
400 InvalidTemporary.StartTime The specifed Temporary.StartTime is not valid. 指定的臨時升級開始時間無效。
400 InvalidTemporary.EndTime The specifed Temporary.EndTime is not valid. 指定的臨時升級結束時間無效。
400 Downgrade.NotSupported Downgrade operation is not supported. 不支援降配。
400 DependencyViolation.InstanceType The current InstanceType cannot be changed to the specified InstanceType. 目前執行個體的規格不能變更到指定的規格。
400 Account.Arrearage Your account has an outstanding payment. 您的帳號存在未支付的款項。
400 InvalidParameter.Bandwidth The specified parameter Bandwidth is not valid. 指定的頻寬無效,請檢查參數是否正確。
400 InvalidParameter.Conflict The specified image does not support the specified instance type. 目前操作不允許同時設定 diskId 和 imageId,請確保 diskId 或 imageId 有一個不為空。
400 InvalidParameter.AllowMigrateAcrossZone The specified parameter CanMigrateAcrossZone is not valid. 指定的參數 CanMigrateAcrossZone 無效。
400 InvalidParam.SystemDiskCategory The specified param SystemDisk.Category is not valid. 指定的系統磁碟類型參數無效。
400 Throttling Request was denied due to request throttling, please try again after 5 minutes. 請求限流,請使用 nextToken 的分頁方式替代 PageNumber 的分頁方式進行查詢。
400 InvalidInstanceStatus.NotStopped The specified Instance status is not stopped. 修改安全啟動設定,但執行個體未處於停止狀態。
400 InvalidAction Specified action is not valid. 指定的操作類型不支援。
400 IdempotenceParamNotMatch There is a idempotence signature mismatch between this and last request. 冪等參數不相符。
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. 指定的 ClientToken 不合法。
400 Price.PricePlanResultNotFound The internetMaxBandwidthIn or internetMaxBandwidthOut provided is invalid. 提供的 internetMaxBandwidthIn 或 internetMaxBandwidthOut 無效。
400 InvalidAction.NotSupport The ecs on dedicatedHost not support modify instanceType. 專用宿主機上的執行個體不支援變更執行個體規格。
400 InvalidMarketImageStatus.NotSupported The status of specified market image does not support this operation. 指定的市場映像的狀態不支援該操作。
400 InvalidOperation.VpcHasEnabledAdvancedNetworkFeature The specified vpc has enabled advanced network feature. 該 VPC 開啟了進階特性,不能建立低規格的 ECS。
400 Invalid.PrivatePoolOptions.MatchCriteria Target mode does not support this operation. 指定參數「PrivatePoolOptions.MatchCriteria」無效。
400 InstanceTypeNotSupported.TooManyDisksAttached %s
400 InvalidDiskCategory.NotSupported The upgrade operation of instance does not support this category of disk.
400 InvalidParameter.CloudboxNotSupported %s
400 QuotaExceed.DiskCapacity The used capacity of disk type has exceeded the quota in the zone, %s. 指定磁碟類型的已用容量超出可用區配額限制,您可以前往配額中心查詢和申請提升磁碟容量配額。
400 InvalidParam.Async The specified parameter async is not valid. Async 參數不合法。
400 MissingParameter.DiskCategory The specified parameter Disk.Category can not be null when Disk.DiskId is specified.
400 InvalidParameter.DiskCategory The specified parameter Disk.Category is not valid.
400 InvalidPerformanceLevel.Malformed The specified parameter Disk.n.PerformanceLevel is not valid.
400 NoPermission.Price The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. 該操作需要價格權限。請向您的主帳戶申請權限,或將參數 AutoPay 設定為 true 進行自動支付。
400 InvalidParameter.DedicatedRegionNotSupported The specified action is rejected because the specified ECS instance in the dedicated region does not support public IP. 專屬雲端地域執行個體不支援公網 IP 相關參數。
400 InvalidOperation.OnlineModificationUnsupported Online modification of instance type is not supported for the specified instance due to its CPU topology. 目前 CPU 拓撲類型不支援熱變更配置。
400 QuotaExceeded.InternetBandwidth %s. 您目前帳號下,隨用隨付 ECS 執行個體的按固定頻寬計費公網頻寬超過了總頻寬配額限制。
400 InvalidOperation.InstanceTypeNotSupportRss The ECS instance type does not support Rss. 指定執行個體的規格不支援啟用 RSS。
400 InvalidInstanceType.NotSupportCpuOptionsNestedVirtualization The specified instance type does not support CpuOptions.NestedVirtualization: %s. 目前規格不支援指定的巢狀虛擬化能力。
401 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized. 您指定的執行個體規格不存在,或者您沒有權限操作此規格的執行個體。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 傳送請求時發生錯誤,請稍後重試。
403 CategoryViolation The specified instance does not support this operation because of its disk category.
403 InvalidStatus.ValueNotSupported The current status of the resource does not support this operation. 指定 issue 的 repairStatus 是無效的,預期的 status 是空或者 failed。
403 InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 該執行個體由於安全原因被鎖定,您可以聯絡安全技術支援。
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance.
403 ChargeTypeViolation The operation is not permitted due to charge type of the instance.
403 OperationDenied The specified instance is out of usage. 指定的 EIP 不可用或未獲授權。
403 LastTokenProcessing The last token request is processing.
403 InvalidInstance.UnpaidOrder The specified instance has unpaid order.
403 InstanceSpecModification.NotEffective The specified instance has been reserved for making a spec modification and not taken effective in the current contract period. 指定的執行個體因規格調整被保留,在目前合約期內無法生效。
403 InvalidInstanceType.ValueNotSupported The specified zone does not offer the specified instancetype. 指定的執行個體規格不支援目前執行個體掛載的資料磁碟規格。
403 ImageNotSupportInstanceType The specified image do not support the InstanceType instance. 指定的映像不支援選定執行個體規格的執行個體。
403 InstanceType.Offline The specified InstanceType has been offline. 指定的執行個體規格已下線。
403 InvalidParameter.NotMatch %s 指定的規格僅支援部分特定的映像,您可以使用 DescribeImages API 查詢可用的映像。
403 InvalidInstance.EipNotSupport The specified instance with eip is not supported, please unassociate eip first. 已綁定 EIP 的執行個體不支援該操作,請優先解除綁定 EIP。
403 InvalidInstance.NatPortMapNotSupport The special instance with nat port map not support operate, please remove nat port map first.
403 InvalidOperation.StarterPackage StarterPackage not support modification.
403 OperationDenied.NoStock The resource is out of usage.
403 OperationDenied.UnpaidOrder The specified instance has unpaid order. 指定的執行個體 ID 已存在未支付訂單,您可以登入 ECS 管理主控台支付。
403 InvalidOperation.EipNotSupport The special instance with eip not support operate, please unassociate eip first.
403 InvalidParameter.InternetMaxBandwidthOut The specified parameter InternetMaxBandwidthOut is invalid.
403 InvalidOperation.EniCountExceeded %s
403 InvalidOperation.Ipv4CountExceeded %s 當前 ECS 綁定的彈性網卡上的 IPv4 位址數量超過了目標規格的限制。
403 InvalidOperation.Ipv6CountExceeded %s 當前 ECS 執行個體綁定的彈性網卡上的 IPv6 位址數量超過了目標規格的限制。
403 InvalidOperation.Ipv6NotSupport %s 當前執行個體規格不支援 IPv6。
403 InvalidOperation.Ipv4NotSupport %s
403 InvalidOperation.InstanceWithEipNotSupport The special instance with eip not support operate, please unassociate eip first. 已綁定 EIP 的執行個體不支援該操作,請優先解除綁定 EIP。
403 SecurityRisk.3DVerification We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. 我們偵測到您的預設信用卡或金融卡存在安全風險。請透過電子郵件中的連結進行驗證。
403 InvalidInstance.NotFoundSystemDisk The specified instance has no system disk.
403 InvalidInstanceType.NotSupportDiskCategory The instanceType of the specified instance does not support this disk category. 指定的執行個體規格(InstanceType)不支援目前執行個體的雲端硬碟類別。請嘗試更換其他執行個體規格。關於執行個體規格支援的雲端硬碟類型,請參閱執行個體規格族文件。
403 QuotaExceed.ElasticQuota No additional quota is available for the specified ECS instance type. ECS 用量超過配額上限,請到阿里雲官網控制台申請提升配額。
403 InvalidResourceType.NotSupported %s 指定資源組合不存在,請更換其他可用區或規格。
403 InvalidOperation.NotAllowed The specified vpc %s has enabled senior network feature.
403 InvalidOperation.InstanceTypeNotSupportEniTrunking %s 該執行個體規格不支援彈性網卡的中繼操作。
403 InvalidOperation.MaxEniQueueNumberExceeded %s 彈性網卡佇列數超過上限,具體資訊請參見錯誤訊息 %s 預留位置的實際返回結果。
403 InvalidOperation.ExceedInstanceTypeQueueNumber %s 目前 ECS 執行個體綁定的彈性網卡佇列數超過了目標規格限制的網卡佇列數。
403 InvalidParameter.InvalidEniQueueNumber %s 彈性網卡佇列數有誤,具體資訊請參見錯誤訊息 %s 預留位置的實際回傳結果。
403 HibernationConfigured.InstanceOperationForbidden The operation is not permitted due to limit of the hibernation configured instance. 不符合開啟休眠選項的執行個體的相關限制,操作不被允許。
403 InvalidOperation.InstanceTypeNotSupportHighPerformanceTrafficMode %s 當前執行個體規格不支援掛載 RDMA 網卡。
403 InvalidOperation.EniQueuePairNumberOverflow %s
403 InvalidOperation.HighPerformanceEniPerInstanceLimitExceeded %s
403 InvalidOperation.MaxEniQueuePairNumberExceed %s
403 InvalidOperation.MaxModifyOnlineNumberExceeded The specified instance has reached the maximum number of modify online attempts and needs to be rebooted.
403 InvalidOperation.RebootingRequired The specified instance needs to be rebooted.
403 InvalidOperation.OSTypeNotSupported The specified OS type is not supported.
403 InvalidSystemDiskCategory.ValueNotSupported The specified parameter SystemDisk.Category is not valid. 指定的參數系統磁碟規格無效。
403 InvalidDataDiskCategory.ValueNotSupported The specified Category of Data Disk is not valid. 指定參數 DataDisk.Category 錯誤。
403 InvalidDiskCategory.NotSupported The upgrade operation of instance does not support this category of disk. 指定的雲端硬碟類型在當前可用區不支援。請修改雲端硬碟類型或更換可用區並重試。
403 InvalidOperation.InstanceTypeSecureBootUnsupported The instance type does not support secure boot. 執行個體規格不支援安全啟動。
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的執行個體 ID 無效。
404 MissingTemporary.StartTime Temporary.StartTime is not specified. 未指定臨時升級開始時間。
404 MissingTemporary.EndTime Temporary.EndTime is not specified. 未指定臨時升級結束時間。
404 InvalidInstanceChargeType.NotFound The InstanceChargeType does not exist in our records.
503 LimitedOperation.ServiceUnavailable The service is currently unavailable. Please try again later. 目前服務不可用。請稍後重試。

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

變更歷史

更多資訊,參考變更詳情