全部产品
Search
文档中心

云服务器 ECS:ModifyDiskSpec - 变更云盘类型或性能级别

更新时间:Mar 19, 2024

调用ModifyDiskSpec变更一块云盘类型,或者修改一块ESSD云盘的性能级别。

接口说明

调用该接口完成以下操作时,您需要注意:

  • 修改 ESSD 云盘性能级别:

    • 包年包月 ESSD 云盘仅支持升级性能级别。

    • 按量付费 ESSD 云盘支持升级和降低性能级别,但不支持降配到 PL0。

    • ESSD 云盘的状态必须是使用中(In_Use)状态或者待挂载(Available)状态。

    • 若 ESSD 云盘已挂载到 ECS 实例上,实例必须处于运行中(Running)状态或者已停止(Stopped)状态,ECS 实例不能处于过期或者账号欠费状态。

    • 由于 ESSD 云盘性能级别受容量限制,如果您无法升级性能级别,可以扩容( ResizeDisk )后重新操作。更多信息,请参见 ESSD 云盘

  • 变更一块云盘类型的注意事项,请参见变更云盘类型中的限制条件章节。

调用接口后,新的云盘类型立即生效,阿里云按照新的云盘类型及云盘性能级别单价计算消费账单。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ecs:ModifyDiskSpecWrite
  • Disk
    acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}
  • ecs:tag

请求参数

名称类型必填描述示例值
DiskIdstring

云盘的 ID。

d-bp131n0q38u3a4zi****
PerformanceLevelstring

修改一块 ESSD 云盘的性能级别。取值范围:

  • PL0:单盘最高随机读写 IOPS 1 万。
  • PL1:单盘最高随机读写 IOPS 5 万。
  • PL2:单盘最高随机读写 IOPS 10 万。
  • PL3:单盘最高随机读写 IOPS 100 万。

默认值:PL1。

PL2
DiskCategorystring

变更一块云盘的类型。取值范围:

  • cloud_essd:ESSD 云盘。

  • cloud_auto:ESSD AutoPL 云盘。

  • cloud_ssd:SSD 云盘。

  • cloud_efficiency:高效云盘。

默认值:空,表示不变配云盘。

说明
  • 以上有效取值按云盘性能降序排列。如果指定的云盘是包年包月云盘,则不允许降配云盘。
  • cloud_essd
    DryRunboolean

    是否只预检此次请求。取值范围:

    • true:发送检查请求。检查项包括是否填写了必需参数、请求格式、业务限制和 ECS 库存。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation

    • false:发送正常请求,通过检查后返回 2XX HTTP 状态码并且直接变配云盘或修改 ESSD 性能等级。

    默认值:false。

    false
    ProvisionedIopslong

    是否修改 ESSD AutoPL 云盘预配置读写 IOPS。取值范围:0~min{50000, 1000*容量-基准性能}。

    基准性能=min{1,800+50*容量, 50,000}

    说明 当 DiskCategory 取值为 cloud_auto 时才支持设置该参数。更多信息,请参见ESSD AutoPL 云盘修改 ESSD AutoPL 云盘预配置信息
    50000
    PerformanceControlOptionsobject

    磁盘性能控制参数集合

    IOPSinteger

    目标云盘 IOPS。仅支持修改专属存储集群云盘 IOPS。

    取值范围:900~单盘最大 IOPS,步长 100。

    更多信息,请参见云盘性能

    2000
    Throughputinteger

    目标云盘吞吐量,仅支持修改专属存储集群云盘吞吐量,单位 MB/s。

    取值范围:60~单盘最大吞吐量。

    更多信息,请参见云盘性能

    200
    Recoverstring

    重置云盘性能,仅支持专属存储集群云盘。

    设置该参数后,PerformanceControlOptions.IOPS 和 PerformanceControlOptions.Throughput 参数不生效。

    目前仅支持设置为 All(重置云盘 IOPS 和吞吐量到初始值)。

    All

    返回参数

    名称类型描述示例值
    object
    RequestIdstring

    请求 ID。

    473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
    TaskIdstring

    变配云盘的任务 ID。

    说明 如果您只修改了一块 ESSD 云盘的性能级别,则不会返回该参数。
    t-bp67acfmxazb4p****
    OrderIdstring

    生成的订单 ID。

    说明 仅在变更或修改包年包月云盘时会返回订单 ID。
    20413515388****

    示例

    正常返回示例

    JSON格式

    {
      "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
      "TaskId": "t-bp67acfmxazb4p****",
      "OrderId": "20413515388****"
    }

    错误码

    HTTP status code错误码错误信息描述
    400InvalidPerformanceLevel.MalformedThe specified parameter PerformanceLevel is not valid.指定的参数 PerformanceLevel 无效。
    400InvalidDiskCategory.ValueNotSupportedThe specified parameter "DiskCategory" is not valid.-
    400InvalidPerformanceLevelParam.MismatchThe specified parameter PerformanceLevel should be null when DiskCategory is not cloud_essd.-
    400OperationDenied.DiskInDedicatedBlockStorageClusterThe disk in dedicated block storage cluster is not allowed to do this operation.-
    400IncorrectDiskStatus.ReplicationStatusNotFoundDisk replication status not found.-
    400IncorrectDiskStatus.InReplicationDisk already in replication.-
    400ProvisionedIopsForDiskCategoryUnsupportedThe specified disk category does not support provisioned iops.指定的磁盘类型不支持预配置IOPS。
    400InvalidProvisionedIops.LimitExceedThe provisioned iops exceeds the limit.-
    400QuotaExceed.DiskCapacityThe used capacity of disk type has exceeded the quota in the zone, %s.指定磁盘类型的已用容量超出可用区配额限制,您可以前往配额中心查询和申请提升磁盘容量配额。
    400MalformedParameter.PerformanceControlOptionsParameter invalid, %s.参数不合法
    400InvalidPerformanceControlOptions.ModifyOperationUnsupportedThe specified performance control options are conflicts with disk category or performance level or ProvisionIOPS.磁盘性能控制参数与磁盘类型、磁盘性能等级、预配置IOPS参数冲突。
    400NoPermission.PriceThe operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true.-
    400NoPermission.RefundThe operation requires refund permission. Please apply for permission from your main account.-
    400InvalidOperation.InstanceRenewWithDowngradeInPlanThe operation is denied due to the specified instance has renew with downgrade record in plan.存在未生效的续费降配订单。订单生效前不允许此操作。
    400InvalidParameter.Conflict%s您输入的参数无效,请检查参数之间是否冲突。%s为变量,将根据调用API的实际情况动态返回错误信息。
    403DiskInArrearsThe specified operation is denied as your disk owing fee.指定的磁盘已欠费。
    403InstanceExpiredOrInArrearsThe specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).实例已过期或者欠费,请您续费或者结清后再进行操作。
    403IncorrectDiskStatusThe current disk status does not support this operation.当前的磁盘不支持此操作,请您确认磁盘处于正常使用状态,是否欠费。
    403DiskCreatingSnapshotThe operation is denied due to a snapshot of the specified disk is not completed yet.指定的磁盘正在创建快照。
    403OperationDeniedThe type of the disk does not support the operation.此磁盘种类不支持指定的操作。
    403InvalidPerformanceLevel.TooLowSpecified new performance level is lower than the original performance level.-
    403OperationDenied.PerformanceLevelNotMatchThe specified PerformanceLevel and disk size do not match.指定的性能等级与磁盘大小不匹配。
    403UserNotInTheWhiteListThe user is not in modify disk category white list.-
    403InvalidRegion.NotSupportThe specified region does not support modify disk category.-
    403InvalidDiskCategory.ValueNotSupportedThe current disk category of the resource does not support this operation.-
    403Downgrade.NotSupportedDowngrade operation for prepay resource is not supported.-
    403InvalidInstanceType.NotSupportDiskCategoryThe instanceType of the specified instance does not support this disk category.指定的实例规格(InstanceType)不支持当前实例的云盘类别。请尝试更换其它实例规格。关于实例规格支持的云盘类型,请参见实例规格族文档。
    403ModifyingDiskCategoryLimitExceedThe amount of modifying disk category exceeds the limit.当前地域正在变配的磁盘个数超过上限
    403DiskInCoolingPeriodThere is a cooling period after the disk is successfully modified.云盘处于变配周期限制中,不可再次发起变配
    403DiskHasFlashSnapshotThe specified disk with flash snapshots do not support modify disk category.-
    403NoChangeInDiskCategoryAndPerformanceLevelThere is no change between the parameters transmitted and the current.您所传的磁盘种类和性能等级与当前磁盘一致
    403OperationDenied.NoStockThe requested resource is sold out in the specified zone; try other types of resources or other regions and zones.库存不足。
    403InvalidOperation.MultiAttachDiskMulti attach disk does not support this operation.开启多重挂载特性的云盘不支持该操作。
    403OperationDenied.DiskExpansionUnfinishedThe instance has not been restarted after a previous disk expansion.-
    403InvalidDiskCategory.NotSupportedThe specified disk category is not supported.指定的云盘类型不支持当前操作。
    403InvalidPerformanceParameter.DiskNotInDedicatedStorageClusterThe specified disk not in dedicated storage cluster, can not modify performance control options.非专属存储集群磁盘不支持修改磁盘性能控制参数。
    403InvalidStatus.DiskUnderPerformanceControlThe specified disk is under performance control, any modifications to the category or performance level of the specified disk are unsupported..磁盘处于性能控制状态,无法进行磁盘类型、性能等级变更。
    403InvalidStatus.DiskNotReadyThis specified disk is not ready, status needs to be either In_use or Available.指定磁盘的状态必须是In_use或Available。
    404InvalidDiskId.NotFoundThe specified disk does not exist.指定的磁盘不存在。请您检查磁盘 ID 是否正确。
    404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.指定的实例ID未找到。
    500InternalErrorThe request processing has failed due to some unknown error, exception or failure.内部错误,请重试。

    访问错误中心查看更多错误码。

    变更历史

    变更时间变更内容概要操作
    2024-01-29OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
      删除错误码:500
    2023-10-18OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
      删除错误码:500
    2023-05-16OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:403
      删除错误码:404
      删除错误码:500
    2023-04-17OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      错误码 403 变更
      删除错误码:404
      删除错误码:500
    入参OpenAPI 入参发生变更
      新增入参:PerformanceControlOptions